Closed Bug 1191600 Opened 9 years ago Closed 6 years ago

stop restyling immediately if the root of a restyle gets the same style context

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox42 --- affected

People

(Reporter: heycam, Assigned: heycam)

References

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

If we start a restyle, and the first frame we restyle gets the same style context back, we should return eRestyle_Stop, even if the various other conditions that would prevent us from returning eRestyle_Stop in the middle of a restyle (such as the style context having a pseudo or being shared) are true.
Attached patch patch (obsolete) — Splinter Review
Attachment #8644057 - Flags: review?(dbaron)
What if (aRestyleHint & (eRestyle_Subtree | eRestyle_Force | eRestyle_ForceDescendants))?

(And I guess this mIsRoot is now mIsRootOfRestyle.)

Does it make sense to check canStopWithStyleChange for that, or does it make sense to recheck some of the conditions that led to it being false instead?
Flags: needinfo?(cam)
(In reply to David Baron [:dbaron] ⏰UTC-7 from comment #2)
> What if (aRestyleHint & (eRestyle_Subtree | eRestyle_Force |
> eRestyle_ForceDescendants))?

That's a very good point.

> Does it make sense to check canStopWithStyleChange for that, or does it make
> sense to recheck some of the conditions that led to it being false instead?

canStopWithStyleChange may also have been set to false for reasons other than aRestyleHint having those bits, so I think we need to just re-check aRestyleHint.
Flags: needinfo?(cam)
Attachment #8644057 - Attachment is obsolete: true
Attachment #8644057 - Flags: review?(dbaron)
Attached patch patch v2Splinter Review
Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #8655794 - Flags: review?(dbaron)
Attachment #8655794 - Attachment description: a.patch → patch v2
(In reply to Cameron McCormack (:heycam) from comment #3)
> (In reply to David Baron [:dbaron] ⏰UTC-7 from comment #2)
> > What if (aRestyleHint & (eRestyle_Subtree | eRestyle_Force |
> > eRestyle_ForceDescendants))?
> 
> That's a very good point.

Did this problem cause test failures?  (Did you run this patch through try?)

If not -- that seems disturbing -- either a sign of very poor test coverage, or perhaps more likely a sign that the patch isn't actually accomplishing what it's supposed to do.
Flags: needinfo?(cam)
Comment on attachment 8655794 [details] [diff] [review]
patch v2

I think you should also condition this on aSelf->GetAdditionalStyleContext(0) being non-null (like the first check in ComputeRestyleResultFromFrame).

r=dbaron with that (though see needinfo in previous comment)
Attachment #8655794 - Flags: review?(dbaron) → review+
Closing this since the old style system is gone.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(cam)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: