W3C home > Mailing lists > Public > www-style@w3.org > October 2016

Re: [css3-selectors]: Proposal: Adop the ::wrap pseudo element

From: Ian Yang <ian.html@gmail.com>
Date: Wed, 19 Oct 2016 10:52:51 +0800
Message-ID: <CAFhBhuNnL9zMtYA1A2+3m8UAjPwT9SiypsdVAFLCNjmuDiuTpQ@mail.gmail.com>
To: Florian Rivoal <florian@rivoal.net>
Cc: CSS public list <www-style@w3.org>
2016-10-19 10:44 GMT+08:00 Florian Rivoal <florian@rivoal.net>:

>
> > On Oct 19, 2016, at 11:28, Ian Yang <ian.html@gmail.com> wrote:
> >
> > Thanks Florian Rivoal. Could you please let us know of which browser you
> are currently an implementor, and the technical reason that you regard
> ::wrap as hard to implement?
>
> Hi, I don't represent a browser, but I do speak for Vivliostyle, which is
> a non-browser CSS UA (focused on pagination and print).
>
> Other people are more qualified than me to speak about this, but here's a
> quick attempt at showing some of what makes this hard:
>
> * I plays poorly with how browser internals work currently. In vastly
> simplified terms, browsers work by starting with a DOM tree, compute styles
> on it to convert it into a box tree, then compute layout on that to convert
> into a display list. Pseudo elements are not in the DOM tree, but cause
> boxes to exist, and that's tricky to handle, especially when performance
> matters. It is already a non trivial issue for the existing pseudo elements
> like ::before and ::after, but the ::wrapper pseudo goes in the middle of
> the tree, not at the leaves, and that makes it harder.
>
> * ::first-line and ::first letter also go somewhere else than the leaves,
> and they're considered hard problems that don't work well. And even then,
> the set of properties that apply to them is limited.
>

I see. Thanks for your inputs.

* How would a ::wrapper pseudo affect inheritance and cascading? The fact
> that this needs answers shows that it causes new difficulties, and which
> answers are more desirable are non-obvious. if a child of the wrapper has a
> property set to "inherit" or an inherited property without a specified
> value, does it get its value from the ::wrapper, or form the ::wrapper's
> parent? If an ::wrapper is introduced between a parent and a child element,
> do the child still count as a child of the original parent for selector
> matching purpose, or is it now a grand child and ::wrapper is the parent?
> ...
>
>  - Florian


I would let W3C to define the spec if one day ::wrap is adopted. But I
personally think ::wrapper should become the new parent and the former
children becomes grand children.
Received on Wednesday, 19 October 2016 02:53:21 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:15:01 UTC