mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replaced DOMString constructor by conversion functions.
Replaced DOMString(...) by DOMString::from(...). Replaced ....0 by String::from(...). Removed any uses of .to_owner() in DOMString::from("...").
This commit is contained in:
parent
736323a779
commit
84bde75b42
64 changed files with 256 additions and 254 deletions
|
@ -1710,13 +1710,14 @@ impl Node {
|
|||
None => (),
|
||||
}
|
||||
}
|
||||
DOMString(content)
|
||||
DOMString::from(content)
|
||||
}
|
||||
|
||||
pub fn namespace_to_string(namespace: Namespace) -> Option<DOMString> {
|
||||
match namespace {
|
||||
ns!("") => None,
|
||||
Namespace(ref ns) => Some(DOMString((**ns).to_owned()))
|
||||
// FIXME(ajeffrey): convert directly from &Atom to DOMString
|
||||
Namespace(ref ns) => Some(DOMString::from(&**ns))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1812,16 +1813,16 @@ impl NodeMethods for Node {
|
|||
NodeTypeId::Element(..) => {
|
||||
self.downcast::<Element>().unwrap().TagName()
|
||||
}
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => DOMString("#text".to_owned()),
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Text) => DOMString::from("#text"),
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction) => {
|
||||
self.downcast::<ProcessingInstruction>().unwrap().Target()
|
||||
}
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) => DOMString("#comment".to_owned()),
|
||||
NodeTypeId::CharacterData(CharacterDataTypeId::Comment) => DOMString::from("#comment"),
|
||||
NodeTypeId::DocumentType => {
|
||||
self.downcast::<DocumentType>().unwrap().name().clone()
|
||||
},
|
||||
NodeTypeId::DocumentFragment => DOMString("#document-fragment".to_owned()),
|
||||
NodeTypeId::Document => DOMString("#document".to_owned())
|
||||
NodeTypeId::DocumentFragment => DOMString::from("#document-fragment"),
|
||||
NodeTypeId::Document => DOMString::from("#document")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue