Closed Bug 1367592 Opened 8 years ago Closed 8 years ago

stylo: Ensure we restyle the whole document when the root font-size changes.

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: emilio, Assigned: heycam)

References

Details

Attachments

(1 file)

Similar to 1367589, a font-size change on the document element should cause a whole document restyle if it uses rem units. I was thinking that some cascade optimizations may make us break this, but the fact that rem units may be used down the tree makes it unavoidable anyway. I don't recall seeing code for doing this off-hand. Heycam, is it handled elsewhere in Gecko? Assuming it's not, we'll need to fix this.
ni? heycam for the question above (sorry, I'd look into it myself, but I need to run right now)
Flags: needinfo?(cam)
In Gecko we handle root font-size changes here: http://searchfox.org/mozilla-central/rev/35b37316149108d53a02fb8498e250ea8a22ab5d/layout/base/GeckoRestyleManager.cpp#123-143 So we check if we're restyling the root element, and if so, convert the current restyle process into a "rebuild all style data" one. Effectively that will just add eRestyle_ForceDescendants to the restyle hint for the root, which will cause us to recascade the entire tree. I'm just starting to look into handling the cascading stuff in bug 1367647.
Depends on: 1367647
Flags: needinfo?(cam)
Servo has code here to update the root font size on the Device when we restyle the root element: http://searchfox.org/mozilla-central/rev/31eec6f59eb303adf3318058cb30bd6a883115a5/servo/components/style/properties/properties.mako.rs#2737-2740 but we still need something that adds the RECASCADE_DESCENDANTS flags to the restyle hint for children, when we detect the change.
We could use the CascadeInfo stuff for that, I guess.
Attachment #8874078 - Flags: review?(emilio+bugs) → review+
Attachment #8874078 - Flags: review?(cam) → review+
Status: NEW → RESOLVED
Closed: 8 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: