diff --git a/components/style/gecko/media_queries.rs b/components/style/gecko/media_queries.rs index e5ffccf11c1..08425f22059 100644 --- a/components/style/gecko/media_queries.rs +++ b/components/style/gecko/media_queries.rs @@ -9,6 +9,7 @@ use crate::gecko::values::{convert_nscolor_to_rgba, convert_rgba_to_nscolor}; use crate::gecko_bindings::bindings; use crate::gecko_bindings::structs; use crate::media_queries::MediaType; +use crate::context::QuirksMode; use crate::properties::ComputedValues; use crate::string_cache::Atom; use crate::values::computed::Length; @@ -143,6 +144,11 @@ impl Device { .store(size.px().to_bits(), Ordering::Relaxed) } + /// The quirks mode of the document. + pub fn quirks_mode(&self) -> QuirksMode { + self.document().mCompatMode.into() + } + /// Sets the body text color for the "inherit color from body" quirk. /// /// diff --git a/components/style/invalidation/stylesheets.rs b/components/style/invalidation/stylesheets.rs index b50e04b0f0b..8ac2b57b34e 100644 --- a/components/style/invalidation/stylesheets.rs +++ b/components/style/invalidation/stylesheets.rs @@ -140,7 +140,7 @@ impl StylesheetInvalidationSet { return; // Nothing to do here. } - let quirks_mode = stylesheet.quirks_mode(guard); + let quirks_mode = device.quirks_mode(); for rule in stylesheet.effective_rules(device, guard) { self.collect_invalidations_for_rule(rule, guard, device, quirks_mode); if self.fully_invalid { diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index 93f4b986052..fe743025419 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -450,7 +450,7 @@ macro_rules! sheet_set_methods { change_kind: RuleChangeKind, ) { if let Some(device) = device { - let quirks_mode = sheet.quirks_mode(guard); + let quirks_mode = device.quirks_mode(); self.invalidations.rule_changed( sheet, rule,