diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-13 15:46:13 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-13 15:46:13 +0530 |
commit | ee5aead60bba3c6a482960021677aac3d559289b (patch) | |
tree | 891972c3a83331b9480292074ee9230fe62ecb2e | |
parent | 9c8382cbde73a2d5f57c4a8a65d4ae55c03fd990 (diff) | |
parent | e684a20a1a814397f42d2dc11a43c1567e1c3191 (diff) | |
download | servo-ee5aead60bba3c6a482960021677aac3d559289b.tar.gz servo-ee5aead60bba3c6a482960021677aac3d559289b.zip |
Auto merge of #9282 - mattnenterprise:create-attribute-lowercase, r=nox
Making create attribute lowercase
This should fix #9252. I need some help getting the test case to work correctly. I get output that "TITLE" should FAIL, but it PASS. How do I make it to where it should PASS?
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9282)
<!-- Reviewable:end -->
-rw-r--r-- | components/script/dom/document.rs | 6 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/nodes/Document-createAttribute.html.ini | 5 |
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 - |