RE: CSS Engine Style Invalidation Strategy

> 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