mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
e2545ee95d
commit
20d2a06967
3 changed files with 8 additions and 2 deletions
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue