[wpt-sync] Sync PR 27007 - Fix serialization for <noscript> contents when script is disabled
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
People
(Reporter: wpt-sync, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 27007 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/27007
Details from upstream follow.
b'Mason Freed <masonfreed@chromium.org>' wrote:
Fix serialization for <noscript> contents when script is disabled
Previous to this CL, serialization for \<noscript> nodes in a
document with (per spec) no execution context would still not
escape (e.g. '\<' --> '<') the contents. This allowed a sanitizer
bypass.I added a fairly comprehensive test of the many fragment parser entry
points here. Before this CL (and on other browsers):
- Chrome would never escape \<noscript> contents. (This bug)
- Firefox would never escape \<noscript> contents. (Should raise a bug)
- Safari always escapes \<noscript> contents, even when it
shouldn't, such as with div.innerHTML, div.insertAdjacentHTML,
and document.write on the main document. (Should raise a bug)An additional set of differences showed up for the parsing escaping
behavior:
- Chrome would (and still does) de-escape \<noscript> contents when
parsing in a script-disabled context, such as DOMParser or
createHTMLDocument.innerHTML. It does not de-escape \<noscript>
contents in script-enabled contexts, such as div.innerHTML and
document.write. This all seems correct to me.- Safari behaves identically to Chrome here (correct).
- Firefox de-escapes \<noscript> contents in some cases (e.g.
XMLHTTPRequest, document.write) but not others (e.g.
template.innerHTML, createHTMLDocument.innerHTML, and
createHTMLDocument.createContextualFragment).I looked for a spec issue, but didn't find one. If there really isn't
a spec issue for this, we should raise one.Fixed: 1160635
Change-Id: I361a72409093e69b074495c475e9d647c6c58300
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/2602447
WPT-Export-Revision: 1afb2f8ef50a414e8c6f59ab1eef174aafa7554c
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
CI Results
Ran 14 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests and 9 subtests
Status Summary
Firefox
OK : 1
PASS: 3
FAIL: 6
Chrome
OK : 1
PASS: 3
FAIL: 6
Safari
OK : 1
PASS: 6
FAIL: 3
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
/html/syntax/serializing-html-fragments/escaping.html
DOMParser.parseFromString: FAIL (Chrome: FAIL, Safari: PASS)
template.innerHTML: FAIL (Chrome: FAIL, Safari: PASS)
document.implementation.createHTMLDocument and innerHTML: FAIL (Chrome: FAIL, Safari: PASS)
document.implementation.createHTMLDocument and createContextualFragment: FAIL (Chrome: FAIL, Safari: PASS)
document.implementation.createHTMLDocument and document.write: FAIL (Chrome: FAIL, Safari: PASS)
XMLHttpRequest: FAIL (Chrome: FAIL, Safari: PASS)
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cfa0c3eac32e
https://hg.mozilla.org/mozilla-central/rev/047175aa7280
Comment 5•4 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-esr78/rev/fc1c60983fbc
https://hg.mozilla.org/releases/mozilla-esr78/rev/f0716e84d80f
Description
•