Assert against permanently-leaked rule nodes.

MozReview-Commit-ID: CK5iEWWHFSr
This commit is contained in:
Bobby Holley 2017-06-16 10:34:33 -07:00
parent a3b32aaa5b
commit ea81f36b1d
2 changed files with 8 additions and 3 deletions

View file

@ -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);