W3C home > Mailing lists > Public > www-style@w3.org > March 2013

Re: [CSS21][css3-selectors] :root in HTML always the HTML element?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 20 Mar 2013 07:29:31 -0700
Message-ID: <CAAWBYDDfPBZc7rFq6H2FaxX_fmBOQkz78C3KLrn044m_kcUF1A@mail.gmail.com>
To: Øyvind Stenhaug <oyvinds@opera.com>
Cc: "www-style@w3.org" <www-style@w3.org>
On Wed, Mar 20, 2013 at 7:01 AM, Øyvind Stenhaug <oyvinds@opera.com> wrote:
> The Selectors spec talks about the "document tree", e.g. "The elements of a
> document tree that are represented by a selector are the subjects of the
> selector." [1]
>
> The definition of this term in CSS 2.1 [2] states that it is a "tree of
> elements" and that "[e]ach element in this tree has exactly one parent, with
> the exception of the root element, which has none."
>
> But for the root pseudo-class [3] it is said "The :root pseudo-class
> represents an element that is the root of the document. In HTML 4, this is
> always the HTML element."
>
> There seems to be an inconsistency here if one considers HTML document
> fragments and HTML elements that are not in a document. I'm assuming that
> such trees are still "document trees" in the CSS sense even though they
> aren't rooted at a Document node in the DOM, since there is still a "tree of
> elements".
>
> In such cases, it seems CSS2 implies that the top-most element (DOM-wise,
> having a DocumentFragment parentNode or a null parentNode) is the "root
> element" in CSS terms, yet it isn't necessarily "the HTML element", which
> css3-selectors claims to be the case.
>
> (See also [4] and thread starting at [5])
>
> [1] http://www.w3.org/TR/css3-selectors/#selector-syntax
> [2] http://www.w3.org/TR/CSS21/conform.html#doctree
> [3] http://www.w3.org/TR/css3-selectors/#root-pseudo
> [4] http://lists.w3.org/Archives/Public/www-style/2007Jun/0116.html
> [5] http://lists.w3.org/Archives/Public/www-style/2013Mar/0290.html

I can't completely tell what you're asking for.  Do you want the
definition of :root revised to avoid implying that the root is
*always* <html> in HTML, or something else?

~TJ
Received on Wednesday, 20 March 2013 14:30:18 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT