Store raw string for prop decl in @supports

This commit is contained in:
Xidorn Quan 2017-07-21 11:03:29 +10:00
parent 4616f4ae77
commit adee1e403c
2 changed files with 26 additions and 31 deletions

View file

@ -30,7 +30,11 @@ impl CSS {
/// https://drafts.csswg.org/css-conditional/#dom-css-supports
pub fn Supports(win: &Window, property: DOMString, value: DOMString) -> bool {
let decl = Declaration { prop: property.into(), val: value.into() };
let mut decl = String::new();
serialize_identifier(&property, &mut decl).unwrap();
decl.push_str(": ");
decl.push_str(&value);
let decl = Declaration(decl);
let url = win.Document().url();
let context = ParserContext::new_for_cssom(&url, win.css_error_reporter(), Some(CssRuleType::Supports),
PARSING_MODE_DEFAULT,