mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Propagate quirks mode all the way to ParserContext
The quirks mode is still not properly propagated in geckolib.
This commit is contained in:
parent
10fb8e61c7
commit
f68e2fded9
39 changed files with 225 additions and 100 deletions
|
@ -240,7 +240,7 @@ impl Stylist {
|
|||
};
|
||||
|
||||
self.viewport_constraints =
|
||||
ViewportConstraints::maybe_new(&self.device, &cascaded_rule);
|
||||
ViewportConstraints::maybe_new(&self.device, &cascaded_rule, self.quirks_mode);
|
||||
|
||||
if let Some(ref constraints) = self.viewport_constraints {
|
||||
Arc::get_mut(&mut self.device).unwrap()
|
||||
|
@ -418,7 +418,8 @@ impl Stylist {
|
|||
None,
|
||||
&RustLogReporter,
|
||||
font_metrics,
|
||||
cascade_flags);
|
||||
cascade_flags,
|
||||
self.quirks_mode);
|
||||
ComputedStyle::new(rule_node, Arc::new(computed))
|
||||
}
|
||||
|
||||
|
@ -536,7 +537,8 @@ impl Stylist {
|
|||
None,
|
||||
&RustLogReporter,
|
||||
font_metrics,
|
||||
CascadeFlags::empty());
|
||||
CascadeFlags::empty(),
|
||||
self.quirks_mode);
|
||||
|
||||
Some(ComputedStyle::new(rule_node, Arc::new(computed)))
|
||||
}
|
||||
|
@ -569,22 +571,22 @@ impl Stylist {
|
|||
};
|
||||
|
||||
self.viewport_constraints =
|
||||
ViewportConstraints::maybe_new(&device, &cascaded_rule);
|
||||
ViewportConstraints::maybe_new(&device, &cascaded_rule, self.quirks_mode);
|
||||
|
||||
if let Some(ref constraints) = self.viewport_constraints {
|
||||
device.account_for_viewport_rule(constraints);
|
||||
}
|
||||
|
||||
fn mq_eval_changed(guard: &SharedRwLockReadGuard, rules: &[CssRule],
|
||||
before: &Device, after: &Device) -> bool {
|
||||
before: &Device, after: &Device, quirks_mode: QuirksMode) -> bool {
|
||||
for rule in rules {
|
||||
let changed = rule.with_nested_rules_and_mq(guard, |rules, mq| {
|
||||
if let Some(mq) = mq {
|
||||
if mq.evaluate(before) != mq.evaluate(after) {
|
||||
if mq.evaluate(before, quirks_mode) != mq.evaluate(after, quirks_mode) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
mq_eval_changed(guard, rules, before, after)
|
||||
mq_eval_changed(guard, rules, before, after, quirks_mode)
|
||||
});
|
||||
if changed {
|
||||
return true
|
||||
|
@ -594,11 +596,11 @@ impl Stylist {
|
|||
}
|
||||
self.is_device_dirty |= stylesheets.iter().any(|stylesheet| {
|
||||
let mq = stylesheet.media.read_with(guard);
|
||||
if mq.evaluate(&self.device) != mq.evaluate(&device) {
|
||||
if mq.evaluate(&self.device, self.quirks_mode) != mq.evaluate(&device, self.quirks_mode) {
|
||||
return true
|
||||
}
|
||||
|
||||
mq_eval_changed(guard, &stylesheet.rules.read_with(guard).0, &self.device, &device)
|
||||
mq_eval_changed(guard, &stylesheet.rules.read_with(guard).0, &self.device, &device, self.quirks_mode)
|
||||
});
|
||||
|
||||
self.device = Arc::new(device);
|
||||
|
@ -866,7 +868,8 @@ impl Stylist {
|
|||
None,
|
||||
&RustLogReporter,
|
||||
&metrics,
|
||||
CascadeFlags::empty()))
|
||||
CascadeFlags::empty(),
|
||||
self.quirks_mode))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue