mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make sure getElementById always returns the first element with the given ID in tree order.(fixes #1822)
This commit is contained in:
parent
86c83f7bfc
commit
50aea70f98
3 changed files with 77 additions and 8 deletions
|
@ -352,7 +352,7 @@ impl AttributeHandlers for JS<Element> {
|
|||
// "borrowed value does not live long enough"
|
||||
let mut doc = node.get().owner_doc().clone();
|
||||
let doc = doc.get_mut();
|
||||
doc.unregister_named_element(old_value);
|
||||
doc.unregister_named_element(self, old_value);
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
|
@ -640,7 +640,7 @@ impl IElement for JS<Element> {
|
|||
match self.get_attribute(Null, "id") {
|
||||
Some(attr) => {
|
||||
let mut doc = document_from_node(self);
|
||||
doc.get_mut().unregister_named_element(attr.get().Value());
|
||||
doc.get_mut().unregister_named_element(self, attr.get().Value());
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue