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-cascade] "document order" is undefined #8551

Open
cvrebert opened this issue Mar 9, 2023 · 2 comments
Open

[css-cascade] "document order" is undefined #8551

cvrebert opened this issue Mar 9, 2023 · 2 comments

Comments

@cvrebert
Copy link
Member

cvrebert commented Mar 9, 2023

Quoting from this section (emphasis added):

Order of Appearance
The last declaration in document order wins. For this purpose:

  • [...]
  • Declarations from style attributes are ordered according to the document order of the element the style attribute appears on, and are all placed after any style sheets. [CSSSTYLEATTR]

Presumably "document order" refers to https://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order and should be hyperlinked thereto.
However, that spec is obsolete nowadays. I think y'all want "tree order" instead.

E.g. https://drafts.csswg.org/cssom/#css-style-sheet-collections already refers (with an extra level of unconditional indirection thru WHATWG HTML, for some reason) to WHATWG DOM's "tree order":

[...] Any CSS style sheets associated with the DocumentOrShadowRoot, in tree order

A grep of the CSS2 spec plaintext turned up references to "document order", but apparently it likewise neither defines the term nor references another spec for it.

@Loirooriol
Copy link
Contributor

It's defined in https://drafts.csswg.org/css-display-3/#document-order

The order in which boxes or content occurs in the document (which can be different from the order in which it appears for rendering). For the purpose of determining the relative order of pseudo-elements, the box-tree order is used, see CSS Pseudo-Elements 4 § 4 Tree-Abiding Pseudo-elements.

@fantasai
Copy link
Collaborator

fantasai commented Jun 1, 2023

Probably should be cross-linking to that definition, but also it doesn't cover what document order means for style sheets, so we either need to define that or create a new term for style sheet order (“source order” if we want to be generic?).

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

3 participants