dom
dom copied to clipboard
Integration with trusted types inside of node conversion
- [ ] At least two implementers are interested (and none opposed):
- Chromium (already implemented)
- …
- [ ] Tests are written and can be reviewed and commented upon at:
- https://wpt.fyi/trusted-types already includes a number of tests for these changes.
- [ ] Implementation bugs are filed:
- Chromium: …
- Gecko: …
- WebKit: …
- [ ] MDN issue is filed: …
- [ ] The top of this comment includes a clear commit message to use.
(See WHATWG Working Mode: Changes for more details.)
Bolt on to #1247
@lukewarlow you mentioned somewhere you'd appreciate a review in order to simplify the change. Since it's not primarily about correctness, how helpful would an imminent review be?
@mbrodesser-Igalia that was for an editorial PR to trusted types (which has been merged) rather than this one, so nothing urgent here.
This looks complicated. Any reason we cannot convert to Text nodes first and then potentially throw for Text nodes if they pose some kind of danger in combination with a script element?
Ah yeah that's a good idea, can process text nodes and raw strings at the same time them and then can just handle the trusted script after the other processing (because it needs to hold onto the fact it's safe). I knew there was probably a nicer way.
@annevk is there anything left that's needed for this PR? Wanna make sure I'm not holding anything up.
LGTM @annevk thanks for your help getting this across the line.