aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-07-07 20:29:43 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-07-08 18:05:31 +0200
commitc2cc6b08f8306d6f621bf32168edf55e9d071d9f (patch)
treed1f26778ed8b1a811b066a0a1ef78c60741e22e2
parent5d03ba3cbe6ea99deb6170cd607dccbad141ce1a (diff)
downloadservo-c2cc6b08f8306d6f621bf32168edf55e9d071d9f.tar.gz
servo-c2cc6b08f8306d6f621bf32168edf55e9d071d9f.zip
style: Avoid overriding the root font size from a getDefaultComputedStyle call.
MozReview-Commit-ID: 2WFyGj868fJ
-rw-r--r--components/style/matching.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/style/matching.rs b/components/style/matching.rs
index d59e5517b3d..5629a0e8b97 100644
--- a/components/style/matching.rs
+++ b/components/style/matching.rs
@@ -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();