diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2016-11-28 16:33:47 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2016-11-28 16:50:38 +0100 |
commit | f1d49d3773846a65cb403af4e041660fad3117be (patch) | |
tree | ae2fde379903ccffe40c7629a4027e25c9a783d7 /components/script/dom/cssstylerule.rs | |
parent | 0714e2291cbb0ff888f817dd75414882e9309e8f (diff) | |
download | servo-f1d49d3773846a65cb403af4e041660fad3117be.tar.gz servo-f1d49d3773846a65cb403af4e041660fad3117be.zip |
Make CSSRule always keep a pointer to its parent stylesheet
even when the parentStylesheet IDL attribute returns null.
Diffstat (limited to 'components/script/dom/cssstylerule.rs')
-rw-r--r-- | components/script/dom/cssstylerule.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/cssstylerule.rs b/components/script/dom/cssstylerule.rs index 7d776655147..091704f42d5 100644 --- a/components/script/dom/cssstylerule.rs +++ b/components/script/dom/cssstylerule.rs @@ -22,17 +22,18 @@ pub struct CSSStyleRule { } impl CSSStyleRule { - fn new_inherited(parent: Option<&CSSStyleSheet>, stylerule: Arc<RwLock<StyleRule>>) -> CSSStyleRule { + fn new_inherited(parent_stylesheet: &CSSStyleSheet, stylerule: Arc<RwLock<StyleRule>>) + -> CSSStyleRule { CSSStyleRule { - cssrule: CSSRule::new_inherited(parent), + cssrule: CSSRule::new_inherited(parent_stylesheet), stylerule: stylerule, } } #[allow(unrooted_must_root)] - pub fn new(window: &Window, parent: Option<&CSSStyleSheet>, + pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet, stylerule: Arc<RwLock<StyleRule>>) -> Root<CSSStyleRule> { - reflect_dom_object(box CSSStyleRule::new_inherited(parent, stylerule), + reflect_dom_object(box CSSStyleRule::new_inherited(parent_stylesheet, stylerule), window, CSSStyleRuleBinding::Wrap) } |