Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Percent-encode additional characters in "fragment state". #347

Merged
merged 4 commits into from Dec 5, 2017
Merged

Percent-encode additional characters in "fragment state". #347

merged 4 commits into from Dec 5, 2017

Conversation

mikewest
Copy link
Member

@mikewest mikewest commented Oct 9, 2017

Currently, we percent-encode characters in "fragment state" using the C0
control percent-encode set. Firefox encodes more than that, and it seems
reasonable to align around that behavior for reasons spelled out in #291
and the comments of #344.

This patch adds a new "fragment percent-encode set" which contains the
C0 control percent-encode set, along with:

  • 0x22 (")
  • 0x3C (<)
  • 0x3E (>)
  • 0x60 (`)

Closes #344.


Preview | Diff

Currently, we percent-encode characters in "fragment state" using the C0
control percent-encode set. Firefox encodes more than that, and it seems
reasonable to align around that behavior for reasons spelled out in #291
and the comments of #344.

This patch adds a new "fragment percent-encode set" which contains the
C0 control percent-encode set, along with:

* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

Closes #344.
@mikewest
Copy link
Member Author

mikewest commented Oct 9, 2017

I'll put tests together shortly.

mikewest added a commit to web-platform-tests/wpt that referenced this pull request Oct 9, 2017
Tests for the new percent-encoding rules introduced in whatwg/url#347.
url.bs Outdated
@@ -177,6 +177,9 @@ U+003E (>), U+003F (?), U+0060 (`), U+007B ({), and U+007D (}).
<a>path percent-encode set</a> and U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@),
U+005B ([), U+005C (\), U+005D (]), U+005E (^), and U+007C (|).

<p>The <dfn>fragment percent-encode set</dfn> is the <a>C0 control percent-encode set</a> and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we try to define path percent-encode set as a superset of fragment percent-encode set, for parity with userinfo->path.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Poked at it in f258f4d. WDYT?

url.bs Outdated
@@ -169,9 +169,11 @@ contains bytes that are not <a>ASCII bytes</a> might be insecure and is not reco
<p>The <dfn oldids=simple-encode-set>C0 control percent-encode set</dfn> are the <a>C0 controls</a>
and all <a>code points</a> greater than U+007E (~).

<p>The <dfn>fragment percent-encode set</dfn> is the <a>C0 control percent-encode set</a> and
U+0022 SPACE, U+0022 ("), U+003C(&lt;), U+003E (&gt;), and U+0060 (`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

U+0020 SPACE.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. That was super-dumb. Fixed in d1d85b2.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final nit I suspect, other than getting the tests in order.

url.bs Outdated
@@ -169,9 +169,11 @@ contains bytes that are not <a>ASCII bytes</a> might be insecure and is not reco
<p>The <dfn oldids=simple-encode-set>C0 control percent-encode set</dfn> are the <a>C0 controls</a>
and all <a>code points</a> greater than U+007E (~).

<p>The <dfn>fragment percent-encode set</dfn> is the <a>C0 control percent-encode set</a> and
U+0020 SPACE, U+0022 ("), U+003C(&lt;), U+003E (&gt;), and U+0060 (`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after U+003C.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for web-platform-tests/wpt#7641 now.

domenic added a commit to jsdom/whatwg-url that referenced this pull request Oct 10, 2017
@domenic
Copy link
Member

domenic commented Oct 10, 2017

The OP/commit message omit U+0020 space

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 15, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
@annevk
Copy link
Member

annevk commented Oct 16, 2017

Tests moved to web-platform-tests/wpt#7776 though setter tests are not updated. Seems like jsdom doesn't run those.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 18, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 17, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 20, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 20, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 20, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 1, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 1, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 1, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
@mikewest
Copy link
Member Author

mikewest commented Dec 1, 2017

Snapping back to this after @noncombatant pinged the internal bug. Sorry I lost the thread.

@domenic, @annevk: Does the current set of tests on web-platform-tests/wpt#7776 make sense to you? If so, I think we're done here. :) If not, I'll fix them.

@annevk
Copy link
Member

annevk commented Dec 1, 2017

Looks good to me, but I'll let @domenic verify with the jsdom impl.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 1, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
@domenic
Copy link
Member

domenic commented Dec 1, 2017

Tests are still not quite right, so it's worth straightening that out first.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 4, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 4, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
@domenic
Copy link
Member

domenic commented Dec 4, 2017

Tests good, this (and its tests) can be merged :)

annevk pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 5, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)
@annevk annevk merged commit 7a3c69f into whatwg:master Dec 5, 2017
@annevk
Copy link
Member

annevk commented Dec 5, 2017

@mikewest could you file implementation bugs? I'm guessing just for Edge/Safari?

@mikewest mikewest deleted the fragment-percent-encode branch December 5, 2017 08:23
@mikewest
Copy link
Member Author

mikewest commented Dec 5, 2017

WebKit: https://bugs.webkit.org/show_bug.cgi?id=180396
Edge: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/14951215/ (looks like the latter has some escaping issues with URLs. :( )

@annevk
Copy link
Member

annevk commented Dec 5, 2017

Thanks, I emailed some folks at Microsoft to look into that, since it makes reporting bugs against Edge much harder than it should be.

domenic added a commit to jsdom/whatwg-url that referenced this pull request Dec 5, 2017
domenic added a commit to jsdom/whatwg-url that referenced this pull request Dec 5, 2017
MXEBot pushed a commit to mirror/chromium that referenced this pull request Dec 13, 2017
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
Reviewed-on: https://chromium-review.googlesource.com/719004
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523383}
@RByers
Copy link

RByers commented Jan 17, 2018

For the record, chromium bug here: https://bugs.chromium.org/p/chromium/issues/detail?id=803103

shr-project pushed a commit to meta-qt5/qtwebengine-chromium that referenced this pull request Apr 18, 2018
Percent-encode UTF8 characters in URL fragment identifiers.

This brings us into line with Firefox, Safari, and the spec.

Bug: 758523
Reviewed-on: https://chromium-review.googlesource.com/668363
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Andy Paicu <andypaicu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507481}

Encode ' ', '"', '<', '>', and '`' in URL fragments.

Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Reviewed-on: https://chromium-review.googlesource.com/719004
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523383}

Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
malloxpb pushed a commit to scrapy/url-chromium that referenced this pull request Jul 12, 2018
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
Reviewed-on: https://chromium-review.googlesource.com/719004
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#523383}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 01c25d47d2d22456368363e576083d766eedf8f6
rmisev added a commit to rmisev/url_whatwg that referenced this pull request May 24, 2020
ns-rsilva pushed a commit to ns-rsilva/chromium that referenced this pull request Apr 25, 2024
Implements the changes to fragment processing described in
whatwg/url#347, which adds a new "fragment
percent-encode set" which contains the C0 control percent-encode set,
along with:

* 0x20 SPACE
* 0x22 (")
* 0x3C (<)
* 0x3E (>)
* 0x60 (`)

This brings our implementation into line with Firefox.

Bug: 758523
Change-Id: I25de642017ccb69473626a327ad194b3431a11ed
Reviewed-on: https://chromium-review.googlesource.com/719004
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523383}
Former-commit-id: 01c25d47d2d22456368363e576083d766eedf8f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants