Make parent stylesheet optional for CSSRules

This commit is contained in:
Manish Goregaokar 2016-11-16 17:31:37 -08:00
parent 52a3a71be3
commit 53c99662bc
11 changed files with 41 additions and 32 deletions

View file

@ -22,7 +22,7 @@ pub struct CSSFontFaceRule {
}
impl CSSFontFaceRule {
fn new_inherited(parent: &CSSStyleSheet, fontfacerule: Arc<RwLock<FontFaceRule>>) -> CSSFontFaceRule {
fn new_inherited(parent: Option<&CSSStyleSheet>, fontfacerule: Arc<RwLock<FontFaceRule>>) -> CSSFontFaceRule {
CSSFontFaceRule {
cssrule: CSSRule::new_inherited(parent),
fontfacerule: fontfacerule,
@ -30,7 +30,7 @@ impl CSSFontFaceRule {
}
#[allow(unrooted_must_root)]
pub fn new(window: &Window, parent: &CSSStyleSheet,
pub fn new(window: &Window, parent: Option<&CSSStyleSheet>,
fontfacerule: Arc<RwLock<FontFaceRule>>) -> Root<CSSFontFaceRule> {
reflect_dom_object(box CSSFontFaceRule::new_inherited(parent, fontfacerule),
window,