mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
parent
9060772af9
commit
e01569834c
5 changed files with 11 additions and 35 deletions
|
@ -491,14 +491,14 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
|
|||
|
||||
// http://dom.spec.whatwg.org/#dom-element-tagname
|
||||
fn TagName(&self) -> DOMString {
|
||||
match self.prefix {
|
||||
None => {
|
||||
self.local_name.as_slice().to_ascii_upper()
|
||||
}
|
||||
Some(ref prefix_str) => {
|
||||
let s = format!("{}:{}", prefix_str, self.local_name);
|
||||
s.as_slice().to_ascii_upper()
|
||||
}
|
||||
let qualified_name = match self.prefix {
|
||||
Some(ref prefix) => format!("{}:{}", prefix, self.local_name).into_maybe_owned(),
|
||||
None => self.local_name.as_slice().into_maybe_owned()
|
||||
};
|
||||
if self.html_element_in_html_document() {
|
||||
qualified_name.as_slice().to_ascii_upper()
|
||||
} else {
|
||||
qualified_name.into_string()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,8 +43,7 @@
|
|||
|
||||
// test5: append body to a new document
|
||||
{
|
||||
let new_document = new Document();
|
||||
new_document.appendChild(new_document.createElement("html"));
|
||||
let new_document = document.implementation.createHTMLDocument();
|
||||
let new_body = new_document.createElement("body");
|
||||
|
||||
is_not(new_body, null, "test5-0, append body to a new document");
|
||||
|
@ -57,8 +56,7 @@
|
|||
|
||||
// test6: append frameset to a new document
|
||||
{
|
||||
let new_document = new Document();
|
||||
new_document.appendChild(new_document.createElement("html"));
|
||||
let new_document = document.implementation.createHTMLDocument();
|
||||
let new_frameset = new_document.createElement("frameset");
|
||||
|
||||
is_not(new_frameset, null, "test6-0, append frameset to a new document");
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
is_not(new_head, null, "test2-0, append head to a new document");
|
||||
is_a(new_head, HTMLHeadElement, "test2-1, append head to a new document");
|
||||
is(new_head && new_head.tagName, "HEAD", "test2-2, append head to a new document");
|
||||
is(new_head && new_head.tagName, "head", "test2-2, append head to a new document");
|
||||
|
||||
// Document::head is read-only.
|
||||
new_document.head = new_head;
|
||||
|
|
|
@ -12,24 +12,5 @@
|
|||
[Lower-case HTML element with a prefix]
|
||||
expected: FAIL
|
||||
|
||||
[Lower-case non-HTML element without a prefix]
|
||||
expected: FAIL
|
||||
|
||||
[Lower-case non-HTML element with a prefix]
|
||||
expected: FAIL
|
||||
|
||||
[Upper-case HTML element with a prefix]
|
||||
expected: FAIL
|
||||
|
||||
[Upper-case non-HTML element with a prefix]
|
||||
expected: FAIL
|
||||
|
||||
[null namespace]
|
||||
expected: FAIL
|
||||
|
||||
[undefined namespace]
|
||||
expected: FAIL
|
||||
|
||||
[empty string namespace]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
[tagName should upper-case for HTML elements in HTML documents.]
|
||||
expected: FAIL
|
||||
|
||||
[tagName should not upper-case for SVG elements in HTML documents.]
|
||||
expected: FAIL
|
||||
|
||||
[tagName should be updated when changing ownerDocument]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue