-
Notifications
You must be signed in to change notification settings - Fork 9
Create "dynamic markup" explainer #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This document provides an overview of the revamped dynamic markup methods for HTML injection, detailing API design, script execution, sanitizer integration, and security considerations.
|
|
||
| ```webidl | ||
| interface TrustedTypePolicy { | ||
| TrustedHTMLParserOptions createHTMLParserOptions((SetHTMLOptions or SetHTMLUnsafeOptions) options = {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think WebIDL doesn't allow a union of SetHTMLOptions and SetHTMLUnsafeOptions because they cannot be distinguished. If we want the result to not require further checking when passed to setHTML(), maybe add a createHTMLParserOptionsUnsafe() here with a different return type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's necessary. The resulting object can be the same type, and the Safe variant can ignore runScripts and assert a safe baseline.
dynamic-markup-revamped-explainer.md
Outdated
|
|
||
| ## Existing methods | ||
|
|
||
| Apart from the `createContextualFragment` quirk, all of the existing APIs can be expressed in terms of the above APIs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about allowing declarative shadow roots? Should that be an opt-in in the new APIs to match the existing ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a section about this.
Co-authored-by: Philip Jägenstedt <[email protected]>
Co-authored-by: Philip Jägenstedt <[email protected]>
Co-authored-by: Philip Jägenstedt <[email protected]>
Add section on special template behavior and update existing methods description.
SHA: cf3b548 Reason: push, by noamr Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This document provides an overview of the revamped dynamic markup methods for HTML injection, detailing API design, script execution, sanitizer integration, and security considerations.