-
Notifications
You must be signed in to change notification settings - Fork 22.9k
DocParser.parseFromString() - update for trusted types #41490
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
DocParser.parseFromString() - update for trusted types #41490
Conversation
Preview URLs External URLs (1)URL:
(comment last updated: 2025-10-13 23:42:36) |
> The browser may actually return an {{domxref("HTMLDocument")}} or {{domxref("XMLDocument")}} object. | ||
> These derive from {{domxref("Document")}} and add no attributes: they are essentially equivalent. |
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.
FYI it will return one of these object on all the major browsers. So all the browsers are not spec compliant, but it doesn't matter since they don't add any methods. They aren't a useful abstraction for end users, who should just check the contentType property for any useful information.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
@sideshowbarker Thanks for the review - all suggestions accepted. It looks like I was pretty sloppy sorry. |
This updates the TrustedType documentation for
DocParser.parseFromString()
so that it includes boilerplate and security considerations.Quite a lot of additional info too.
Project tracking in #37518