mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make parent stylesheet optional for CSSRules
This commit is contained in:
parent
52a3a71be3
commit
53c99662bc
11 changed files with 41 additions and 32 deletions
|
@ -23,7 +23,7 @@ pub struct CSSMediaRule {
|
|||
}
|
||||
|
||||
impl CSSMediaRule {
|
||||
fn new_inherited(parent: &CSSStyleSheet, mediarule: Arc<RwLock<MediaRule>>) -> CSSMediaRule {
|
||||
fn new_inherited(parent: Option<&CSSStyleSheet>, mediarule: Arc<RwLock<MediaRule>>) -> CSSMediaRule {
|
||||
CSSMediaRule {
|
||||
cssrule: CSSGroupingRule::new_inherited(parent),
|
||||
mediarule: mediarule,
|
||||
|
@ -31,7 +31,7 @@ impl CSSMediaRule {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent: &CSSStyleSheet,
|
||||
pub fn new(window: &Window, parent: Option<&CSSStyleSheet>,
|
||||
mediarule: Arc<RwLock<MediaRule>>) -> Root<CSSMediaRule> {
|
||||
reflect_dom_object(box CSSMediaRule::new_inherited(parent, mediarule),
|
||||
window,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue