mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Update behavior of Document.createElement
Fixes #4009. Only lower-case the argument to Document#createElement if it's a HTML document.
This commit is contained in:
parent
3a0b12f2c0
commit
a8ce3e3366
2 changed files with 5 additions and 4 deletions
|
@ -567,7 +567,11 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
|
||||||
debug!("Not a valid element name");
|
debug!("Not a valid element name");
|
||||||
return Err(InvalidCharacter);
|
return Err(InvalidCharacter);
|
||||||
}
|
}
|
||||||
let local_name = local_name.as_slice().to_ascii_lower();
|
let local_name = if self.is_html_document {
|
||||||
|
local_name.as_slice().to_ascii_lower()
|
||||||
|
} else {
|
||||||
|
local_name
|
||||||
|
};
|
||||||
let name = QualName::new(ns!(HTML), Atom::from_slice(local_name.as_slice()));
|
let name = QualName::new(ns!(HTML), Atom::from_slice(local_name.as_slice()));
|
||||||
Ok(Element::create(name, None, self, ScriptCreated))
|
Ok(Element::create(name, None, self, ScriptCreated))
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
[new Document(): interfaces]
|
[new Document(): interfaces]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[new Document(): metadata]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[new Document(): URL parsing]
|
[new Document(): URL parsing]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue