Skip to content

Commit

Permalink
Convert tagName to uppercase ASCII per spec
Browse files Browse the repository at this point in the history
  • Loading branch information
0b10011 committed Sep 3, 2013
1 parent 7ea10ff commit 02437f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/script/dom/element.rs
Expand Up @@ -19,6 +19,7 @@ use js::jsapi::{JSContext, JSObject};
use std::cell::Cell;
use std::comm;
use std::str::eq_slice;
use std::ascii::StrAsciiExt;
use std::FromStr;

pub struct Element {
Expand Down Expand Up @@ -171,7 +172,7 @@ impl<'self> Element {

impl Element {
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 {
Expand Down
1 change: 1 addition & 0 deletions src/test/html/content/test_prototypes.html
Expand Up @@ -3,6 +3,7 @@
<script src="harness.js"></script>
</head>
<body>
<foo-á>foo</foo-á>
<script src="test_prototypes.js"></script>
</body>
</html>
5 changes: 4 additions & 1 deletion src/test/html/content/test_prototypes.js
Expand Up @@ -4,4 +4,7 @@ is(window.document.documentElement instanceof HTMLElement, true);
is(window.document.documentElement instanceof HTMLHtmlElement, true);
is(window.document instanceof Document, true);
is(window.document instanceof HTMLDocument, true);
finish();
is(window.document.documentElement.tagName, "HTML");
is(window.document.getElementsByTagName('foo-á')[0] instanceof HTMLUnknownElement, true);
is(window.document.getElementsByTagName('foo-á')[0].tagName, "FOO-á");
finish();

5 comments on commit 02437f7

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from jdm
at 0b10011@02437f7

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging bfrohs/servo/834upperTagName = 02437f7 into auto

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bfrohs/servo/834upperTagName = 02437f7 merged ok, testing candidate = a8718d7

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors-servo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = a8718d7

Please sign in to comment.