diff options
author | Zachary Newman <znewman01@gmail.com> | 2014-11-17 21:21:46 -0500 |
---|---|---|
committer | Zachary Newman <znewman01@gmail.com> | 2014-11-17 21:21:46 -0500 |
commit | a8ce3e3366f5a9e72e0b00bc55e4f9d88a4ebfee (patch) | |
tree | fab9d85eceadd8a8b3bff1b5b5e6e95b48a8df8b /components/script/dom/document.rs | |
parent | 3a0b12f2c0ce81c75586389ed6cbb8b951a81868 (diff) | |
download | servo-a8ce3e3366f5a9e72e0b00bc55e4f9d88a4ebfee.tar.gz servo-a8ce3e3366f5a9e72e0b00bc55e4f9d88a4ebfee.zip |
Update behavior of Document.createElement
Fixes #4009.
Only lower-case the argument to Document#createElement if it's a HTML document.
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 2b8632fd7c1..7bdc519b242 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -567,7 +567,11 @@ impl<'a> DocumentMethods for JSRef<'a, Document> { debug!("Not a valid element name"); 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())); Ok(Element::create(name, None, self, ScriptCreated)) } |