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

2016-10-19 10:52 GMT+08:00 Ian Yang <ian.html@gmail.com>:

> 2016-10-19 10:44 GMT+08:00 Florian Rivoal <florian@rivoal.net>:
>
>> * 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.
>

Although it's just a theory for now, I would like to correct my previous
opinion. I think ::wrap should not count as parent because it is just
"pseudo" element and not real element. Just like ::before, ::after, and
::first-line, which never count as target-able elements when it comes to
using CSS child selector (>) and universal selector (*), ::wrap shouldn't
either. Therefore the old parent should still count as the direct parent no
matter how many ::wrap are generated between it and its direct child
elements, and child selector (>) should still work for its direct child
elements.

Received on Wednesday, 19 October 2016 11:45:58 UTC