mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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
|
@ -22,7 +22,7 @@ pub struct CSSStyleRule {
|
|||
}
|
||||
|
||||
impl CSSStyleRule {
|
||||
fn new_inherited(parent: &CSSStyleSheet, stylerule: Arc<RwLock<StyleRule>>) -> CSSStyleRule {
|
||||
fn new_inherited(parent: Option<&CSSStyleSheet>, stylerule: Arc<RwLock<StyleRule>>) -> CSSStyleRule {
|
||||
CSSStyleRule {
|
||||
cssrule: CSSRule::new_inherited(parent),
|
||||
stylerule: stylerule,
|
||||
|
@ -30,7 +30,7 @@ impl CSSStyleRule {
|
|||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent: &CSSStyleSheet,
|
||||
pub fn new(window: &Window, parent: Option<&CSSStyleSheet>,
|
||||
stylerule: Arc<RwLock<StyleRule>>) -> Root<CSSStyleRule> {
|
||||
reflect_dom_object(box CSSStyleRule::new_inherited(parent, stylerule),
|
||||
window,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue