Skip to content

FF140 escaping < and > to &lt; and &gt; in attributes when serializing HTML #39639

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

Merged
merged 5 commits into from
May 26, 2025

Conversation

hamishwillee
Copy link
Collaborator

FF140 ships support for escaping < and > to &lt; and &gt; in attributes when serializing HTML in https://bugzilla.mozilla.org/show_bug.cgi?id=1962084. This affects all the obvious methods like innerHTML, outerHTML, getHTML etc.

This PR removes the info in the experimental features page (the addition to Relnote is in a separate PR).

I also added a note to the end of each of the affected methods pointing down to the browser compatibility for this feature. Note that the feature is non standard, but is expected to be standardized soon.

Related docs work can be tracked in #39628

@hamishwillee hamishwillee requested review from a team as code owners May 23, 2025 04:57
@hamishwillee hamishwillee requested review from wbamberg and pepelsbey and removed request for a team May 23, 2025 04:57
@github-actions github-actions bot added Content:WebAPI Web API docs Content:Firefox Content in the Mozilla/Firefox subtree labels May 23, 2025
instead.
To only obtain the HTML representation of the contents of an element, or to replace the contents of an element, use the {{domxref("Element.innerHTML", "innerHTML")}} property instead.

Note that some browsers serialize `<` and `>` in attributes as `&lt;` and `&gt;` when reading the HTML (see [Browser compatibility](#browser_compatibility)).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only actual change in this page.

@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label May 23, 2025
Copy link
Contributor

github-actions bot commented May 23, 2025

Preview URLs (6 pages)
Flaws (1)

Note! 5 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Mozilla/Firefox/Experimental_features
Title: Experimental features in Firefox
Flaw count: 1

  • broken_links:
    • Can't resolve /en-US/docs/Web/API/HTML_Sanitizer_API
External URLs (77)

URL: /en-US/docs/Mozilla/Firefox/Experimental_features
Title: Experimental features in Firefox


URL: /en-US/docs/Web/API/Element/getHTML
Title: Element: getHTML() method

(comment last updated: 2025-05-26 18:50:53)

The **`innerHTML`** property of the {{domxref("ShadowRoot")}}
interface sets or returns a reference to the DOM tree inside the
`ShadowRoot`.
The **`innerHTML`** property of the {{domxref("ShadowRoot")}} interface sets gets or sets the HTML markup to the DOM tree inside the `ShadowRoot`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text here seemed completely wrong - it isn't a reference. There is a lot more that can be said.

I don't want to say it in this PR because that would be out of scope for this task. I do expect to be back here though, as I am currently doing work on the HTLM sanitization API which tanjentially affects this. I will also be looking at it as I add docs on the injection sinks for TrustedTypes.

Co-authored-by: Hamish Willee <[email protected]>
Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you :)

pepelsbey and others added 2 commits May 26, 2025 20:48
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@pepelsbey pepelsbey merged commit 9ec0f8b into mdn:main May 26, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants