mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Allow mutation of CssRules
This commit is contained in:
parent
71a2b379c8
commit
2fe390e237
5 changed files with 11 additions and 10 deletions
|
@ -25,7 +25,7 @@ pub struct CSSRuleList {
|
|||
impl CSSRuleList {
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new_inherited(sheet: &CSSStyleSheet, rules: CssRules) -> CSSRuleList {
|
||||
let dom_rules = rules.0.iter().map(|_| MutNullableHeap::new(None)).collect();
|
||||
let dom_rules = rules.0.read().iter().map(|_| MutNullableHeap::new(None)).collect();
|
||||
CSSRuleList {
|
||||
reflector_: Reflector::new(),
|
||||
sheet: JS::from_ref(sheet),
|
||||
|
@ -49,7 +49,7 @@ impl CSSRuleListMethods for CSSRuleList {
|
|||
rule.or_init(|| {
|
||||
CSSRule::new_specific(self.global().as_window(),
|
||||
&self.sheet,
|
||||
self.rules.0[idx as usize].clone())
|
||||
self.rules.0.read()[idx as usize].clone())
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue