Implement Trusted Types support for Element/ShadowRoot's setHTMLUnsafe() and innerHTML
Categories
(Core :: DOM: Security, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox135 | --- | fixed |
People
(Reporter: fredw, Assigned: fredw)
References
(Blocks 1 open bug)
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•3 months ago
|
Assignee | ||
Comment 1•3 months 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•3 months ago
|
||
Updated•3 months ago
|
Assignee | ||
Comment 3•3 months 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•3 months ago
|
||
Updated•3 months ago
|
Assignee | ||
Comment 5•3 months ago
|
||
Comment 8•3 months 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
•