mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Fix another deadlock
This commit is contained in:
parent
d9491187dc
commit
2952ccfae2
1 changed files with 6 additions and 3 deletions
|
@ -90,9 +90,12 @@ impl CSSRuleList {
|
||||||
let index = idx as usize;
|
let index = idx as usize;
|
||||||
|
|
||||||
let parent_stylesheet = self.parent_stylesheet.style_stylesheet();
|
let parent_stylesheet = self.parent_stylesheet.style_stylesheet();
|
||||||
let mut guard = parent_stylesheet.shared_lock.write();
|
let new_rule = {
|
||||||
let new_rule = css_rules.write_with(&mut guard)
|
let mut guard = parent_stylesheet.shared_lock.write();
|
||||||
.insert_rule(rule, parent_stylesheet, index, nested)?;
|
css_rules.write_with(&mut guard).insert_rule(rule, parent_stylesheet, index, nested)?
|
||||||
|
// Drop `guard` here,
|
||||||
|
// CSSRule::new_specific re-acquires the lock for @support and @media.
|
||||||
|
};
|
||||||
|
|
||||||
let parent_stylesheet = &*self.parent_stylesheet;
|
let parent_stylesheet = &*self.parent_stylesheet;
|
||||||
let dom_rule = CSSRule::new_specific(&window, parent_stylesheet, new_rule);
|
let dom_rule = CSSRule::new_specific(&window, parent_stylesheet, new_rule);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue