Use stylesheet’s base URL and ns prefixes in CSSOM insert/appendRule.

This commit is contained in:
Simon Sapin 2016-11-28 17:48:32 +01:00
parent f1d49d3773
commit 70b250fe2a
5 changed files with 24 additions and 20 deletions

View file

@ -84,10 +84,10 @@ impl CSSRuleList {
let global = self.global();
let window = global.as_window();
let doc = window.Document();
let index = idx as usize;
let new_rule = css_rules.insert_rule(rule, doc.url().clone(), index, nested)?;
let parent_stylesheet = self.parent_stylesheet.style_stylesheet();
let new_rule = css_rules.insert_rule(rule, parent_stylesheet, index, nested)?;
let parent_stylesheet = &*self.parent_stylesheet;
let dom_rule = CSSRule::new_specific(&window, parent_stylesheet, new_rule);