Bug 1477919 [wpt PR 12154] - url: DecodeURLEscapeSequences() should not apply UTF-8 and isomorphic encoding to a single input., a=testonly

Automatic update from web-platform-testsurl: DecodeURLEscapeSequences() should not apply UTF-8 and isomorphic encoding to a single input.

DecodeURLEscapeSequences() decoded some parts of an input string in UTF-8,
and other parts of the string in isomorphic encoding. This behavior doesn't
make sense, is harmful against browser interoperability, and is used only
in 0.0013% of page views (only in scroll-to-fragment cases).

DecodeURLEscapeSequences() is used in many code paths, and we have usage
data only for scroll-to-framgnet. However this CL tries to remove this
weird behavior entirely.

Bug: 845824
Change-Id: Ib1cbbd3e1c26ebaaca7b3537b9732121835fdc9f
Reviewed-on: https://chromium-review.googlesource.com/1146535
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578151}

--

wpt-commits: c54b4511852cd7acdb0aed4108f38487ab95418f
wpt-pr: 12154
This commit is contained in:
Kent Tamura 2018-07-30 14:59:55 +00:00 коммит произвёл moz-wptsync-bot
Родитель 136b5e80a7
Коммит 20ffecbc92
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -574811,7 +574811,7 @@
"testharness"
],
"html/browsers/browsing-the-web/scroll-to-fragid/fragment-and-encoding.html": [
"c971911f997816b711e634a506178a24c5680401",
"21fbd4618da539e7bc7b9939bf8193337cd59e29",
"testharness"
],
"html/browsers/browsing-the-web/scroll-to-fragid/navigate-helpers.js": [

Просмотреть файл

@ -7,6 +7,7 @@
<div style=height:10000px></div>
<div id=&#xFF;></div>
<div id=&#xFEFF;></div>
<div id=&#x2661;&#x00FF;><div>
<script>
function goToTop() {
location.hash = "top";
@ -34,4 +35,16 @@ test(() => {
location.hash = "%FF";
assert_equals(self.scrollY, 0, "#%FF");
}, "%FF should not find U+00FF as decoding it gives U+FFFD");
test(() => {
goToTop();
// U+2661 in UTF-8 + %FF.
// Chrome had an issue that the following fragment was decoded as U+2661 U+00FF.
// https://github.com/whatwg/html/pull/3111
location.hash = "%E2%99%A1%FF";
assert_equals(self.scrollY, 0, "%E2%99%A1%FF");
goToTop();
}, "Valid UTF-8 + invalid UTF-8 should not be matched to the utf8-decoded former + the isomorphic-decoded latter");
</script>