mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Use 'DOMString' to define the type insteand of '~str'.
At now, 'DOMString' is equal to '~str'.
155befe10d/src/components/script/dom/bindings/utils.rs (L119)
This commit is contained in:
parent
aa72c413ed
commit
4e4eb10ffc
1 changed files with 4 additions and 4 deletions
|
@ -92,7 +92,7 @@ pub struct Document {
|
|||
window: @mut Window,
|
||||
doctype: DocumentType,
|
||||
title: ~str,
|
||||
idmap: HashMap<~str, AbstractNode<ScriptView>>
|
||||
idmap: HashMap<DOMString, AbstractNode<ScriptView>>
|
||||
}
|
||||
|
||||
impl Document {
|
||||
|
@ -326,7 +326,7 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn register_nodes_with_id(&mut self, root: &AbstractNode<ScriptView>) {
|
||||
foreach_ided_elements(root, |id: &~str, abstract_node: &AbstractNode<ScriptView>| {
|
||||
foreach_ided_elements(root, |id: &DOMString, abstract_node: &AbstractNode<ScriptView>| {
|
||||
// TODO: "in tree order, within the context object's tree"
|
||||
// http://dom.spec.whatwg.org/#dom-document-getelementbyid.
|
||||
self.idmap.find_or_insert(id.clone(), *abstract_node);
|
||||
|
@ -334,7 +334,7 @@ impl Document {
|
|||
}
|
||||
|
||||
pub fn unregister_nodes_with_id(&mut self, root: &AbstractNode<ScriptView>) {
|
||||
foreach_ided_elements(root, |id: &~str, _| {
|
||||
foreach_ided_elements(root, |id: &DOMString, _| {
|
||||
// TODO: "in tree order, within the context object's tree"
|
||||
// http://dom.spec.whatwg.org/#dom-document-getelementbyid.
|
||||
self.idmap.pop(id);
|
||||
|
@ -366,7 +366,7 @@ impl Document {
|
|||
|
||||
#[inline(always)]
|
||||
fn foreach_ided_elements(root: &AbstractNode<ScriptView>,
|
||||
callback: &fn(&~str, &AbstractNode<ScriptView>)) {
|
||||
callback: &fn(&DOMString, &AbstractNode<ScriptView>)) {
|
||||
for node in root.traverse_preorder() {
|
||||
if !node.is_element() {
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue