Implement Trusted Types support for Element/ShadowRoot's setHTMLUnsafe() and innerHTML
Categories
(Core :: DOM: Security, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox135 | --- | fixed |
People
(Reporter: fwang, Assigned: fwang)
References
Details
(Whiteboard: [domsecurity-backlog], [wptsync upstream])
Attachments
(3 files)
Spec:
https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#unsafe-html-parsing-methods
https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#the-innerhtml-property
Tests:
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/trusted-types/block-string-assignment-to-Element-setHTMLUnsafe.html
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/trusted-types/block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
Also including ShadowRoot's innerHTML in this bug, which is mentioned in the IDL I linked in comment 0. Element's innerHTML was handled in bug 1913339.
I seems block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html is the only ShadowRoot test but does not try and set innerHTML, so we will need a test for that.
https://searchfox.org/mozilla-central/search?q=shadow&path=testing%2Fweb-platform%2Ftests%2Ftrusted-types&case=false®exp=false
https://searchfox.org/mozilla-central/search?q=innerHTML&path=testing%2Fweb-platform%2Ftests%2Ftrusted-types%2Fblock-string-assignment-to-ShadowRoot-setHTMLUnsafe.html&case=false®exp=false
| Assignee | ||
Comment 2•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
This is essentially a copy of
block-string-assignment-to-ShadowRoot-setHTMLUnsafe.html, replacing
set shadowRoot.setHTMLUnsafe(html) with shadowRoot.innerHTML = html.
Note that innerHTML uses LegacyNullToEmptyString, so setting it to
a null behaves slightly differently.
| Assignee | ||
Comment 4•1 year ago
|
||
Updated•1 year ago
|
| Assignee | ||
Comment 5•1 year ago
|
||
Comment 8•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/5c844b35a3e4
https://hg.mozilla.org/mozilla-central/rev/4b6f5fdc1a0d
https://hg.mozilla.org/mozilla-central/rev/82afe5dba541
Description
•