Closed Bug 1316247 Opened 8 years ago Closed 8 years ago

stylo: restyles generated during change hint processing should be handled in the same ProcessPendingRestyles call

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: heycam, Assigned: heycam)

References

Details

Attachments

(1 file)

Some change hint processing causes new restyles to be posted, e.g. when processing a ReconstructFrame on a given element, and it's decided that we need to recreate frames for the parent, we call PostRestyleEvent for the parent with another ReconstructFrame change hint.  If we don't do this, then we can end up with the frame tree being in a state that has not fully taken account of the restyles until the next refresh driver tick.

The Gecko RestyleTracker::DoProcessRestyles method loops processing restyles until the restyle table is empty.  We should make ServoRestyleManager::ProcessPendingRestyles do the same.
This case comes up in layout/reftests/table-anonymous-boxes/156888-1.html.
Attached patch patchSplinter Review
Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #8808949 - Flags: review?(ecoal95)
Attachment #8808949 - Attachment is patch: true
Comment on attachment 8808949 [details] [diff] [review]
patch

Review of attachment 8808949 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/ServoRestyleManager.cpp
@@ +362,4 @@
>    nsIDocument* doc = PresContext()->Document();
>    Element* root = doc->GetRootElement();
>    if (root) {
> +    while (!mModifiedElements.IsEmpty()) {

Probably worth a comment pointing out that frame construction can post restyles back.

Also, it seems to me that ideally that shouldn't happen, but oh well...
Attachment #8808949 - Flags: review?(ecoal95) → review+
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4c1cb8ecde7f
stylo: Handle restyles generated during change hint processing sooner. r=emilio
https://hg.mozilla.org/mozilla-central/rev/4c1cb8ecde7f
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: