Skip to content

Conversation

hamishwillee
Copy link
Collaborator

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

@hamishwillee hamishwillee requested a review from a team as a code owner October 13, 2025 06:38
@hamishwillee hamishwillee requested review from sideshowbarker and removed request for a team October 13, 2025 06:38
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Oct 13, 2025
Copy link
Contributor

github-actions bot commented Oct 13, 2025

Preview URLs

External URLs (1)

URL: /en-US/docs/Web/API/DOMParser/parseFromString
Title: DOMParser: parseFromString() method

(comment last updated: 2025-10-13 23:42:36)

Comment on lines +51 to +52
> 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.
Copy link
Collaborator Author

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.

hamishwillee and others added 3 commits October 13, 2025 17:49
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>
hamishwillee and others added 4 commits October 14, 2025 10:35
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>
hamishwillee and others added 4 commits October 14, 2025 10:36
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
Co-authored-by: sideshowbarker <mike@w3.org>
@hamishwillee
Copy link
Collaborator Author

@sideshowbarker Thanks for the review - all suggestions accepted. It looks like I was pretty sloppy sorry.

@hamishwillee hamishwillee merged commit 2c538b4 into mdn:main Oct 13, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

2 participants