Skip to content

Conversation

@Josh-Cena
Copy link
Member

@Josh-Cena Josh-Cena commented Sep 9, 2025

Listening to DOMContentLoaded or load for manipulating DOM is mostly an unnecessary practice. Usually, one can safely modify DOM simply by placing the script at the end of the file. It does avoid blocking render, but async does that job as well. However, the most common context for using this trick is for placing the script in <head>, which is a bad practice to begin with (since if you want to defer execution anyway you might as well defer parsing). It's definitely useless in our live sample / interactive example system, and most examples don't do this anyway, so for consistency I'm removing the rest.

(Tip: review this PR with hide whitespace.)

@Josh-Cena Josh-Cena requested review from a team as code owners September 9, 2025 18:04
@Josh-Cena Josh-Cena requested review from estelle and wbamberg and removed request for a team September 9, 2025 18:04
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs Content:JS JavaScript docs Content:Learn Learning area docs Content:Accessibility Accessibility docs Content:Media Media docs labels Sep 9, 2025
@Josh-Cena Josh-Cena requested review from a team, bsmth and estelle and removed request for a team, estelle and wbamberg September 9, 2025 18:04
@github-actions github-actions bot added the size/xl [PR only] >1000 LoC changed label Sep 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

Preview URLs (73 pages)
Flaws (9)

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

URL: /en-US/docs/Web/CSS/offset
Title: offset
Flaw count: 4

  • broken_links:
    • /en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context is a redirect
    • Can't resolve /en-US/docs/Web/CSS/url-modifier
    • Can't resolve /en-US/docs/Web/CSS/url-token
    • Can't resolve /en-US/docs/Web/CSS/url-modifier

URL: /en-US/docs/Web/CSS/offset-path
Title: offset-path
Flaw count: 4

  • broken_links:
    • /en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context is a redirect
    • Can't resolve /en-US/docs/Web/CSS/url-modifier
    • Can't resolve /en-US/docs/Web/CSS/url-token
    • Can't resolve /en-US/docs/Web/CSS/url-modifier

URL: /en-US/docs/Web/HTML/Reference/Elements/input/color
Title: <input type="color">
Flaw count: 1

  • unknown:
    • must be provided

(comment last updated: 2025-09-11 16:42:52)

Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

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

Great cleanup, thank you 👍🏻

@Josh-Cena Josh-Cena merged commit 1165772 into mdn:main Sep 11, 2025
8 checks passed
wbamberg added a commit to wbamberg/content that referenced this pull request Sep 15, 2025
* upstream/main: (32 commits)
  FF143 GPU import external texture experimental relnote (mdn#41126)
  added ff release note for nested pseudo-elements (mdn#41146)
  Add a page for SSRF attacks (mdn#41105)
  New CSSOM view API landing page, move CSS guides under (mdn#40547)
  40778 color input value (mdn#41086)
  Synchronize with BCD v7.1.5 (mdn#41116)
  Cross-reference `:target` and `::target-text` pages (mdn#41121)
  Fix content issues (mdn#41125)
  Make all JSON code syntactically valid (mdn#41120)
  Fix the link name with actual heading (mdn#41117)
  Associated listed form controls (mdn#41096)
  Mention `new Set()` accepts `undefined` (mdn#41106)
  chore: correct the `timeRange` function name (mdn#41107)
  Mention that custom elements constructors can't be directly called (mdn#41069)
  chore(deps): bump @mdn/fred from 1.3.2 to 1.4.0 (mdn#41111)
  Public-key cryptography glossary page: add headings and links (mdn#41092)
  Improve caret color demo contrast (mdn#41104)
  Fix supported algorithms for HKDF and PBKDF2 (mdn#41100)
  Update MongoDB example to async/await (driver v5+) (mdn#41102)
  Remove onload and DOMContentLoaded handlers (mdn#41079)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Accessibility Accessibility docs Content:CSS Cascading Style Sheets docs Content:HTML Hypertext Markup Language docs Content:JS JavaScript docs Content:Learn Learning area docs Content:Media Media docs Content:WebAPI Web API docs size/xl [PR only] >1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants