Skip to content

Conversation

Josh-Cena
Copy link
Member

Follow up of #41381. In this PR, I introduced the fundamental APIs for DOM in the "Anatomy of the DOM" guide, which is important for further guides. In preparation of more rewrites, I'm generalizing the other two oddly specific DOM guide pages, and it should be apparent what I plan to add to them.

@Josh-Cena Josh-Cena requested review from a team as code owners October 16, 2025 21:26
@Josh-Cena Josh-Cena requested review from a team, dipikabh, estelle and sideshowbarker and removed request for a team and dipikabh October 16, 2025 21:26
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs labels Oct 16, 2025
@github-actions github-actions bot added the Content:Accessibility Accessibility docs label Oct 16, 2025
@Josh-Cena Josh-Cena removed the request for review from dipikabh October 16, 2025 21:26
@github-actions github-actions bot added the Content:Firefox Content in the Mozilla/Firefox subtree label Oct 16, 2025
@Josh-Cena Josh-Cena requested review from a team and bsmth October 16, 2025 21:26
@github-actions github-actions bot added the size/m [PR only] 51-500 LoC changed label Oct 16, 2025
Copy link
Contributor

github-actions bot commented Oct 16, 2025

Preview URLs (12 pages)
Flaws (3)

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

URL: /en-US/docs/Web/API/Document_Object_Model/Anatomy_of_the_DOM
Title: Anatomy of the DOM
Flaw count: 3

  • broken_links:
    • Can't resolve /en-US/docs/Web/API/Document_Object_Model/XML_namespaces
    • Can't resolve /en-US/docs/Web/API/Document_Object_Model/XML_namespaces
  • unknown:
    • Error parsing /shared-assets/images/diagrams/api/dom/tree-structure.svg: No such file or directory (os error 2)

(comment last updated: 2025-10-18 06:25:11)

- For `Attr`, the `name` (more accurately, the `namespaceURI`, `prefix`, and `localName`; we will introduce these in the [XML namespaces](/en-US/docs/Web/API/Document_Object_Model/XML_namespaces) guide) and `value` properties need to be compared.
- For all `CharacterData` nodes (`Text`, `CDATASection`, `Comment`, and `ProcessingInstruction`), the `data` property needs to be compared. For `ProcessingInstruction`, the `target` property also needs to be compared.

The `a.compareDocumentPosition(b)` method compares two nodes by tree order. It returns a bitmask indicating their relative positions. The possible cases are:
Copy link
Member

Choose a reason for hiding this comment

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

Do we have anywhere to link to from 'bitmask'? I don't find anything appropriate

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so; perhaps one day we should write a glossary

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! Couple of comments to consider, but looking good to go, IMO 👍🏻

Co-authored-by: Brian Smith <brian@smith.berlin>
@Josh-Cena
Copy link
Member Author

@bsmth If I send a PR to shared-assets, would you be able to run mmdc for me?

@Josh-Cena
Copy link
Member Author

Actually never mind, I can just export from the online playground!

@bsmth
Copy link
Member

bsmth commented Oct 20, 2025

Actually never mind, I can just export from the online playground!

Great, taking a look now

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.

Thanks a lot. Another +1 on the delta since last review, looking great 👍🏻

@Josh-Cena Josh-Cena merged commit 277a895 into mdn:main Oct 20, 2025
9 checks passed
@Josh-Cena Josh-Cena deleted the dom-anatomy branch October 20, 2025 13:20
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: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.

2 participants