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

[css-display-3] Can't understanding element and text nodes #4663

Closed
Jiang-Xuan opened this issue Jan 10, 2020 · 5 comments
Closed

[css-display-3] Can't understanding element and text nodes #4663

Jiang-Xuan opened this issue Jan 10, 2020 · 5 comments

Comments

@Jiang-Xuan
Copy link

  • please link to the spec section you're talking about, or at least the spec

https://www.w3.org/TR/css-display-3/#intro

CSS takes a source document, organized as a tree of elements and text nodes, and renders it onto a canvas (such as your screen, a piece of paper, or an audio stream).

Element and text node are defined here, but there is no detailed explanation of what is element and text node. Can we give a detailed explanation here.

For example:

<div>
  Some text
  <div>Another some text</div>
</div>

Is Some text a text node here?

Thanks for all responses. 👋

@Loirooriol
Copy link
Contributor

The DOM spec defines DOM elements and DOM text nodes.

The element tree then contains elements (DOM elements + tree-abiding pseudo-elements) and text nodes (DOM text nodes).

So I think this will be clear once the spec defines how the element tree is created (#1810).

Is Some text a text node here?

It's a text node, but note it also includes the surrounding spaces and newlines.

@Jiang-Xuan
Copy link
Author

@Loirooriol Thanks for your response, very helpful. Hope the Working Group can give that spec as soon as possible.

Appreciation!

@tabatkins
Copy link
Member

Yes, it's referring to the same concepts as the DOM spec.

@Jiang-Xuan
Copy link
Author

@tabatkins I think it is possible to indicate the reference here.

@fantasai fantasai added the css-display-3 Current Work label Jan 16, 2020
@fantasai
Copy link
Collaborator

We could add DOM as an example, but fundamentally CSS does not require the DOM specifically. It just requires a tree of elements and text nodes, and if you want to use it on a different type of document tree it's fine.

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

No branches or pull requests

4 participants