Re: Proposal for adding @extend to CSS

On Sat, Jan 31, 2015 at 9:56 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 1/31/15 11:55 AM, Tab Atkins Jr. wrote:
>> No, I don't think this affects the way you have to do selector
>> matching.  You just let @extend mutate the data structures you use for
>> matching
>
> That data structure is the DOM.

Well, not strictly.  A lot of our selector optimizations rely on
separate data structures, like bloom filters sitting on nodes.

>  I'm not sure you seriously mean that
> @extend is supposed to mutate the DOM, so I'd like to understand what you
> actually mean here.

You're right, this definitely does not change the DOM.  The spec
states what I mean quite plainly - for the purpose of matching
selectors, the elements are treated as if they have the necessary
qualities to also match the @extend selector.

Depending on your implementation, this "affects the way you have to do
selector matching" to a greater or lesser extent.  The context of my
quoted text was in reference to François saying that this would
require switching to top-down selector matching, or some other radical
change.  It doesn't.

~TJ

Received on Wednesday, 4 February 2015 03:11:52 UTC