mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Convert tagName to uppercase ASCII per spec
http://dom.spec.whatwg.org/#dom-element-tagname
This commit is contained in:
parent
7ea10ff8af
commit
02437f7e87
3 changed files with 7 additions and 2 deletions
|
@ -19,6 +19,7 @@ use js::jsapi::{JSContext, JSObject};
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::comm;
|
use std::comm;
|
||||||
use std::str::eq_slice;
|
use std::str::eq_slice;
|
||||||
|
use std::ascii::StrAsciiExt;
|
||||||
use std::FromStr;
|
use std::FromStr;
|
||||||
|
|
||||||
pub struct Element {
|
pub struct Element {
|
||||||
|
@ -171,7 +172,7 @@ impl<'self> Element {
|
||||||
|
|
||||||
impl Element {
|
impl Element {
|
||||||
pub fn TagName(&self) -> DOMString {
|
pub fn TagName(&self) -> DOMString {
|
||||||
str(self.tag_name.to_owned())
|
str(self.tag_name.to_owned().to_ascii_upper())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn Id(&self) -> DOMString {
|
pub fn Id(&self) -> DOMString {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<script src="harness.js"></script>
|
<script src="harness.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<foo-á>foo</foo-á>
|
||||||
<script src="test_prototypes.js"></script>
|
<script src="test_prototypes.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -4,4 +4,7 @@ is(window.document.documentElement instanceof HTMLElement, true);
|
||||||
is(window.document.documentElement instanceof HTMLHtmlElement, true);
|
is(window.document.documentElement instanceof HTMLHtmlElement, true);
|
||||||
is(window.document instanceof Document, true);
|
is(window.document instanceof Document, true);
|
||||||
is(window.document instanceof HTMLDocument, true);
|
is(window.document instanceof HTMLDocument, true);
|
||||||
|
is(window.document.documentElement.tagName, "HTML");
|
||||||
|
is(window.document.getElementsByTagName('foo-á')[0] instanceof HTMLUnknownElement, true);
|
||||||
|
is(window.document.getElementsByTagName('foo-á')[0].tagName, "FOO-á");
|
||||||
finish();
|
finish();
|
Loading…
Add table
Add a link
Reference in a new issue