mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Make CSSRule always keep a pointer to its parent stylesheet
even when the parentStylesheet IDL attribute returns null.
This commit is contained in:
parent
0714e2291c
commit
f1d49d3773
11 changed files with 84 additions and 69 deletions
|
@ -22,17 +22,18 @@ pub struct CSSFontFaceRule {
|
|||
}
|
||||
|
||||
impl CSSFontFaceRule {
|
||||
fn new_inherited(parent: Option<&CSSStyleSheet>, fontfacerule: Arc<RwLock<FontFaceRule>>) -> CSSFontFaceRule {
|
||||
fn new_inherited(parent_stylesheet: &CSSStyleSheet, fontfacerule: Arc<RwLock<FontFaceRule>>)
|
||||
-> CSSFontFaceRule {
|
||||
CSSFontFaceRule {
|
||||
cssrule: CSSRule::new_inherited(parent),
|
||||
cssrule: CSSRule::new_inherited(parent_stylesheet),
|
||||
fontfacerule: fontfacerule,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent: Option<&CSSStyleSheet>,
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
fontfacerule: Arc<RwLock<FontFaceRule>>) -> Root<CSSFontFaceRule> {
|
||||
reflect_dom_object(box CSSFontFaceRule::new_inherited(parent, fontfacerule),
|
||||
reflect_dom_object(box CSSFontFaceRule::new_inherited(parent_stylesheet, fontfacerule),
|
||||
window,
|
||||
CSSFontFaceRuleBinding::Wrap)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue