rename deprecated utf16_units to encode_utf16

This commit is contained in:
Arpad Borsos 2016-03-07 16:10:42 +01:00
parent 743e0c9c87
commit c880c97b1b
7 changed files with 8 additions and 10 deletions

View file

@ -78,7 +78,7 @@ impl CharacterDataMethods for CharacterData {
// https://dom.spec.whatwg.org/#dom-characterdata-data
fn SetData(&self, data: DOMString) {
let old_length = self.Length();
let new_length = data.utf16_units().count() as u32;
let new_length = data.encode_utf16().count() as u32;
*self.data.borrow_mut() = data;
self.content_changed();
let node = self.upcast::<Node>();
@ -87,7 +87,7 @@ impl CharacterDataMethods for CharacterData {
// https://dom.spec.whatwg.org/#dom-characterdata-length
fn Length(&self) -> u32 {
self.data.borrow().utf16_units().count() as u32
self.data.borrow().encode_utf16().count() as u32
}
// https://dom.spec.whatwg.org/#dom-characterdata-substringdata
@ -151,7 +151,7 @@ impl CharacterDataMethods for CharacterData {
// Steps 8-11.
let node = self.upcast::<Node>();
node.ranges().replace_code_units(
node, offset, count, arg.utf16_units().count() as u32);
node, offset, count, arg.encode_utf16().count() as u32);
Ok(())
}

View file

@ -390,7 +390,7 @@ impl EventTarget {
// TODO step 1.2 (browsing context/scripting enabled)
// Step 1.3
let body: Vec<u16> = handler.source.utf16_units().collect();
let body: Vec<u16> = handler.source.encode_utf16().collect();
// TODO step 1.5 (form owner)

View file

@ -820,7 +820,7 @@ impl<'a, T: Reflectable> ScriptHelpers for &'a T {
let cx = global.r().get_cx();
let _ar = JSAutoRequest::new(cx);
let globalhandle = global.r().reflector().get_jsobject();
let code: Vec<u16> = code.utf16_units().collect();
let code: Vec<u16> = code.encode_utf16().collect();
let filename = CString::new(filename).unwrap();
let _ac = JSAutoCompartment::new(cx, globalhandle.get());

View file

@ -1172,7 +1172,7 @@ impl XMLHttpRequest {
}
// Step 4
let json_text = UTF_8.decode(&bytes, DecoderTrap::Replace).unwrap();
let json_text: Vec<u16> = json_text.utf16_units().collect();
let json_text: Vec<u16> = json_text.encode_utf16().collect();
// Step 5
let mut rval = RootedValue::new(cx, UndefinedValue());
unsafe {