Skip to content
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

Clarification on document tree and DOM tree #1188

Closed
MrHBS opened this issue Apr 20, 2023 · 7 comments
Closed

Clarification on document tree and DOM tree #1188

MrHBS opened this issue Apr 20, 2023 · 7 comments

Comments

@MrHBS
Copy link

MrHBS commented Apr 20, 2023

The document tree and DOM tree are not the same thing, although they are related. The document tree refers to the hierarchical structure of an HTML or XML document. This structure is created by the author and is static. The DOM tree, on the other hand, is a representation of the document tree in memory, created by the browser when the document is loaded.

Is my understanding correct?

@annevk
Copy link
Member

annevk commented Apr 20, 2023

How does this question relate to the DOM Standard?

@MrHBS
Copy link
Author

MrHBS commented Apr 20, 2023

@annevk Both of these terms are mentioned in the dom spec and I am confused about them.

@annevk
Copy link
Member

annevk commented Apr 20, 2023

There are no hits for "DOM tree" as far as I can tell. What document are you reading?

@MrHBS
Copy link
Author

MrHBS commented Apr 20, 2023

Hmm you are right. It does not say a “tree”. I probably read it as a DOM tree somewhere else. Now I am even more confused. Thanks anyway

@MrHBS MrHBS closed this as completed Apr 20, 2023
@MrHBS
Copy link
Author

MrHBS commented Apr 20, 2023

Ah it is mentioned in the HTML spec

@annevk
Copy link
Member

annevk commented Apr 20, 2023

That might be worth cleaning up a bit. I recommend filing an issue against whatwg/html. It should say "node tree" instead.

@MrHBS
Copy link
Author

MrHBS commented Apr 20, 2023

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants