[wpt-sync] Sync PR 65018 - Move template sanitization to <template for src>
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 65018 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/65018
Details from upstream follow.
Noam Rosenthal <nrosenthal@chromium.org> wrote:
Move template sanitization to <template for src>
Align \<template> sanitization with the declarative fragment explainer:
- Remove inline/main-parser per-template sanitization from
HTMLConstructionSite and HTMLStackItem so the "sanitize" attribute
only applies when "src" is present.- Apply default sanitization (empty Sanitizer + removeUnsafe(), or
cloning the enclosing parser's Sanitizer + removeUnsafe()) to
external fragments fetched via \<template for src>.- Allow opting out of the additional removeUnsafe() step via
sanitize="unsafe", inheriting the enclosing parser context's
sanitizer state.Bug: 535664974
Fixed: 581892399
Change-Id: I45ed4fc31387e787823163d50d8009f429a03dbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8727130
Reviewed-by: Mason Freed \<masonf@chromium.org>
Commit-Queue: Noam Rosenthal \<nrosenthal@google.com>
Cr-Commit-Position: refs/heads/main@{#1741555}
| Assignee | ||
Comment 1•14 days ago
|
||
PR 65018 applied with additional changes from upstream: 46d4468f3228c4599e4a9d7e72255ff09e632924
| Assignee | ||
Updated•14 days ago
|
| Assignee | ||
Comment 2•14 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=122411
| Assignee | ||
Comment 3•14 days ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 5 tests and 1 subtests
Status Summary
Firefox
OK : 2
FAIL : 4
TIMEOUT: 6
NOTRUN : 2
Chrome
OK : 5
PASS : 3
FAIL : 6
Safari
OK : 2
FAIL : 4
TIMEOUT: 6
NOTRUN : 2
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /html/dom/partial-updates/tentative/fragment/sanitize-default.html [wpt.fyi]:
TIMEOUT(Chrome:OK, Safari:TIMEOUT)- Template with src applies default safe sanitization unless sanitize="unsafe" is specified:
TIMEOUT(Chrome:FAIL, Safari:TIMEOUT)
- Template with src applies default safe sanitization unless sanitize="unsafe" is specified:
- /html/dom/partial-updates/tentative/fragment/sanitize-nested.html [wpt.fyi]
- template src with sanitize="unsafe" inside streamHTML inherits the safe sanitizer:
FAIL(Chrome:FAIL, Safari:FAIL) - Default template src inside streamHTMLUnsafe with bespoke sanitizer clones sanitizer and calls removeUnsafe():
FAIL(Chrome:FAIL, Safari:FAIL) - Nested template src with sanitize="unsafe" inside a safe outer template src remains sanitized:
FAIL(Chrome:FAIL, Safari:FAIL)
- template src with sanitize="unsafe" inside streamHTML inherits the safe sanitizer:
- /html/dom/partial-updates/tentative/fragment/sanitize-regular.html [wpt.fyi]
- The sanitize attribute only applies when src is present:
FAIL(Chrome:FAIL, Safari:FAIL)
- The sanitize attribute only applies when src is present:
- /html/dom/partial-updates/tentative/fragment/sanitize-unsafe.html [wpt.fyi]:
TIMEOUT(Chrome:OK, Safari:TIMEOUT)- Template with src and sanitize="unsafe" inherits unsafe parser context and allows scripts:
TIMEOUT(Chrome:PASS, Safari:TIMEOUT) - template src with sanitize="unsafe" inside streamHTMLUnsafe() keeps but does not run scripts:
NOTRUN(Chrome:FAIL, Safari:NOTRUN) - template src with sanitize="unsafe" inside streamHTMLUnsafe({runScripts: true}) runs scripts:
NOTRUN(Chrome:PASS, Safari:NOTRUN)
- Template with src and sanitize="unsafe" inherits unsafe parser context and allows scripts:
- /html/dom/partial-updates/tentative/fragment/src-parser-blocking.html [wpt.fyi]:
TIMEOUT(Chrome:OK, Safari:TIMEOUT)- template src fetches and executes scripts asynchronously without blocking the parser:
TIMEOUT(Chrome:PASS, Safari:TIMEOUT)
- template src fetches and executes scripts asynchronously without blocking the parser:
Comment 5•11 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/ad4136914350
https://hg.mozilla.org/mozilla-central/rev/154e842a5125
Description
•