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
|
// http://dom.spec.whatwg.org/#dom-element-tagname
|
||||||
fn TagName(&self) -> DOMString {
|
fn TagName(&self) -> DOMString {
|
||||||
match self.prefix {
|
let qualified_name = match self.prefix {
|
||||||
None => {
|
Some(ref prefix) => format!("{}:{}", prefix, self.local_name).into_maybe_owned(),
|
||||||
self.local_name.as_slice().to_ascii_upper()
|
None => self.local_name.as_slice().into_maybe_owned()
|
||||||
}
|
};
|
||||||
Some(ref prefix_str) => {
|
if self.html_element_in_html_document() {
|
||||||
let s = format!("{}:{}", prefix_str, self.local_name);
|
qualified_name.as_slice().to_ascii_upper()
|
||||||
s.as_slice().to_ascii_upper()
|
} else {
|
||||||
}
|
qualified_name.into_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,7 @@
|
||||||
|
|
||||||
// test5: append body to a new document
|
// test5: append body to a new document
|
||||||
{
|
{
|
||||||
let new_document = new Document();
|
let new_document = document.implementation.createHTMLDocument();
|
||||||
new_document.appendChild(new_document.createElement("html"));
|
|
||||||
let new_body = new_document.createElement("body");
|
let new_body = new_document.createElement("body");
|
||||||
|
|
||||||
is_not(new_body, null, "test5-0, append body to a new document");
|
is_not(new_body, null, "test5-0, append body to a new document");
|
||||||
|
@ -57,8 +56,7 @@
|
||||||
|
|
||||||
// test6: append frameset to a new document
|
// test6: append frameset to a new document
|
||||||
{
|
{
|
||||||
let new_document = new Document();
|
let new_document = document.implementation.createHTMLDocument();
|
||||||
new_document.appendChild(new_document.createElement("html"));
|
|
||||||
let new_frameset = new_document.createElement("frameset");
|
let new_frameset = new_document.createElement("frameset");
|
||||||
|
|
||||||
is_not(new_frameset, null, "test6-0, append frameset to a new document");
|
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_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_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.
|
// Document::head is read-only.
|
||||||
new_document.head = new_head;
|
new_document.head = new_head;
|
||||||
|
|
|
@ -12,24 +12,5 @@
|
||||||
[Lower-case HTML element with a prefix]
|
[Lower-case HTML element with a prefix]
|
||||||
expected: FAIL
|
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]
|
[Upper-case HTML element with a prefix]
|
||||||
expected: FAIL
|
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.]
|
[tagName should upper-case for HTML elements in HTML documents.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[tagName should not upper-case for SVG elements in HTML documents.]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[tagName should be updated when changing ownerDocument]
|
[tagName should be updated when changing ownerDocument]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue