mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
TextEncoder::Constructor should not trim whitespaces or lowercase labels #5900
Fixes #5900
This commit is contained in:
parent
2c17779440
commit
1d0976c192
2 changed files with 1 additions and 220 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue