diff options
-rw-r--r-- | components/script/dom/characterdata.rs | 6 | ||||
-rw-r--r-- | components/script/dom/eventtarget.rs | 2 | ||||
-rw-r--r-- | components/script/dom/window.rs | 2 | ||||
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 2 | ||||
-rw-r--r-- | components/script/lib.rs | 1 | ||||
-rw-r--r-- | ports/cef/lib.rs | 1 | ||||
-rw-r--r-- | ports/cef/string.rs | 4 |
7 files changed, 8 insertions, 10 deletions
diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index d9798f76a11..bffd52831e9 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -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(()) } diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index 991fc1e9415..409fdbd436d 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -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) diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index ed50d073175..e81efa4a77c 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -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()); diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 255e4e0834d..7de3d956437 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -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 { diff --git a/components/script/lib.rs b/components/script/lib.rs index 93ba1dba8a4..7d703a39d03 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -18,7 +18,6 @@ #![feature(peekable_is_empty)] #![feature(plugin)] #![feature(slice_patterns)] -#![feature(str_utf16)] #![deny(unsafe_code)] #![allow(non_snake_case)] diff --git a/ports/cef/lib.rs b/ports/cef/lib.rs index 2533d3cd7e9..640045505a0 100644 --- a/ports/cef/lib.rs +++ b/ports/cef/lib.rs @@ -10,7 +10,6 @@ #![feature(iter_arith)] #![feature(link_args)] #![feature(plugin)] -#![feature(str_utf16)] #![feature(unicode)] #![feature(unsafe_no_drop_flag)] diff --git a/ports/cef/string.rs b/ports/cef/string.rs index 82d1b6a9d07..f43b400c62d 100644 --- a/ports/cef/string.rs +++ b/ports/cef/string.rs @@ -124,7 +124,7 @@ pub extern "C" fn cef_string_utf8_cmp(a: *const cef_string_utf8_t, b: *const cef #[no_mangle] pub extern "C" fn cef_string_utf8_to_utf16(src: *const u8, src_len: size_t, output: *mut cef_string_utf16_t) -> c_int { slice_to_str(src, src_len as usize, |result| { - let conv = result.utf16_units().collect::<Vec<u16>>(); + let conv = result.encode_utf16().collect::<Vec<u16>>(); cef_string_utf16_set(conv.as_ptr(), conv.len() as size_t, output, 1); 1 }) @@ -286,7 +286,7 @@ pub extern "C" fn cef_string_wide_to_utf8(src: *const wchar_t, src_len: size_t, #[no_mangle] pub extern "C" fn cef_string_ascii_to_utf16(src: *const u8, src_len: size_t, output: *mut cef_string_utf16_t) -> c_int { slice_to_str(src, src_len as usize, |result| { - let conv = result.utf16_units().collect::<Vec<u16>>(); + let conv = result.encode_utf16().collect::<Vec<u16>>(); cef_string_utf16_set(conv.as_ptr(), conv.len() as size_t, output, 1) }) } |