mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Add debug logging to register_named_element and unregister_named_element.
I found them helpful; I imagine others might as well.
This commit is contained in:
parent
3d4122e7c1
commit
da3c654f69
1 changed files with 2 additions and 0 deletions
|
@ -396,6 +396,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
|
|||
fn unregister_named_element(self,
|
||||
to_unregister: &Element,
|
||||
id: Atom) {
|
||||
debug!("Removing named element from document {:p}: {:p} id={}", self, to_unregister, id);
|
||||
let mut idmap = self.idmap.borrow_mut();
|
||||
let is_empty = match idmap.get_mut(&id) {
|
||||
None => false,
|
||||
|
@ -417,6 +418,7 @@ impl<'a> DocumentHelpers<'a> for &'a Document {
|
|||
fn register_named_element(self,
|
||||
element: &Element,
|
||||
id: Atom) {
|
||||
debug!("Adding named element to document {:p}: {:p} id={}", self, element, id);
|
||||
assert!({
|
||||
let node = NodeCast::from_ref(element);
|
||||
node.is_in_doc()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue