mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
auto merge of #3577 : ttaubert/servo/issue/3193-named-element-mangle, r=jdm
Should probably use HashMap::entry() but that doesn't seem to be available with servo's current rust snapshot. r? @Ms2ger
This commit is contained in:
commit
a127fcd854
1 changed files with 4 additions and 10 deletions
|
@ -241,11 +241,9 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
|
|||
|
||||
let mut idmap = self.idmap.borrow_mut();
|
||||
|
||||
// FIXME https://github.com/mozilla/rust/issues/13195
|
||||
// Use mangle() when it exists again.
|
||||
let root = self.GetDocumentElement().expect("The element is in the document, so there must be a document element.").root();
|
||||
match idmap.find_mut(&id) {
|
||||
Some(elements) => {
|
||||
idmap.find_with_or_insert_with(id, element,
|
||||
|_key, elements, element| {
|
||||
let new_node: JSRef<Node> = NodeCast::from_ref(element);
|
||||
let mut head : uint = 0u;
|
||||
let root: JSRef<Node> = NodeCast::from_ref(*root);
|
||||
|
@ -264,13 +262,9 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
|
|||
}
|
||||
}
|
||||
elements.insert_unrooted(head, &element);
|
||||
return;
|
||||
},
|
||||
None => (),
|
||||
}
|
||||
let mut elements = vec!();
|
||||
elements.push_unrooted(&element);
|
||||
idmap.insert(id, elements);
|
||||
|_key, element| vec![element.unrooted()]
|
||||
);
|
||||
}
|
||||
|
||||
fn load_anchor_href(self, href: DOMString) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue