mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
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 -->
This commit is contained in:
commit
ee5aead60b
2 changed files with 4 additions and 7 deletions
|
@ -1847,12 +1847,14 @@ impl DocumentMethods for Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-document-createattribute
|
// 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 {
|
if xml_name_type(&local_name) == InvalidXMLName {
|
||||||
debug!("Not a valid element name");
|
debug!("Not a valid element name");
|
||||||
return Err(Error::InvalidCharacter);
|
return Err(Error::InvalidCharacter);
|
||||||
}
|
}
|
||||||
|
if self.is_html_document {
|
||||||
|
local_name.make_ascii_lowercase();
|
||||||
|
}
|
||||||
let name = Atom::from(&*local_name);
|
let name = Atom::from(&*local_name);
|
||||||
// repetition used because string_cache::atom::Atom is non-copyable
|
// repetition used because string_cache::atom::Atom is non-copyable
|
||||||
let l_name = Atom::from(&*local_name);
|
let l_name = Atom::from(&*local_name);
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
[Document-createAttribute.html]
|
|
||||||
type: testharness
|
|
||||||
[HTML document.createAttribute("TITLE")]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue