Skip to content

Commit

Permalink
return null from GetNamespaceURI, not the empty string
Browse files Browse the repository at this point in the history
correctly mark tests
  • Loading branch information
ajnirp committed Aug 27, 2014
1 parent 782deca commit 32b7f5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 41 deletions.
7 changes: 5 additions & 2 deletions src/components/script/dom/element.rs
Expand Up @@ -471,8 +471,11 @@ impl Element {

impl<'a> ElementMethods for JSRef<'a, Element> {
// http://dom.spec.whatwg.org/#dom-element-namespaceuri
fn NamespaceURI(&self) -> DOMString {
self.namespace.to_str().to_string()
fn GetNamespaceURI(&self) -> Option<DOMString> {
match self.namespace {
Null => None,
ref ns => Some(ns.to_str().to_string())
}
}

fn LocalName(&self) -> DOMString {
Expand Down
2 changes: 1 addition & 1 deletion src/components/script/dom/webidls/Element.webidl
Expand Up @@ -19,7 +19,7 @@ interface Element : Node {
readonly attribute DOMString localName;

[Constant]
readonly attribute DOMString namespaceURI;
readonly attribute DOMString? namespaceURI;
// Not [Constant] because it depends on which document we're in
[Pure]
readonly attribute DOMString tagName;
Expand Down
@@ -1,47 +1,12 @@
[DOMImplementation-createDocument.html]
type: testharness
[createDocument test 2: null,undefined,null,null]
expected: FAIL

[createDocument test 4: null,"foo",null,null]
expected: FAIL

[createDocument test 6: null,"f1oo",null,null]
expected: FAIL

[createDocument test 7: null,"foo1",null,null]
expected: FAIL

[createDocument test 11: null,"xml",null,null]
expected: FAIL

[createDocument test 12: null,"xmlns",null,"NAMESPACE_ERR"]
expected: FAIL

[createDocument test 13: null,"xmlfoo",null,null]
expected: FAIL

[createDocument test 18: undefined,undefined,undefined,null]
expected: FAIL

[createDocument test 20: undefined,"foo",undefined,null]
expected: FAIL

[createDocument test 22: undefined,"f1oo",undefined,null]
expected: FAIL

[createDocument test 23: undefined,"foo1",undefined,null]
expected: FAIL

[createDocument test 27: undefined,"xml",undefined,null]
expected: FAIL

[createDocument test 28: undefined,"xmlns",undefined,"NAMESPACE_ERR"]
expected: FAIL

[createDocument test 29: undefined,"xmlfoo",undefined,null]
expected: FAIL

[createDocument test 41: "http://example.com/","foo:",null,"NAMESPACE_ERR"]
expected: FAIL

Expand Down Expand Up @@ -78,6 +43,3 @@
[createDocument test 106: "foo:","xmlns:foo",null,"NAMESPACE_ERR"]
expected: FAIL

[createDocument test 113: null,"foo",DocumentType node,null]
expected: FAIL

0 comments on commit 32b7f5e

Please sign in to comment.