W3C home > Mailing lists > Public > www-style@w3.org > February 2015

Re: [selectors] Previous-sibling combinator?

From: L. David Baron <dbaron@dbaron.org>
Date: Thu, 12 Feb 2015 10:43:45 +1100
To: Benjamin Poulain <benjamin@webkit.org>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Liam R E Quin <liam@w3.org>, Marat Tanalin <mtanalin@yandex.ru>, Clive Chan <doobahead@gmail.com>, Brad Kemper <brad.kemper@gmail.com>, Henrik Andersson <henke@henke37.cjb.net>, www-style list <www-style@w3.org>
Message-ID: <20150211234345.GA13308@pescadero.dbaron.org>
On Wednesday 2015-02-11 15:05 -0800, Benjamin Poulain wrote:
> On 2/11/15 2:57 PM, Tab Atkins Jr. wrote:
> >On Thu, Feb 12, 2015 at 9:52 AM, Benjamin Poulain <benjamin@webkit.org> wrote:
> >>On 2/11/15 2:47 PM, Tab Atkins Jr. wrote:
> >>>The problem with "giving people enough rope to hang themselves" is
> >>>when the mere existence of the feature slows down or complexifies the
> >>>engine as a whole, regardless of whether it's used.
> >>
> >>Can you explain this? Why is that the case?
> >
> >Because being able to handle style invalidations from arbitrarily high
> >up in the tree prevents simplifications that assume that can't happen;
> >at minimum, it probably adds branches in the code which can have
> >measurable perf effects.
> 
> There is nothing special about this case. Such invalidation already happen
> for :valid/:invalid and soon for :focus-within.

Those pseudo-classes can be managed separately from general selector
matching -- for example, :valid and :invalid are tracked by code
managing form validity, which knows about mappings between controls
and forms, and can make the form :valid or :invalid based on those
mappings, rather than having to do general selector matching.
:focus-within can be done the same way.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Received on Wednesday, 11 February 2015 23:44:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC