<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27596</bug_id>
          
          <creation_ts>2014-12-12 18:14:52 +0000</creation_ts>
          <short_desc>Need a better story for searchParams and URLSearchParams</short_desc>
          <delta_ts>2015-08-14 09:32:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>URL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>crimsteam</cc>
    
    <cc>d</cc>
    
    <cc>erik.arvidsson</cc>
    
    <cc>mamacdon</cc>
    
    <cc>MattN+w3</cc>
    
    <cc>mike</cc>
    
    <cc>rubys</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116232</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-12-12 18:14:52 +0000</bug_when>
    <thetext>The tentative plan is to make searchParams readonly and the relationship 1:1. However, for Location we need something more complicated due to Location&apos;s insanity.

Possible ideas for Location&apos;s searchParams and URLSearchParams:

1) Not have it
2) Scope lifetime to document (though how does that actually work if you set it for a prior document?)
3) Copy Location&apos;s security model (seems way mad)
4) Create an immutable variant

Some background: https://bugzilla.mozilla.org/show_bug.cgi?id=1105677</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116233</commentid>
    <comment_count>1</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-12-12 19:08:56 +0000</bug_when>
    <thetext>I like the idea of having .searchParams only return the same object until a navigation occurs, or possibly until an origin change occurs, as per https://bugzilla.mozilla.org/show_bug.cgi?id=1082734. People in that thread seem to prefer removing it entirely though; I&apos;m not sure if there&apos;s a problem with the changing-return-value idea, or if they just find it too complicated.

An alternate approach that seems OK-ish would be to remove .searchParams and add .parseSearchParams(). Then URLSearchParams no longer becomes something that auto-updates its associated url objects, but instead just an in-memory data structure for application/x-www-form-urlencoded manipulation. User code might then look like

var searchParams = myURL.parseSearchParams();
searchParams.set(&apos;foo&apos;, &apos;bar&apos;);
myURL.search = searchParams.toString();

(You could also consider at this point renaming URLSearchParams to FormURLEncodedParams or something else to emphasize its general-purpose nature.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120990</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-15 13:52:46 +0000</bug_when>
    <thetext>Solution 4 from comment 0 does not actually work. For now I&apos;m going to specify 1 since I&apos;m not sure how to tackle this for Location.

Making it readonly will have to happen separately.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120991</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-15 14:20:42 +0000</bug_when>
    <thetext>https://github.com/whatwg/url/commit/3a5e8086aff2fe3baa57fcebd1795a16de4f5d16 puts searchParams on its own interface. HTML still needs updating to add it to HTMLAreaElement and HTMLAnchorElement, but not Location.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121211</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-18 09:58:59 +0000</bug_when>
    <thetext>(In reply to Anne from comment #2)
&gt; Making it readonly will have to happen separately.

Mostly waiting for https://bugzilla.mozilla.org/show_bug.cgi?id=1174731 to be fixed in Gecko to do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121473</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-06-25 15:24:25 +0000</bug_when>
    <thetext>That is fixed now, will update the specification next week I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122608</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-08-14 09:32:50 +0000</bug_when>
    <thetext>https://github.com/whatwg/url/commit/0fdcfbcc58f713d3d804a0cbbe6c1d0cadab2962</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>