mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make attributes lose their owner when removed
This commit is contained in:
parent
4ffeb81aa7
commit
d3d12e6324
2 changed files with 34 additions and 8 deletions
|
@ -757,12 +757,13 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
|
|||
});
|
||||
|
||||
if let Some(idx) = idx {
|
||||
let attr = (*self.attrs.borrow())[idx].root();
|
||||
if namespace == ns!("") {
|
||||
let attr = (*self.attrs.borrow())[idx].root();
|
||||
vtable_for(&NodeCast::from_ref(self)).before_remove_attr(attr.r());
|
||||
}
|
||||
|
||||
self.attrs.borrow_mut().remove(idx);
|
||||
attr.r().set_owner(None);
|
||||
|
||||
let node: JSRef<Node> = NodeCast::from_ref(self);
|
||||
if node.is_in_doc() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue