Implement remaining Trusted Type support for attribute changes
Categories
(Core :: DOM: Security, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox137 | --- | fixed |
People
(Reporter: fredw, Assigned: fredw)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [domsecurity-active], [wptsync upstream])
Attachments
(2 files)
https://github.com/whatwg/dom/pull/1268 mentions "attribute's change, append, and replace"
setAttribute/setAttributeNS was implemented in bug 1925468. However, there are other ways to set attributes that would require similar TT checks too.
Looking at currently failing tests:
- block-string-assignment-to-attribute-via-attribute-node.html: They set the attribute's node value via
textContent
/nodeValue
. - block-string-assignment-to-Element-setAttribute.html: The remaining failure is a test relying on
setAttributeNode()
. - Element-setAttribute-respects-Elements-node-documents-globals-CSP-after-adoption-from-non-TT-realm.html: The assertion failures are for
setAttributeNode()
.
Assignee | ||
Comment 1•24 days ago
|
||
testing/web-platform/tests/trusted-types/TrustedType-AttributeNodes.html is a test also checks attributenode.value and NamedNodeMap.setNamedItem but it is already passing.
Assignee | ||
Updated•24 days ago
|
Assignee | ||
Comment 2•24 days ago
|
||
List provided by Luke:
- setAttribute
- setAttributeNS
- Element.setAttributeNode
- Element.setAttributeNodeNS
- NamedNodeMap.setNamedItem
- NamedNodeMap.setNamedItemNS
- Attr.value
- Node.textContent
- Node.nodeValue
Assignee | ||
Comment 3•23 days ago
|
||
Assignee | ||
Comment 4•23 days ago
|
||
Checking the code, nsDOMAttributeMap::SetNamedItemNS and Attr::SetValue should be enough to cover the list in comment 2. However, test coverage is not great for now: https://github.com/whatwg/dom/pull/1268#issuecomment-2621271212
Assignee | ||
Comment 5•22 days ago
|
||
Updated•22 days ago
|
Updated•22 days ago
|
Updated•19 days ago
|
Updated•19 days ago
|
Updated•18 days ago
|
Updated•11 days ago
|
Updated•11 days ago
|
Updated•11 days ago
|
Updated•11 days ago
|
Updated•11 days ago
|
Updated•11 days ago
|
Updated•10 days ago
|
Updated•10 days ago
|
Updated•10 days ago
|
Updated•10 days ago
|
Updated•9 days ago
|
Updated•9 days ago
|
Updated•8 days ago
|
https://hg.mozilla.org/mozilla-central/rev/752e5c2d3d68
https://hg.mozilla.org/mozilla-central/rev/90a78c6d0ec0
Description
•