|
|
Created:
4 years, 8 months ago by sof Modified:
4 years, 8 months ago CC:
chromium-reviews, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews, rwlbuis Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionHave (new URLSearchParams(initString)) skip initial '?'.
The spec now requires that when a URLSearchParams is initialized from
a string, an initial '?' should be ignored from that string,
https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams
It accommodating usage like (new URLSearchParams(url.search))
R=
BUG=601425
Committed: https://crrev.com/06b35c408742d5e63be72ad7c2fed4073b7caf12
Cr-Commit-Position: refs/heads/master@{#388842}
Patch Set 1 #
Total comments: 3
Patch Set 2 : fix misguided comment #
Messages
Total messages: 16 (6 generated)
Description was changed from ========== Have new URLSearchParams(usvString) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 ========== to ========== Have new URLSearchParams(initString) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 ==========
Description was changed from ========== Have new URLSearchParams(initString) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 ========== to ========== Have (new URLSearchParams(initString)) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 ==========
sigbjornf@opera.com changed reviewers: + mkwst@chromium.org, philipj@opera.com
please take a look. spec catchup.
https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... File third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html (right): https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html:41: // Encoding '?' aligns with Firefox, spec doesn't insist it is encoded. '?' is 0x3F and I end up in https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer where that's one of the code points that end up in "Append byte, percent encoded, to output." Is there anything going on here that I'm missing, that might require a change to the spec or some browser?
https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... File third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html (right): https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html:41: // Encoding '?' aligns with Firefox, spec doesn't insist it is encoded. On 2016/04/21 13:13:50, philipj_slow wrote: > '?' is 0x3F and I end up in > https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer where that's one > of the code points that end up in "Append byte, percent encoded, to output." > > Is there anything going on here that I'm missing, that might require a change to > the spec or some browser? You want to consider parsing first, I think -- https://url.spec.whatwg.org/#query-state
https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... File third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html (right): https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html:41: // Encoding '?' aligns with Firefox, spec doesn't insist it is encoded. On 2016/04/21 13:19:10, sof wrote: > On 2016/04/21 13:13:50, philipj_slow wrote: > > '?' is 0x3F and I end up in > > https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer where that's > one > > of the code points that end up in "Append byte, percent encoded, to output." > > > > Is there anything going on here that I'm missing, that might require a change > to > > the spec or some browser? > > You want to consider parsing first, I think -- > https://url.spec.whatwg.org/#query-state Starting at the URLSearchParams constructor I end up in https://url.spec.whatwg.org/#concept-urlencoded-parser where I can't see anything special with '?', but I actually can't in "query state" either, AFAICT one would end up in step 1.3.2 or 2.3, which just append. What caught my attention was "spec doesn't insist", because if it isn't clear per spec then I think Anne would consider that a bug. What's your reading of the spec on this point?
On 2016/04/21 13:38:07, philipj_slow wrote: > https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... > File third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html > (right): > > https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... > third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html:41: > // Encoding '?' aligns with Firefox, spec doesn't insist it is encoded. > On 2016/04/21 13:19:10, sof wrote: > > On 2016/04/21 13:13:50, philipj_slow wrote: > > > '?' is 0x3F and I end up in > > > https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer where that's > > one > > > of the code points that end up in "Append byte, percent encoded, to output." > > > > > > Is there anything going on here that I'm missing, that might require a > change > > to > > > the spec or some browser? > > > > You want to consider parsing first, I think -- > > https://url.spec.whatwg.org/#query-state > > Starting at the URLSearchParams constructor I end up in > https://url.spec.whatwg.org/#concept-urlencoded-parser where I can't see > anything special with '?', but I actually can't in "query state" either, AFAICT > one would end up in step 1.3.2 or 2.3, which just append. > Oh, so the URLSearchParams() ctor does & uses the application/x-www-form-urlencoded parser straight and not encoding the 'query' string first. Hmm, I need to investigate where/how the '?' treatment enters in our implementation.
On 2016/04/21 13:59:56, sof wrote: > On 2016/04/21 13:38:07, philipj_slow wrote: > > > https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... > > File > third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html > > (right): > > > > > https://codereview.chromium.org/1906773002/diff/1/third_party/WebKit/LayoutTe... > > > third_party/WebKit/LayoutTests/fast/domurl/urlsearchparams-constructor.html:41: > > // Encoding '?' aligns with Firefox, spec doesn't insist it is encoded. > > On 2016/04/21 13:19:10, sof wrote: > > > On 2016/04/21 13:13:50, philipj_slow wrote: > > > > '?' is 0x3F and I end up in > > > > https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer where > that's > > > one > > > > of the code points that end up in "Append byte, percent encoded, to > output." > > > > > > > > Is there anything going on here that I'm missing, that might require a > > change > > > to > > > > the spec or some browser? > > > > > > You want to consider parsing first, I think -- > > > https://url.spec.whatwg.org/#query-state > > > > Starting at the URLSearchParams constructor I end up in > > https://url.spec.whatwg.org/#concept-urlencoded-parser where I can't see > > anything special with '?', but I actually can't in "query state" either, > AFAICT > > one would end up in step 1.3.2 or 2.3, which just append. > > > > Oh, so the URLSearchParams() ctor does & uses the > application/x-www-form-urlencoded parser straight and not encoding the 'query' > string first. > > Hmm, I need to investigate where/how the '?' treatment enters in our > implementation. ok, this indeed all happens upon encoding during stringification (via KURL's encodeWithURLEscapeSequences()) and it is treating '?' as required by https://url.spec.whatwg.org/#concept-urlencoded-byte-serializer (but see https://crbug.com/557063) I've fixed the comment.
lgtm
The CQ bit was checked by sigbjornf@opera.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1906773002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1906773002/20001
Message was sent while issue was closed.
Description was changed from ========== Have (new URLSearchParams(initString)) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 ========== to ========== Have (new URLSearchParams(initString)) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Have (new URLSearchParams(initString)) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 ========== to ========== Have (new URLSearchParams(initString)) skip initial '?'. The spec now requires that when a URLSearchParams is initialized from a string, an initial '?' should be ignored from that string, https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams It accommodating usage like (new URLSearchParams(url.search)) R= BUG=601425 Committed: https://crrev.com/06b35c408742d5e63be72ad7c2fed4073b7caf12 Cr-Commit-Position: refs/heads/master@{#388842} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/06b35c408742d5e63be72ad7c2fed4073b7caf12 Cr-Commit-Position: refs/heads/master@{#388842} |