mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Fix Servo build.
This commit is contained in:
parent
b66e828842
commit
856886c40d
3 changed files with 30 additions and 20 deletions
|
@ -53,21 +53,21 @@ impl CSS {
|
|||
pub fn Supports_(win: &Window, condition: DOMString) -> bool {
|
||||
let mut input = ParserInput::new(&condition);
|
||||
let mut input = Parser::new(&mut input);
|
||||
let cond = parse_condition_or_declaration(&mut input);
|
||||
if let Ok(cond) = cond {
|
||||
let url = win.Document().url();
|
||||
let context = ParserContext::new_for_cssom(
|
||||
&url,
|
||||
Some(CssRuleType::Style),
|
||||
ParsingMode::DEFAULT,
|
||||
QuirksMode::NoQuirks,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
cond.eval(&context)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
let cond = match parse_condition_or_declaration(&mut input) {
|
||||
Ok(c) => c,
|
||||
Err(..) => return false,
|
||||
};
|
||||
|
||||
let url = win.Document().url();
|
||||
let context = ParserContext::new_for_cssom(
|
||||
&url,
|
||||
Some(CssRuleType::Style),
|
||||
ParsingMode::DEFAULT,
|
||||
QuirksMode::NoQuirks,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
cond.eval(&context, &Default::default())
|
||||
}
|
||||
|
||||
/// <https://drafts.css-houdini.org/css-paint-api-1/#paint-worklet>
|
||||
|
|
|
@ -81,7 +81,17 @@ impl CSSSupportsRule {
|
|||
None,
|
||||
None,
|
||||
);
|
||||
let enabled = cond.eval(&context);
|
||||
let enabled = {
|
||||
let namespaces =
|
||||
self
|
||||
.cssconditionrule
|
||||
.parent_stylesheet()
|
||||
.style_stylesheet()
|
||||
.contents
|
||||
.namespaces
|
||||
.read();
|
||||
cond.eval(&context, &namespaces)
|
||||
};
|
||||
let mut guard = self.cssconditionrule.shared_lock().write();
|
||||
let rule = self.supportsrule.write_with(&mut guard);
|
||||
rule.condition = cond;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue