Re: Extending Class Proposal

On Thu, Jan 31, 2013 at 1:10 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Thu, Jan 31, 2013 at 12:28 PM, Philip Walton <philip@philipwalton.com>
> wrote:
> > I agree with you that in CSS, whenever a selector appears that you've
> > extended, you need to simply pretend those extended selectors are there
> as
> > well. This make sense because you're being declarative and building
> styles.
> >
> > I dont think it works as well in JavaScript because the function is
> actually
> > returning a list of DOM nodes. It's not backwards compatible. If tomorrow
> > Chrome suddenly started including extended elements in the set of
> returned
> > nodes, you'd break a lot of websites. That's why I think a new simple
> > selector would work best.
>
> No, we wouldn't break anyone, *because you can't extend anything yet*.
>

I wasn't accusing you or Chrome of breaking anything, I was simply pointing
out why the current Sass syntax, which you were promoting in a previous
email, wouldn't lend itself well to a querySelectorAll function.

We'll only have a compat problem if we add the ability to extend
> selectors, but don't cover the querySelector case, and it doesn't get
> properly updated in tandem.


Yes, obviously. I was offering a suggestion as to how to cover the
querySelector case. If you didn't like the suggestion or had other ideas
for how to address the issue, I'd love to hear them.

Received on Friday, 1 February 2013 06:21:12 UTC