W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2017

[csswg-drafts] [css-display] Clarify element tree definition

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 12 Sep 2017 21:02:28 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-257181578-1505250139-sysbot+gh@w3.org>
Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-display] Clarify element tree definition ==
[CSS Display](https://drafts.csswg.org/css-display-3/#intro) says

> CSS takes a source document, organized as a tree of elements and text nodes, and renders it onto a canvas

This is confusing because the source document is organized as a [DOM tree](https://dom.spec.whatwg.org/#trees) of [DOM nodes](https://dom.spec.whatwg.org/#concept-node). Not just elements and text nodes.

As far as I know, the CSS element tree is derived from the DOM tree as follows:

 - The root is the document element.
 - All non-element and non-text nodes are removed.
 - A `::before` pseudo-element is inserted as the first child of each element node.
 - An `::after` pseudo-element is inserted as the last child of each element node.
 - A `::marker` pseudo-element is inserted at some places (to be exactly determined in #1793).

All of this should be properly defined in the spec.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1810 using your GitHub account
Received on Tuesday, 12 September 2017 21:02:22 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:17 UTC