mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Assert against permanently-leaked rule nodes.
MozReview-Commit-ID: CK5iEWWHFSr
This commit is contained in:
parent
a3b32aaa5b
commit
ea81f36b1d
2 changed files with 8 additions and 3 deletions
|
@ -122,6 +122,11 @@ impl RuleTree {
|
|||
self.root.clone()
|
||||
}
|
||||
|
||||
/// Returns true if there are no nodes in the tree aside from the rule node.
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.root.get().first_child.load(Ordering::Relaxed).is_null()
|
||||
}
|
||||
|
||||
fn dump<W: Write>(&self, guards: &StylesheetGuards, writer: &mut W) {
|
||||
let _ = writeln!(writer, " + RuleTree");
|
||||
self.root.get().dump(guards, writer, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue