diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index ac15ef844f2..129ca0ff0a0 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use std::ascii::AsciiExt; + use dom::attr::Attr; use dom::attr::AttrHelpers; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; @@ -216,7 +218,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> { }, Some(ref s) => { debug!("script type={:s}", *s); - SCRIPT_JS_MIMES.contains(&s.as_slice().trim_chars(HTML_SPACE_CHARACTERS)) + SCRIPT_JS_MIMES.contains(&s.to_ascii_lower().as_slice().trim_chars(HTML_SPACE_CHARACTERS)) }, None => { debug!("no script type"); @@ -229,7 +231,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> { }, Some(ref s) => { debug!("script language={:s}", *s); - SCRIPT_JS_MIMES.contains(&format!("text/{}", s).as_slice()) + SCRIPT_JS_MIMES.contains(&format!("text/{}", s).to_ascii_lower().as_slice()) }, None => { debug!("no script type or language, inferring js"); diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-languages-02.html.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-languages-02.html.ini deleted file mode 100644 index 1e6de9c769c..00000000000 --- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-languages-02.html.ini +++ /dev/null @@ -1,86 +0,0 @@ -[script-languages-02.html] - type: testharness - [Script should run with type="APPLICATION/ECMASCRIPT"] - expected: FAIL - - [Script should run with type="APPLICATION/JAVASCRIPT"] - expected: FAIL - - [Script should run with type="APPLICATION/X-ECMASCRIPT"] - expected: FAIL - - [Script should run with type="APPLICATION/X-JAVASCRIPT"] - expected: FAIL - - [Script should run with type="TEXT/ECMASCRIPT"] - expected: FAIL - - [Script should run with type="TEXT/JAVASCRIPT"] - expected: FAIL - - [Script should run with type="TEXT/JAVASCRIPT1.0"] - expected: FAIL - - [Script should run with type="TEXT/JAVASCRIPT1.1"] - expected: FAIL - - [Script should run with type="TEXT/JAVASCRIPT1.2"] - expected: FAIL - - [Script should run with type="TEXT/JAVASCRIPT1.3"] - expected: FAIL - - [Script should run with type="TEXT/JAVASCRIPT1.4"] - expected: FAIL - - [Script should run with type="TEXT/JAVASCRIPT1.5"] - expected: FAIL - - [Script should run with type="TEXT/JSCRIPT"] - expected: FAIL - - [Script should run with type="TEXT/LIVESCRIPT"] - expected: FAIL - - [Script should run with type="TEXT/X-ECMASCRIPT"] - expected: FAIL - - [Script should run with type="TEXT/X-JAVASCRIPT"] - expected: FAIL - - [Script should run with language="ECMASCRIPT"] - expected: FAIL - - [Script should run with language="JAVASCRIPT"] - expected: FAIL - - [Script should run with language="JAVASCRIPT1.0"] - expected: FAIL - - [Script should run with language="JAVASCRIPT1.1"] - expected: FAIL - - [Script should run with language="JAVASCRIPT1.2"] - expected: FAIL - - [Script should run with language="JAVASCRIPT1.3"] - expected: FAIL - - [Script should run with language="JAVASCRIPT1.4"] - expected: FAIL - - [Script should run with language="JAVASCRIPT1.5"] - expected: FAIL - - [Script should run with language="JSCRIPT"] - expected: FAIL - - [Script should run with language="LIVESCRIPT"] - expected: FAIL - - [Script should run with language="X-ECMASCRIPT"] - expected: FAIL - - [Script should run with language="X-JAVASCRIPT"] - expected: FAIL -