aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/textencoder.rs
diff options
context:
space:
mode:
authorPrabhjyot Singh Sodhi <prabhjyotsingh95@gmail.com>2015-04-30 14:54:01 +0530
committerPrabhjyot Singh Sodhi <prabhjyotsingh95@gmail.com>2015-04-30 16:51:02 +0530
commit1d0976c1925d0b3dadc458101d90c7664b0a35ce (patch)
tree1d9c07a7bb196b73098d760e2b95a5239c50c43f /components/script/dom/textencoder.rs
parent2c177794408bfbb5f8d6042f38639a5cba5eb2e5 (diff)
downloadservo-1d0976c1925d0b3dadc458101d90c7664b0a35ce.tar.gz
servo-1d0976c1925d0b3dadc458101d90c7664b0a35ce.zip
TextEncoder::Constructor should not trim whitespaces or lowercase labels #5900
Fixes #5900
Diffstat (limited to 'components/script/dom/textencoder.rs')
-rw-r--r--components/script/dom/textencoder.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/dom/textencoder.rs b/components/script/dom/textencoder.rs
index 91a02257d71..03c4902ec11 100644
--- a/components/script/dom/textencoder.rs
+++ b/components/script/dom/textencoder.rs
@@ -14,7 +14,6 @@ use dom::bindings::utils::{Reflector, reflect_dom_object};
use util::str::DOMString;
use std::borrow::ToOwned;
-use std::ascii::AsciiExt;
use std::ptr;
use encoding::types::EncodingRef;
@@ -50,7 +49,7 @@ impl TextEncoder {
// https://encoding.spec.whatwg.org/#dom-textencoder
pub fn Constructor(global: GlobalRef,
label: DOMString) -> Fallible<Temporary<TextEncoder>> {
- let encoding = match encoding_from_whatwg_label(&label.trim().to_ascii_lowercase()) {
+ let encoding = match encoding_from_whatwg_label(&label) {
Some(enc) => enc,
None => {
debug!("Encoding Label Not Supported");