Closed Bug 1348746 Opened 7 years ago Closed 7 years ago

stylo: don't eagerly style new children from bindings if the pres shell hasn't been initialized yet

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: heycam, Assigned: heycam)

References

Details

Attachments

(1 file)

One case where bug 1345695 shows that we incorrectly resolve style on an element when disallow lazy restyling is dom/html/crashtests/580507-1.xhtml.  The test (probably incorrectly) is an unstyled XML document (it's missing an xmlns="http://www.w3.org/1999/html" that would make it an XHTML document).  The pretty printing binding is loaded before the pres shell is initialized, but we still style the contents of the document due to the AutoStyleNewChildren that is on the stack when attaching the binding.

What's worse is that immediately after we attach the binding to the root element, we append some more content, but because the pres shell hasn't been initialized, PresShell::ContentAppended decides not to tell the RestyleManager.  This means we end up with an unstyled subtree under a styled element.

We should just skip eagerly styling the new content from the binding if we haven't initialized our PresShell yet.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=62161858567f0d6e37978f9a191ec5772eeaffd5
Comment on attachment 8849020 [details]
Bug 1348746 - stylo: Only eagerly style newly appended children from bindings when the pres shell has been initialized.

https://reviewboard.mozilla.org/r/121868/#review124120
Attachment #8849020 - Flags: review?(bobbyholley) → review+
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c5fe6750a883
stylo: Only eagerly style newly appended children from bindings when the pres shell has been initialized. r=bholley
https://hg.mozilla.org/mozilla-central/rev/c5fe6750a883
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Assignee: nobody → cam
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: