style: Avoid cloning all over the error reporter.

This commit is contained in:
Emilio Cobos Álvarez 2017-03-14 00:12:38 +01:00
parent eaf27ccfa0
commit b4de69e3eb
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
36 changed files with 186 additions and 154 deletions

View file

@ -56,8 +56,10 @@ impl CSSSupportsRule {
let mut input = Parser::new(&text);
let cond = SupportsCondition::parse(&mut input);
if let Ok(cond) = cond {
let url = self.global().as_window().Document().url();
let context = ParserContext::new_for_cssom(&url);
let global = self.global();
let win = global.as_window();
let url = win.Document().url();
let context = ParserContext::new_for_cssom(&url, win.css_error_reporter());
let enabled = cond.eval(&context);
let mut rule = self.supportsrule.write();
rule.condition = cond;