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
|
@ -13,7 +13,6 @@ use dom::bindings::js::{LayoutJS, Root};
|
|||
use dom::document::Document;
|
||||
use dom::element::Element;
|
||||
use dom::node::{Node, NodeDamage};
|
||||
use std::borrow::ToOwned;
|
||||
use std::cell::Ref;
|
||||
use util::str::DOMString;
|
||||
|
||||
|
@ -65,7 +64,7 @@ impl CharacterDataMethods for CharacterData {
|
|||
// Steps 4.
|
||||
Some(count_bytes) => &data_from_offset[..count_bytes],
|
||||
};
|
||||
Ok(DOMString(substring.to_owned()))
|
||||
Ok(DOMString::from(substring))
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-characterdata-appenddatadata
|
||||
|
@ -103,9 +102,9 @@ impl CharacterDataMethods for CharacterData {
|
|||
new_data.push_str(prefix);
|
||||
new_data.push_str(&arg);
|
||||
new_data.push_str(suffix);
|
||||
DOMString(new_data)
|
||||
new_data
|
||||
};
|
||||
*self.data.borrow_mut() = new_data;
|
||||
*self.data.borrow_mut() = DOMString::from(new_data);
|
||||
self.content_changed();
|
||||
// FIXME: Once we have `Range`, we should implement step 8 to step 11
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue