mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Added in-place mutation to DOMString.
The methods which are currently implemented are the ones on String that are currently being used: string.push_str(...), string.clear() and string.extend(...). We may want to revisit this API.
This commit is contained in:
parent
034769f280
commit
5db67b5981
5 changed files with 23 additions and 5 deletions
|
@ -69,6 +69,7 @@ impl CharacterDataMethods for CharacterData {
|
|||
|
||||
// https://dom.spec.whatwg.org/#dom-characterdata-appenddatadata
|
||||
fn AppendData(&self, data: DOMString) {
|
||||
// FIXME(ajeffrey): Efficient append on DOMStrings?
|
||||
self.append_data(&*data);
|
||||
}
|
||||
|
||||
|
@ -149,7 +150,8 @@ impl CharacterData {
|
|||
}
|
||||
#[inline]
|
||||
pub fn append_data(&self, data: &str) {
|
||||
self.data.borrow_mut().0.push_str(data);
|
||||
// FIXME(ajeffrey): Efficient append on DOMStrings?
|
||||
self.data.borrow_mut().push_str(data);
|
||||
self.content_changed();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue