aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/document.rs6
-rw-r--r--tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini5
2 files changed, 4 insertions, 7 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 604c09a3b2c..49afd4dc9ee 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -1847,12 +1847,14 @@ impl DocumentMethods for Document {
}
// https://dom.spec.whatwg.org/#dom-document-createattribute
- fn CreateAttribute(&self, local_name: DOMString) -> Fallible<Root<Attr>> {
+ fn CreateAttribute(&self, mut local_name: DOMString) -> Fallible<Root<Attr>> {
if xml_name_type(&local_name) == InvalidXMLName {
debug!("Not a valid element name");
return Err(Error::InvalidCharacter);
}
-
+ if self.is_html_document {
+ local_name.make_ascii_lowercase();
+ }
let name = Atom::from(&*local_name);
// repetition used because string_cache::atom::Atom is non-copyable
let l_name = Atom::from(&*local_name);
diff --git a/tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini b/tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini
deleted file mode 100644
index 9a1dd15b5fb..00000000000
--- a/tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[Document-createAttribute.html]
- type: testharness
- [HTML document.createAttribute("TITLE")]
- expected: FAIL
-