diff --git a/components/layout/display_list/background.rs b/components/layout/display_list/background.rs index 19976a3bf83..7da2bff68d6 100644 --- a/components/layout/display_list/background.rs +++ b/components/layout/display_list/background.rs @@ -553,12 +553,12 @@ pub fn convert_linear_gradient( let angle = match direction { LineDirection::Angle(angle) => angle.radians(), LineDirection::Horizontal(x) => match x { - X::Left => Angle::Deg(270.).radians(), - X::Right => Angle::Deg(90.).radians(), + X::Left => Angle::from_degrees(270.).radians(), + X::Right => Angle::from_degrees(90.).radians(), }, LineDirection::Vertical(y) => match y { - Y::Top => Angle::Deg(0.).radians(), - Y::Bottom => Angle::Deg(180.).radians(), + Y::Top => Angle::from_degrees(0.).radians(), + Y::Bottom => Angle::from_degrees(180.).radians(), }, LineDirection::Corner(horizontal, vertical) => { // This the angle for one of the diagonals of the box. Our angle diff --git a/components/script/dom/css.rs b/components/script/dom/css.rs index 7a42d6b6e68..0f3c929460e 100644 --- a/components/script/dom/css.rs +++ b/components/script/dom/css.rs @@ -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()) } /// diff --git a/components/script/dom/csssupportsrule.rs b/components/script/dom/csssupportsrule.rs index 136a742e0e7..030a6c56be9 100644 --- a/components/script/dom/csssupportsrule.rs +++ b/components/script/dom/csssupportsrule.rs @@ -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;