Open Bug 1185419 Opened 9 years ago Updated 2 years ago

limit restyles for rules that only contain child combinators

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

Tracking Status
firefox42 --- affected

People

(Reporter: heycam, Unassigned)

Details

In bug 1180118 we're looking at selectively restyling descendants when you have rules like |div.x p| and you toggle the x class on the div, so that you only restyle descendant p elements.  For selectors that only have child '>' combinators, we should be able to tell the RestyleManager that we only need to restyle down to a particular depth.

For example with

  div.x > blockquote > p > span

if we toggle the x class on the div, we should be able to report a restyle hint which means "eRestyle_Self for all great-grandchildren", rather than the current eRestyle_Subtree, which would restyle all of the descendants of the span too.

If we resolve bug 1180118 then this bug would just limit the elements that we test the |span| selector against.
The approach that comes to mind would be to have a restyle hint say eRestyle_DescendantsAtLevel that is used in a conjunction with the number of levels down to start restyling.  It seems like it should be possible to track this number and count it down with every ElementRestyler we create, but the fact that we traverse the frame tree rather than the DOM might make this not completely straightforward.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.