Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed error type on qname, per spec
  • Loading branch information
pshaughn committed Feb 12, 2020
1 parent ed9b584 commit 9cc3252
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 289 deletions.
11 changes: 3 additions & 8 deletions components/script/dom/bindings/xmlname.rs
Expand Up @@ -10,15 +10,10 @@ use html5ever::{LocalName, Namespace, Prefix};

/// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details.
pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult {
// Step 2.
match xml_name_type(qualified_name) {
XMLName::InvalidXMLName => {
// Step 1.
Err(Error::InvalidCharacter)
},
XMLName::Name => {
// Step 2.
Err(Error::Namespace)
},
XMLName::InvalidXMLName => Err(Error::InvalidCharacter),
XMLName::Name => Err(Error::InvalidCharacter), // see whatwg/dom#671
XMLName::QName => Ok(()),
}
}
Expand Down
Expand Up @@ -12,78 +12,12 @@
[createDocument test: "http://example.com/","ெ:a",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

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

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

[createDocument test: null,"f:o:o",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: null,":",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

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

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

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

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

[createDocument test: undefined,"f::oo",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

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

[createDocument test: "http://example.com/","f:o:o",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

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

[createDocument test: "http://example.com/","f::oo",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "http://example.com/","a:0",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "http://example.com/","a:ெ",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "http://example.com/","prefix::local",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "/",":foo",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "/","foo:",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "http://www.w3.org/XML/1998/namespace",":foo",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "http://www.w3.org/XML/1998/namespace","foo:",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "http://www.w3.org/2000/xmlns/",":foo",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

[createDocument test: "http://www.w3.org/2000/xmlns/","foo:",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

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

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

[createDocument test: "http://example.com/","a:̀",null,"INVALID_CHARACTER_ERR"]
expected: FAIL

This file was deleted.

198 changes: 0 additions & 198 deletions tests/wpt/metadata/dom/nodes/Document-createElementNS.html.ini
Expand Up @@ -102,123 +102,6 @@
[createElementNS test in XML document: "foo:","foo:","NAMESPACE_ERR"]
expected: FAIL

[createElementNS test in HTML document: null,":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: null,":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: null,":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: null,"foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: null,"foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: null,"foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: null,"f:o:o","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: null,"f:o:o","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: null,"f:o:o","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: null,":","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: null,":","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: null,":","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: undefined,":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: undefined,":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: undefined,":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: undefined,"foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: undefined,"foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: undefined,"foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: undefined,"f::oo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: undefined,"f::oo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: undefined,"f::oo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://example.com/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://example.com/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://example.com/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://example.com/","f:o:o","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://example.com/","f:o:o","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://example.com/","f:o:o","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://example.com/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://example.com/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://example.com/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://example.com/","f::oo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://example.com/","f::oo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://example.com/","f::oo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://example.com/","a:0","INVALID_CHARACTER_ERR"]
expected: FAIL

Expand All @@ -237,87 +120,6 @@
[createElementNS test in XHTML document: "http://example.com/","a:ெ","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://example.com/","prefix::local","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://example.com/","prefix::local","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://example.com/","prefix::local","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://www.w3.org/2000/xmlns/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "foo:",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "foo:",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "foo:",":foo","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "foo:","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XML document: "foo:","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in XHTML document: "foo:","foo:","INVALID_CHARACTER_ERR"]
expected: FAIL

[createElementNS test in HTML document: "http://example.com/","a:̀","INVALID_CHARACTER_ERR"]
expected: FAIL

Expand Down
6 changes: 0 additions & 6 deletions tests/wpt/metadata/dom/nodes/attributes.html.ini

This file was deleted.

0 comments on commit 9cc3252

Please sign in to comment.