style: Use document quirks mode rather than sheet quirks mode for stylesheet invalidation.

In order to determine whether classes or ids are case insensitive we
need the document quirks mode. The sheet quirks mode almost always
matches, but may not match when sheets are added by privileged APIs.

Differential Revision: https://phabricator.services.mozilla.com/D95061
This commit is contained in:
Emilio Cobos Álvarez 2020-10-30 19:47:19 +00:00
parent e2545ee95d
commit 20d2a06967
3 changed files with 8 additions and 2 deletions

View file

@ -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.
///
/// <https://quirks.spec.whatwg.org/#the-tables-inherit-color-from-body-quirk>