W3C home > Mailing lists > Public > www-style@w3.org > July 2013

RE: CSS Engine Style Invalidation Strategy

From: François REMY <francois.remy.dev@outlook.com>
Date: Tue, 30 Jul 2013 20:14:48 +0200
Message-ID: <DUB120-W35BA051D7623A88680BF9EA5560@phx.gbl>
To: Boris Zbarsky <bzbarsky@mit.edu>
CC: "www-style@w3.org" <www-style@w3.org>
> On 7/30/13 9:43 AM, François REMY wrote:
>>> Also, inserting or removing a node can cause restyling of its parent or
>>> its preceding siblings, not just of following siblings.
>> Really, in which cases?
> :empty for the parent, :nth-last-child, and various other pseudoclasses
> containing "last" for the preceding siblings.

that's right but kinda unfrequent... 


I would not bother optimizing those cases further than: 

- using any of those selectors on an element set a special flag on the parent element {or the element itself in the case of :empty} 

- inserting/removing anything in the DOM as the direct child level triggers a rematch for all the children and their descendants on elements whose parent have this flag raised

- this flag could get reused if we want to support the subject selector in normal css to trigger complete rematch over a part of a tree known to be affected by any subject selector matching process.


That means I already used at least 3 of my 32 free flags, however: that was fast... 

That also means that when I insert/remove something, I have to bubble the ancestor chain; my previous setup didn't need that (but it didn't support :nth-last-... either).


Anyway, thanks for all the comments, those have been very helpful! 		 	   		  
Received on Tuesday, 30 July 2013 18:15:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC