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

> On Oct 19, 2016, at 11:52, Ian Yang <ian.html@gmail.com> wrote:
> 
> * 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? ...
> 
> 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.

That's the problem though. You are right, this is the more useful answer. But this is also unlike everything else in CSS. Selector matching is not influenced by styling at the moment. This would mean that we would have to change that.

I don't know whether that makes it impossible or not, but at the very least it breaks all sorts of assumptions in current browsers, making it a hard problem.

 - Florian

Received on Wednesday, 19 October 2016 02:56:46 UTC