limit restyles for rules that only contain child combinators

RESOLVED INACTIVE

Status

()

Core
CSS Parsing and Computation
RESOLVED INACTIVE
3 years ago
3 days ago

People

(Reporter: heycam, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox42 affected)

Details

(Reporter)

Description

3 years ago
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.
(Reporter)

Comment 1

3 years ago
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.

Comment 2

3 days ago
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 3 days ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.