style: Avoid overriding the root font size from a getDefaultComputedStyle call.

MozReview-Commit-ID: 2WFyGj868fJ
This commit is contained in:
Emilio Cobos Álvarez 2017-07-07 20:29:43 +02:00
parent 5d03ba3cbe
commit c2cc6b08f8
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -553,9 +553,12 @@ trait PrivateMatchMethods: TElement {
None);
// Handle root font-size changes.
if self.is_root() && !self.is_native_anonymous() {
// The new root font-size has already been updated on the Device
// in properties::apply_declarations.
//
// TODO(emilio): This should arguably be outside of the path for
// getComputedStyle/getDefaultComputedStyle, but it's unclear how to
// do it without duplicating a bunch of code.
if self.is_root() && !self.is_native_anonymous() &&
!context.shared.traversal_flags.for_default_styles() {
let device = context.shared.stylist.device();
let new_font_size = new_values.get_font().clone_font_size();