Re: [csswg-drafts] [css-contain] contain: style does not seem useful. (#3280)

My understanding was that the motivation was counters.


> In particular, the following optimization that the spec describes:
> 

> > Whenever a property is changed on a descendant of the containing element, calculating what part of the DOM tree is "dirtied" and might need to have its style recalculated can stop at the containing element.


> 
> Is just not true, since you need to compute the style of ancestors in order to inherit from them.
> 

The spec is not talking about computing the style of ancestors.

Assume the ancestor has `contain: style`. If a descendant is added or removed, or has a style change to introduce or remove a counter increment, you don't need to update counters in the ancestor's subsequent siblings (or any element outside the ancestor subtree).


-- 
GitHub Notification of comment by ewilligers
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3280#issuecomment-453366396 using your GitHub account

Received on Friday, 11 January 2019 03:32:49 UTC