mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make StrongRuleNode::ensure_child take a StrongRuleNode for the root
This commit is contained in:
parent
37c70609f9
commit
fb28ce6bbe
2 changed files with 11 additions and 10 deletions
|
@ -367,7 +367,7 @@ impl StrongRuleNode {
|
|||
StrongRuleNode { p }
|
||||
}
|
||||
|
||||
pub(super) fn downgrade(&self) -> WeakRuleNode {
|
||||
fn downgrade(&self) -> WeakRuleNode {
|
||||
unsafe { WeakRuleNode::from_ptr(self.p) }
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ impl StrongRuleNode {
|
|||
|
||||
pub(super) fn ensure_child(
|
||||
&self,
|
||||
root: WeakRuleNode,
|
||||
root: &StrongRuleNode,
|
||||
source: StyleSource,
|
||||
level: CascadeLevel,
|
||||
) -> StrongRuleNode {
|
||||
|
@ -404,6 +404,7 @@ impl StrongRuleNode {
|
|||
key,
|
||||
|node| unsafe { (*node.ptr()).key() },
|
||||
move || {
|
||||
let root = root.downgrade();
|
||||
let strong =
|
||||
StrongRuleNode::new(Box::new(RuleNode::new(root, self.clone(), source, level)));
|
||||
let weak = strong.downgrade();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue