diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index 3e9b9d0b5b6..289d540b5b3 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -2138,8 +2138,8 @@ WebIDL::ExceptionOr> Document::create_element(String const& loc // https://dom.spec.whatwg.org/#internal-createelementns-steps WebIDL::ExceptionOr> Document::create_element_ns(Optional const& namespace_, String const& qualified_name, Variant const& options) { - // 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to validate and extract. - auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name)); + // 1. Let (namespace, prefix, localName) be the result of validating and extracting namespace and qualifiedName given "element". + auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name, ValidationContext::Element)); // 2. Let is be null. Optional is_value; @@ -4507,11 +4507,10 @@ WebIDL::ExceptionOr> Document::create_attribute(String const& loca // https://dom.spec.whatwg.org/#dom-document-createattributens WebIDL::ExceptionOr> Document::create_attribute_ns(Optional const& namespace_, String const& qualified_name) { - // 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to validate and extract. - auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name)); + // 1. Let (namespace, prefix, localName) be the result of validating and extracting namespace and qualifiedName given "attribute". + auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name, ValidationContext::Attribute)); // 2. Return a new attribute whose namespace is namespace, namespace prefix is prefix, local name is localName, and node document is this. - return Attr::create(*this, extracted_qualified_name); } diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 0ffda5362e3..50bad83483c 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -236,8 +236,56 @@ WebIDL::ExceptionOr Element::set_attribute(FlyString const& name, String c return {}; } +// https://dom.spec.whatwg.org/#valid-namespace-prefix +bool is_valid_namespace_prefix(FlyString const& prefix) +{ + // A string is a valid namespace prefix if its length is at least 1 and it does not contain ASCII whitespace, U+0000 NULL, U+002F (/), or U+003E (>). + constexpr Array INVALID_NAMESPACE_PREFIX_CHARACTERS { '\t', '\n', '\f', '\r', ' ', '\0', '/', '>' }; + return !prefix.is_empty() && !prefix.code_points().contains_any_of(INVALID_NAMESPACE_PREFIX_CHARACTERS); +} + +bool is_valid_attribute_local_name(FlyString const& local_name) +{ + // A string is a valid attribute local name if its length is at least 1 and it does not contain ASCII whitespace, U+0000 NULL, U+002F (/), U+003D (=), or U+003E (>). + constexpr Array INVALID_ATTRIBUTE_LOCAL_NAME_CHARACTERS { '\t', '\n', '\f', '\r', ' ', '\0', '/', '=', '>' }; + return !local_name.is_empty() && !local_name.code_points().contains_any_of(INVALID_ATTRIBUTE_LOCAL_NAME_CHARACTERS); +} + +// https://dom.spec.whatwg.org/#valid-element-local-name +bool is_valid_element_local_name(FlyString const& name) +{ + // 1. If name’s length is 0, then return false. + if (name.is_empty()) + return false; + + // 2. If name’s 0th code point is an ASCII alpha, then: + auto first_code_point = *name.code_points().begin().peek(); + if (is_ascii_alpha(first_code_point)) { + // 1. If name contains ASCII whitespace, U+0000 NULL, U+002F (/), or U+003E (>), then return false. + constexpr Array INVALID_CHARACTERS { '\t', '\n', '\f', '\r', ' ', '\0', '/', '>' }; + if (name.code_points().contains_any_of(INVALID_CHARACTERS)) + return false; + + // 2. Return true. + return true; + } + + // 3. If name’s 0th code point is not U+003A (:), U+005F (_), or in the range U+0080 to U+10FFFF, inclusive, then return false. + if (!first_is_one_of(first_code_point, 0x003Au, 0x005Fu) && (first_code_point < 0x0080 || first_code_point > 0x10FFFF)) + return false; + + // 4. If name’s subsequent code points, if any, are not ASCII alphas, ASCII digits, U+002D (-), U+002E (.), U+003A (:), U+005F (_), or in the range U+0080 to U+10FFFF, inclusive, then return false. + for (auto code_point : name.code_points().unicode_substring_view(1)) { + if (!is_ascii_alpha(code_point) && !is_ascii_digit(code_point) && !first_is_one_of(code_point, 0X002Du, 0X002Eu, 0X003Au, 0X005Fu) && (code_point < 0x0080 || code_point > 0x10FFFF)) + return false; + } + + // 5. Return true. + return true; +} + // https://dom.spec.whatwg.org/#validate-and-extract -WebIDL::ExceptionOr validate_and_extract(JS::Realm& realm, Optional namespace_, FlyString const& qualified_name) +WebIDL::ExceptionOr validate_and_extract(JS::Realm& realm, Optional namespace_, FlyString const& qualified_name, ValidationContext context) { // To validate and extract a namespace and qualifiedName, run these steps: @@ -245,53 +293,70 @@ WebIDL::ExceptionOr validate_and_extract(JS::Realm& realm, Option if (namespace_.has_value() && namespace_.value().is_empty()) namespace_ = {}; - // 2. Validate qualifiedName. - TRY(Document::validate_qualified_name(realm, qualified_name)); - - // 3. Let prefix be null. + // 2. Let prefix be null. Optional prefix = {}; - // 4. Let localName be qualifiedName. + // 3. Let localName be qualifiedName. auto local_name = qualified_name; - // 5. If qualifiedName contains a U+003A (:): - if (qualified_name.bytes_as_string_view().contains(':')) { + // 4. If qualifiedName contains a U+003A (:): + if (qualified_name.code_points().contains(':')) { // 1. Let splitResult be the result of running strictly split given qualifiedName and U+003A (:). // FIXME: Use the "strictly split" algorithm - auto split_result = qualified_name.bytes_as_string_view().split_view(':'); + + size_t index = 0; + for (auto code_point : qualified_name.code_points()) { + if (code_point == ':') + break; + index++; + } // 2. Set prefix to splitResult[0]. - prefix = MUST(FlyString::from_utf8(split_result[0])); + auto prefix_view = qualified_name.code_points().unicode_substring_view(0, index); + prefix = MUST(FlyString::from_utf8(prefix_view.as_string())); // 3. Set localName to splitResult[1]. - local_name = MUST(FlyString::from_utf8(split_result[1])); + auto local_name_view = qualified_name.code_points().unicode_substring_view(index + 1); + local_name = MUST(FlyString::from_utf8(local_name_view.as_string())); } - // 6. If prefix is non-null and namespace is null, then throw a "NamespaceError" DOMException. + // 5. If prefix is not a valid namespace prefix, then throw an "InvalidCharacterError" DOMException. + if (prefix.has_value() && !is_valid_namespace_prefix(*prefix)) + return WebIDL::InvalidCharacterError::create(realm, "Prefix not a valid namespace prefix."_string); + + // 6. If context is "attribute" and localName is not a valid attribute local name, then throw an "InvalidCharacterError" DOMException. + if (context == ValidationContext::Attribute && !is_valid_attribute_local_name(local_name)) + return WebIDL::InvalidCharacterError::create(realm, "Local name not a valid attribute local name."_string); + + // 7. If context is "element" and localName is not a valid element local name, then throw an "InvalidCharacterError" DOMException. + if (context == ValidationContext::Element && !is_valid_element_local_name(local_name)) + return WebIDL::InvalidCharacterError::create(realm, "Local name not a valid element local name."_string); + + // 8. If prefix is non-null and namespace is null, then throw a "NamespaceError" DOMException. if (prefix.has_value() && !namespace_.has_value()) return WebIDL::NamespaceError::create(realm, "Prefix is non-null and namespace is null."_string); - // 7. If prefix is "xml" and namespace is not the XML namespace, then throw a "NamespaceError" DOMException. + // 9. If prefix is "xml" and namespace is not the XML namespace, then throw a "NamespaceError" DOMException. if (prefix == "xml"sv && namespace_ != Namespace::XML) return WebIDL::NamespaceError::create(realm, "Prefix is 'xml' and namespace is not the XML namespace."_string); - // 8. If either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace, then throw a "NamespaceError" DOMException. + // 10. If either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace, then throw a "NamespaceError" DOMException. if ((qualified_name == "xmlns"sv || prefix == "xmlns"sv) && namespace_ != Namespace::XMLNS) return WebIDL::NamespaceError::create(realm, "Either qualifiedName or prefix is 'xmlns' and namespace is not the XMLNS namespace."_string); - // 9. If namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns", then throw a "NamespaceError" DOMException. + // 11. If namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns", then throw a "NamespaceError" DOMException. if (namespace_ == Namespace::XMLNS && !(qualified_name == "xmlns"sv || prefix == "xmlns"sv)) return WebIDL::NamespaceError::create(realm, "Namespace is the XMLNS namespace and neither qualifiedName nor prefix is 'xmlns'."_string); - // 10. Return namespace, prefix, and localName. + // 12. Return (namespace, prefix, localName). return QualifiedName { local_name, prefix, namespace_ }; } // https://dom.spec.whatwg.org/#dom-element-setattributens WebIDL::ExceptionOr Element::set_attribute_ns(Optional const& namespace_, FlyString const& qualified_name, String const& value) { - // 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to validate and extract. - auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name)); + // 1. Let (namespace, prefix, localName) be the result of validating and extracting namespace and qualifiedName given "element". + auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name, ValidationContext::Element)); // 2. Set an attribute value for this using localName, value, and also prefix and namespace. set_attribute_value(extracted_qualified_name.local_name(), value, extracted_qualified_name.prefix(), extracted_qualified_name.namespace_()); diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index 5304bc79334..ad86a24274c 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -676,6 +676,14 @@ inline bool Element::has_pseudo_element(CSS::PseudoElement type) const return pseudo_element.value()->layout_node; } -WebIDL::ExceptionOr validate_and_extract(JS::Realm&, Optional namespace_, FlyString const& qualified_name); +bool is_valid_namespace_prefix(FlyString const&); +bool is_valid_attribute_local_name(FlyString const&); +bool is_valid_element_local_name(FlyString const&); + +enum class ValidationContext { + Attribute, + Element, +}; +WebIDL::ExceptionOr validate_and_extract(JS::Realm&, Optional namespace_, FlyString const& qualified_name, ValidationContext context); } diff --git a/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp b/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp index 07b20270cfd..d0e5b21e4d8 100644 --- a/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp +++ b/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp @@ -120,7 +120,7 @@ void XMLDocumentBuilder::element_start(const XML::Name& name, HashMaprealm(), namespace_, FlyString(MUST(String::from_byte_string(name)))); + auto qualified_name_or_error = DOM::validate_and_extract(m_document->realm(), namespace_, FlyString(MUST(String::from_byte_string(name))), DOM::ValidationContext::Element); if (qualified_name_or_error.is_error()) { m_has_error = true; diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/DOMImplementation-createDocument.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/DOMImplementation-createDocument.txt new file mode 100644 index 00000000000..2f0bd4e80bb --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/DOMImplementation-createDocument.txt @@ -0,0 +1,454 @@ +Harness status: OK + +Found 448 tests + +426 Pass +22 Fail +Pass DOMImplementation.createDocument(namespace, qualifiedName, doctype) +Pass createDocument test: null,null,null,null +Pass createDocument test: metadata for null,null,null +Pass createDocument test: characterSet aliases for null,null,null +Pass createDocument test: null,undefined,null,null +Pass createDocument test: metadata for null,undefined,null +Pass createDocument test: characterSet aliases for null,undefined,null +Pass createDocument test: null,"foo",null,null +Pass createDocument test: metadata for null,"foo",null +Pass createDocument test: characterSet aliases for null,"foo",null +Pass createDocument test: null,"1foo",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: null,"f1oo",null,null +Pass createDocument test: metadata for null,"f1oo",null +Pass createDocument test: characterSet aliases for null,"f1oo",null +Pass createDocument test: null,"foo1",null,null +Pass createDocument test: metadata for null,"foo1",null +Pass createDocument test: characterSet aliases for null,"foo1",null +Pass createDocument test: null,"ெfoo",null,null +Pass createDocument test: metadata for null,"ெfoo",null +Pass createDocument test: characterSet aliases for null,"ெfoo",null +Pass createDocument test: null,";foo",null,null +Pass createDocument test: metadata for null,";foo",null +Pass createDocument test: characterSet aliases for null,";foo",null +Pass createDocument test: null,"}foo",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: null,"f}oo",null,null +Pass createDocument test: metadata for null,"f}oo",null +Pass createDocument test: characterSet aliases for null,"f}oo",null +Pass createDocument test: null,"foo}",null,null +Pass createDocument test: metadata for null,"foo}",null +Pass createDocument test: characterSet aliases for null,"foo}",null +Pass createDocument test: null,"\ufffffoo",null,null +Pass createDocument test: metadata for null,"\ufffffoo",null +Pass createDocument test: characterSet aliases for null,"\ufffffoo",null +Pass createDocument test: null,"f\uffffoo",null,null +Pass createDocument test: metadata for null,"f\uffffoo",null +Pass createDocument test: characterSet aliases for null,"f\uffffoo",null +Pass createDocument test: null,"foo\uffff",null,null +Pass createDocument test: metadata for null,"foo\uffff",null +Pass createDocument test: characterSet aliases for null,"foo\uffff",null +Pass createDocument test: null,"",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: null,"",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: null,"f",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://example.com/","fo",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://example.com/","namespaceURI:,",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://example.com/","namespaceURI:a ",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://example.com/","namespaceURI:\"",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "/","foo",null,null +Pass createDocument test: metadata for "/","foo",null +Pass createDocument test: characterSet aliases for "/","foo",null +Pass createDocument test: "/","1foo",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "/","f1oo",null,null +Pass createDocument test: metadata for "/","f1oo",null +Pass createDocument test: characterSet aliases for "/","f1oo",null +Pass createDocument test: "/","foo1",null,null +Pass createDocument test: metadata for "/","foo1",null +Pass createDocument test: characterSet aliases for "/","foo1",null +Fail createDocument test: "/",":foo",null,null +Fail createDocument test: metadata for "/",":foo",null +Fail createDocument test: characterSet aliases for "/",":foo",null +Pass createDocument test: "/","f:oo",null,null +Pass createDocument test: metadata for "/","f:oo",null +Pass createDocument test: characterSet aliases for "/","f:oo",null +Pass createDocument test: "/","foo:",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "/","xml",null,null +Pass createDocument test: metadata for "/","xml",null +Pass createDocument test: characterSet aliases for "/","xml",null +Pass createDocument test: "/","xmlns",null,"NAMESPACE_ERR" +Pass createDocument test: "/","xmlfoo",null,null +Pass createDocument test: metadata for "/","xmlfoo",null +Pass createDocument test: characterSet aliases for "/","xmlfoo",null +Pass createDocument test: "/","xml:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "/","xmlns:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "/","xmlfoo:bar",null,null +Pass createDocument test: metadata for "/","xmlfoo:bar",null +Pass createDocument test: characterSet aliases for "/","xmlfoo:bar",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","foo",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","foo",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","foo",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","1foo",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","f1oo",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","f1oo",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","f1oo",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","foo1",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","foo1",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","foo1",null +Fail createDocument test: "http://www.w3.org/XML/1998/namespace",":foo",null,null +Fail createDocument test: metadata for "http://www.w3.org/XML/1998/namespace",":foo",null +Fail createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace",":foo",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","f:oo",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","f:oo",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","f:oo",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","foo:",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","xml",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","xml",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","xml",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","xmlns",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","xmlfoo",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","xmlfoo",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","xmlfoo",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","xml:foo",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","xml:foo",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","xml:foo",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","xmlns:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","xmlfoo:bar",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","xmlfoo:bar",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","xmlfoo:bar",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespaces","xml:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/xml/1998/namespace","xml:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","foo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","1foo",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","f1oo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","foo1",null,"NAMESPACE_ERR" +Fail createDocument test: "http://www.w3.org/2000/xmlns/",":foo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","f:oo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","foo:",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","xml",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","xmlns",null,null +Pass createDocument test: metadata for "http://www.w3.org/2000/xmlns/","xmlns",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/2000/xmlns/","xmlns",null +Pass createDocument test: "http://www.w3.org/2000/xmlns/","xmlfoo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","xml:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","xmlns:foo",null,null +Pass createDocument test: metadata for "http://www.w3.org/2000/xmlns/","xmlns:foo",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/2000/xmlns/","xmlns:foo",null +Pass createDocument test: "http://www.w3.org/2000/xmlns/","xmlfoo:bar",null,"NAMESPACE_ERR" +Pass createDocument test: "http://www.w3.org/2000/xmlns/","foo:xmlns",null,"NAMESPACE_ERR" +Pass createDocument test: "foo:","foo",null,null +Pass createDocument test: metadata for "foo:","foo",null +Pass createDocument test: characterSet aliases for "foo:","foo",null +Pass createDocument test: "foo:","1foo",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "foo:","f1oo",null,null +Pass createDocument test: metadata for "foo:","f1oo",null +Pass createDocument test: characterSet aliases for "foo:","f1oo",null +Pass createDocument test: "foo:","foo1",null,null +Pass createDocument test: metadata for "foo:","foo1",null +Pass createDocument test: characterSet aliases for "foo:","foo1",null +Fail createDocument test: "foo:",":foo",null,null +Fail createDocument test: metadata for "foo:",":foo",null +Fail createDocument test: characterSet aliases for "foo:",":foo",null +Pass createDocument test: "foo:","f:oo",null,null +Pass createDocument test: metadata for "foo:","f:oo",null +Pass createDocument test: characterSet aliases for "foo:","f:oo",null +Pass createDocument test: "foo:","foo:",null,"INVALID_CHARACTER_ERR" +Pass createDocument test: "foo:","xml",null,null +Pass createDocument test: metadata for "foo:","xml",null +Pass createDocument test: characterSet aliases for "foo:","xml",null +Pass createDocument test: "foo:","xmlns",null,"NAMESPACE_ERR" +Pass createDocument test: "foo:","xmlfoo",null,null +Pass createDocument test: metadata for "foo:","xmlfoo",null +Pass createDocument test: characterSet aliases for "foo:","xmlfoo",null +Pass createDocument test: "foo:","xml:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "foo:","xmlns:foo",null,"NAMESPACE_ERR" +Pass createDocument test: "foo:","xmlfoo:bar",null,null +Pass createDocument test: metadata for "foo:","xmlfoo:bar",null +Pass createDocument test: characterSet aliases for "foo:","xmlfoo:bar",null +Pass createDocument test: null,null,false,function "function TypeError() { [native code] }" +Pass createDocument test: null,"",null,null +Pass createDocument test: metadata for null,"",null +Pass createDocument test: characterSet aliases for null,"",null +Pass createDocument test: undefined,null,undefined,null +Pass createDocument test: metadata for undefined,null,undefined +Pass createDocument test: characterSet aliases for undefined,null,undefined +Pass createDocument test: undefined,undefined,undefined,null +Pass createDocument test: metadata for undefined,undefined,undefined +Pass createDocument test: characterSet aliases for undefined,undefined,undefined +Pass createDocument test: undefined,"",undefined,null +Pass createDocument test: metadata for undefined,"",undefined +Pass createDocument test: characterSet aliases for undefined,"",undefined +Pass createDocument test: "http://example.com/",null,null,null +Pass createDocument test: metadata for "http://example.com/",null,null +Pass createDocument test: characterSet aliases for "http://example.com/",null,null +Pass createDocument test: "http://example.com/","",null,null +Pass createDocument test: metadata for "http://example.com/","",null +Pass createDocument test: characterSet aliases for "http://example.com/","",null +Pass createDocument test: "/",null,null,null +Pass createDocument test: metadata for "/",null,null +Pass createDocument test: characterSet aliases for "/",null,null +Pass createDocument test: "/","",null,null +Pass createDocument test: metadata for "/","",null +Pass createDocument test: characterSet aliases for "/","",null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace",null,null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace",null,null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace",null,null +Pass createDocument test: "http://www.w3.org/XML/1998/namespace","",null,null +Pass createDocument test: metadata for "http://www.w3.org/XML/1998/namespace","",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/XML/1998/namespace","",null +Pass createDocument test: "http://www.w3.org/2000/xmlns/",null,null,null +Pass createDocument test: metadata for "http://www.w3.org/2000/xmlns/",null,null +Pass createDocument test: characterSet aliases for "http://www.w3.org/2000/xmlns/",null,null +Pass createDocument test: "http://www.w3.org/2000/xmlns/","",null,null +Pass createDocument test: metadata for "http://www.w3.org/2000/xmlns/","",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/2000/xmlns/","",null +Pass createDocument test: "foo:",null,null,null +Pass createDocument test: metadata for "foo:",null,null +Pass createDocument test: characterSet aliases for "foo:",null,null +Pass createDocument test: "foo:","",null,null +Pass createDocument test: metadata for "foo:","",null +Pass createDocument test: characterSet aliases for "foo:","",null +Pass createDocument test: null,null,DocumentType node ,null +Pass createDocument test: metadata for null,null,DocumentType node +Pass createDocument test: characterSet aliases for null,null,DocumentType node +Pass createDocument test: null,null,DocumentType node ,null +Pass createDocument test: metadata for null,null,DocumentType node +Pass createDocument test: characterSet aliases for null,null,DocumentType node +Pass createDocument test: null,null,DocumentType node ,null +Pass createDocument test: metadata for null,null,DocumentType node +Pass createDocument test: characterSet aliases for null,null,DocumentType node +Pass createDocument test: null,null,DocumentType node ,null +Pass createDocument test: metadata for null,null,DocumentType node +Pass createDocument test: characterSet aliases for null,null,DocumentType node +Pass createDocument test: null,null,DocumentType node ,null +Pass createDocument test: metadata for null,null,DocumentType node +Pass createDocument test: characterSet aliases for null,null,DocumentType node +Pass createDocument test: null,"foo",DocumentType node ,null +Pass createDocument test: metadata for null,"foo",DocumentType node +Pass createDocument test: characterSet aliases for null,"foo",DocumentType node +Pass createDocument test: "foo",null,DocumentType node ,null +Pass createDocument test: metadata for "foo",null,DocumentType node +Pass createDocument test: characterSet aliases for "foo",null,DocumentType node +Pass createDocument test: "foo","bar",DocumentType node ,null +Pass createDocument test: metadata for "foo","bar",DocumentType node +Pass createDocument test: characterSet aliases for "foo","bar",DocumentType node +Pass createDocument test: "http://www.w3.org/1999/xhtml","",null,null +Pass createDocument test: metadata for "http://www.w3.org/1999/xhtml","",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/1999/xhtml","",null +Pass createDocument test: "http://www.w3.org/2000/svg","",null,null +Pass createDocument test: metadata for "http://www.w3.org/2000/svg","",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/2000/svg","",null +Pass createDocument test: "http://www.w3.org/1998/Math/MathML","",null,null +Pass createDocument test: metadata for "http://www.w3.org/1998/Math/MathML","",null +Pass createDocument test: characterSet aliases for "http://www.w3.org/1998/Math/MathML","",null +Pass createDocument test: null,"html",null,null +Pass createDocument test: metadata for null,"html",null +Pass createDocument test: characterSet aliases for null,"html",null +Pass createDocument test: null,"svg",null,null +Pass createDocument test: metadata for null,"svg",null +Pass createDocument test: characterSet aliases for null,"svg",null +Pass createDocument test: null,"math",null,null +Pass createDocument test: metadata for null,"math",null +Pass createDocument test: characterSet aliases for null,"math",null +Pass createDocument test: null,"",DocumentType node +Pass createDocument test: null,"",DocumentType node +Pass createDocument test: null,"",DocumentType node +Pass createDocument with missing arguments \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Document-createElementNS.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Document-createElementNS.txt new file mode 100644 index 00000000000..3d3e28be03e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/dom/nodes/Document-createElementNS.txt @@ -0,0 +1,602 @@ +Harness status: OK + +Found 596 tests + +572 Pass +24 Fail +Pass createElementNS test in HTML document: null,null,null +Pass createElementNS test in XML document: null,null,null +Pass createElementNS test in XHTML document: null,null,null +Pass createElementNS test in HTML document: null,undefined,null +Pass createElementNS test in XML document: null,undefined,null +Pass createElementNS test in XHTML document: null,undefined,null +Pass createElementNS test in HTML document: null,"foo",null +Pass createElementNS test in XML document: null,"foo",null +Pass createElementNS test in XHTML document: null,"foo",null +Pass createElementNS test in HTML document: null,"1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: null,"1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: null,"1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: null,"f1oo",null +Pass createElementNS test in XML document: null,"f1oo",null +Pass createElementNS test in XHTML document: null,"f1oo",null +Pass createElementNS test in HTML document: null,"foo1",null +Pass createElementNS test in XML document: null,"foo1",null +Pass createElementNS test in XHTML document: null,"foo1",null +Pass createElementNS test in HTML document: null,"ெfoo",null +Pass createElementNS test in XML document: null,"ெfoo",null +Pass createElementNS test in XHTML document: null,"ெfoo",null +Pass createElementNS test in HTML document: null,";foo",null +Pass createElementNS test in XML document: null,";foo",null +Pass createElementNS test in XHTML document: null,";foo",null +Pass createElementNS test in HTML document: null,"}foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: null,"}foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: null,"}foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: null,"f}oo",null +Pass createElementNS test in XML document: null,"f}oo",null +Pass createElementNS test in XHTML document: null,"f}oo",null +Pass createElementNS test in HTML document: null,"foo}",null +Pass createElementNS test in XML document: null,"foo}",null +Pass createElementNS test in XHTML document: null,"foo}",null +Pass createElementNS test in HTML document: null,"\ufffffoo",null +Pass createElementNS test in XML document: null,"\ufffffoo",null +Pass createElementNS test in XHTML document: null,"\ufffffoo",null +Pass createElementNS test in HTML document: null,"f\uffffoo",null +Pass createElementNS test in XML document: null,"f\uffffoo",null +Pass createElementNS test in XHTML document: null,"f\uffffoo",null +Pass createElementNS test in HTML document: null,"foo\uffff",null +Pass createElementNS test in XML document: null,"foo\uffff",null +Pass createElementNS test in XHTML document: null,"foo\uffff",null +Pass createElementNS test in HTML document: null,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: null,"foo>","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: null,"foo>","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: null,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: null,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: null,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: null,"f","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://example.com/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://example.com/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://example.com/","fo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://example.com/","namespaceURI:>","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://example.com/","namespaceURI:>","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://example.com/","namespaceURI:,","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://example.com/","namespaceURI:,","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://example.com/","namespaceURI:,","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://example.com/","namespaceURI:a ","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://example.com/","namespaceURI:a ","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://example.com/","namespaceURI:a ","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://example.com/","namespaceURI:\"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://example.com/","namespaceURI:\"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://example.com/","namespaceURI:\"","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "/","foo",null +Pass createElementNS test in XML document: "/","foo",null +Pass createElementNS test in XHTML document: "/","foo",null +Pass createElementNS test in HTML document: "/","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "/","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "/","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "/","f1oo",null +Pass createElementNS test in XML document: "/","f1oo",null +Pass createElementNS test in XHTML document: "/","f1oo",null +Pass createElementNS test in HTML document: "/","foo1",null +Pass createElementNS test in XML document: "/","foo1",null +Pass createElementNS test in XHTML document: "/","foo1",null +Fail createElementNS test in HTML document: "/",":foo",null +Fail createElementNS test in XML document: "/",":foo",null +Fail createElementNS test in XHTML document: "/",":foo",null +Pass createElementNS test in HTML document: "/","f:oo",null +Pass createElementNS test in XML document: "/","f:oo",null +Pass createElementNS test in XHTML document: "/","f:oo",null +Pass createElementNS test in HTML document: "/","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "/","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "/","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "/","xml",null +Pass createElementNS test in XML document: "/","xml",null +Pass createElementNS test in XHTML document: "/","xml",null +Pass createElementNS test in HTML document: "/","xmlns","NAMESPACE_ERR" +Pass createElementNS test in XML document: "/","xmlns","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "/","xmlns","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "/","xmlfoo",null +Pass createElementNS test in XML document: "/","xmlfoo",null +Pass createElementNS test in XHTML document: "/","xmlfoo",null +Pass createElementNS test in HTML document: "/","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "/","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "/","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "/","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "/","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "/","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "/","xmlfoo:bar",null +Pass createElementNS test in XML document: "/","xmlfoo:bar",null +Pass createElementNS test in XHTML document: "/","xmlfoo:bar",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","foo",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","foo",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","foo",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","f1oo",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","f1oo",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","f1oo",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","foo1",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","foo1",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","foo1",null +Fail createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace",":foo",null +Fail createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace",":foo",null +Fail createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace",":foo",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","f:oo",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","f:oo",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","f:oo",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","xml",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","xml",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","xml",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","xmlns","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","xmlns","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","xmlns","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","xmlfoo",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","xmlfoo",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","xmlfoo",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","xml:foo",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","xml:foo",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","xml:foo",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","xmlfoo:bar",null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","xmlfoo:bar",null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","xmlfoo:bar",null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespaces","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespaces","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespaces","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/xml/1998/namespace","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/xml/1998/namespace","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/xml/1998/namespace","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","f1oo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","f1oo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","f1oo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","foo1","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","foo1","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","foo1","NAMESPACE_ERR" +Fail createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/",":foo","NAMESPACE_ERR" +Fail createElementNS test in XML document: "http://www.w3.org/2000/xmlns/",":foo","NAMESPACE_ERR" +Fail createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/",":foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","f:oo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","f:oo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","f:oo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","xml","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","xml","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","xml","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","xmlns",null +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","xmlns",null +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","xmlns",null +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","xmlfoo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","xmlfoo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","xmlfoo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","xmlns:foo",null +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","xmlns:foo",null +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","xmlns:foo",null +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","xmlfoo:bar","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","xmlfoo:bar","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","xmlfoo:bar","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","foo:xmlns","NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","foo:xmlns","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","foo:xmlns","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "foo:","foo",null +Pass createElementNS test in XML document: "foo:","foo",null +Pass createElementNS test in XHTML document: "foo:","foo",null +Pass createElementNS test in HTML document: "foo:","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "foo:","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "foo:","1foo","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "foo:","f1oo",null +Pass createElementNS test in XML document: "foo:","f1oo",null +Pass createElementNS test in XHTML document: "foo:","f1oo",null +Pass createElementNS test in HTML document: "foo:","foo1",null +Pass createElementNS test in XML document: "foo:","foo1",null +Pass createElementNS test in XHTML document: "foo:","foo1",null +Fail createElementNS test in HTML document: "foo:",":foo",null +Fail createElementNS test in XML document: "foo:",":foo",null +Fail createElementNS test in XHTML document: "foo:",":foo",null +Pass createElementNS test in HTML document: "foo:","f:oo",null +Pass createElementNS test in XML document: "foo:","f:oo",null +Pass createElementNS test in XHTML document: "foo:","f:oo",null +Pass createElementNS test in HTML document: "foo:","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "foo:","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "foo:","foo:","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "foo:","xml",null +Pass createElementNS test in XML document: "foo:","xml",null +Pass createElementNS test in XHTML document: "foo:","xml",null +Pass createElementNS test in HTML document: "foo:","xmlns","NAMESPACE_ERR" +Pass createElementNS test in XML document: "foo:","xmlns","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "foo:","xmlns","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "foo:","xmlfoo",null +Pass createElementNS test in XML document: "foo:","xmlfoo",null +Pass createElementNS test in XHTML document: "foo:","xmlfoo",null +Pass createElementNS test in HTML document: "foo:","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "foo:","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "foo:","xml:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "foo:","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in XML document: "foo:","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "foo:","xmlns:foo","NAMESPACE_ERR" +Pass createElementNS test in HTML document: "foo:","xmlfoo:bar",null +Pass createElementNS test in XML document: "foo:","xmlfoo:bar",null +Pass createElementNS test in XHTML document: "foo:","xmlfoo:bar",null +Pass createElementNS test in HTML document: "","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "","","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: null,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: null,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: null,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: undefined,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: undefined,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: undefined,"","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://example.com/",null,null +Pass createElementNS test in XML document: "http://example.com/",null,null +Pass createElementNS test in XHTML document: "http://example.com/",null,null +Pass createElementNS test in HTML document: "http://example.com/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://example.com/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://example.com/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "/",null,null +Pass createElementNS test in XML document: "/",null,null +Pass createElementNS test in XHTML document: "/",null,null +Pass createElementNS test in HTML document: "/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace",null,null +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace",null,null +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace",null,null +Pass createElementNS test in HTML document: "http://www.w3.org/XML/1998/namespace","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/XML/1998/namespace","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/XML/1998/namespace","","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/",null,"NAMESPACE_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/",null,"NAMESPACE_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/",null,"NAMESPACE_ERR" +Pass createElementNS test in HTML document: "http://www.w3.org/2000/xmlns/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "http://www.w3.org/2000/xmlns/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "http://www.w3.org/2000/xmlns/","","INVALID_CHARACTER_ERR" +Pass createElementNS test in HTML document: "foo:",null,null +Pass createElementNS test in XML document: "foo:",null,null +Pass createElementNS test in XHTML document: "foo:",null,null +Pass createElementNS test in HTML document: "foo:","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XML document: "foo:","","INVALID_CHARACTER_ERR" +Pass createElementNS test in XHTML document: "foo:","","INVALID_CHARACTER_ERR" +Pass Lower-case HTML element without a prefix +Pass Lower-case HTML element with a prefix +Pass Lower-case non-HTML element without a prefix +Pass Lower-case non-HTML element with a prefix +Pass Upper-case HTML element without a prefix +Pass Upper-case HTML element with a prefix +Pass Upper-case non-HTML element without a prefix +Pass Upper-case non-HTML element with a prefix +Pass null namespace +Pass undefined namespace +Pass empty string namespace \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/common/dummy.xhtml b/Tests/LibWeb/Text/input/wpt-import/common/dummy.xhtml new file mode 100644 index 00000000000..dba6945f4ba --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/common/dummy.xhtml @@ -0,0 +1,2 @@ + +Dummy XHTML document diff --git a/Tests/LibWeb/Text/input/wpt-import/common/dummy.xml b/Tests/LibWeb/Text/input/wpt-import/common/dummy.xml new file mode 100644 index 00000000000..4a60c3035fc --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/common/dummy.xml @@ -0,0 +1 @@ +Dummy XML document diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/DOMImplementation-createDocument.html b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/DOMImplementation-createDocument.html new file mode 100644 index 00000000000..688ce597259 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/DOMImplementation-createDocument.html @@ -0,0 +1,172 @@ + + +DOMImplementation.createDocument(namespace, qualifiedName, doctype) + + + + + + + + +
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createElementNS.html b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createElementNS.html new file mode 100644 index 00000000000..b4e601c8a8f --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createElementNS.html @@ -0,0 +1,227 @@ + + +Document.createElementNS + + + + +
+ + + diff --git a/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createElementNS.js b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createElementNS.js new file mode 100644 index 00000000000..d2e2f78e77e --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/dom/nodes/Document-createElementNS.js @@ -0,0 +1,189 @@ +var createElementNS_tests = [ + /* Arrays with three elements: + * the namespace argument + * the qualifiedName argument + * the expected exception, or null if none + */ + [null, null, null], + [null, undefined, null], + [null, "foo", null], + [null, "1foo", "INVALID_CHARACTER_ERR"], + [null, "f1oo", null], + [null, "foo1", null], + [null, "\u0BC6foo", null], + [null, "\u037Efoo", null], + [null, "}foo", "INVALID_CHARACTER_ERR"], + [null, "f}oo", null], + [null, "foo}", null], + [null, "\uFFFFfoo", null], + [null, "f\uFFFFoo", null], + [null, "foo\uFFFF", null], + [null, "", "INVALID_CHARACTER_ERR"], + [null, "", "INVALID_CHARACTER_ERR"], + [null, "f", "INVALID_CHARACTER_ERR"], + ["http://example.com/", "fo", "INVALID_CHARACTER_ERR"], + ["http://example.com/", "namespaceURI:,", "INVALID_CHARACTER_ERR"], + ["http://example.com/", "namespaceURI:a ", "INVALID_CHARACTER_ERR"], + ["http://example.com/", "namespaceURI:\"", "INVALID_CHARACTER_ERR"], + ["/", "foo", null], + ["/", "1foo", "INVALID_CHARACTER_ERR"], + ["/", "f1oo", null], + ["/", "foo1", null], + ["/", ":foo", null], + ["/", "f:oo", null], + ["/", "foo:", "INVALID_CHARACTER_ERR"], + ["/", "xml", null], + ["/", "xmlns", "NAMESPACE_ERR"], + ["/", "xmlfoo", null], + ["/", "xml:foo", "NAMESPACE_ERR"], + ["/", "xmlns:foo", "NAMESPACE_ERR"], + ["/", "xmlfoo:bar", null], + ["http://www.w3.org/XML/1998/namespace", "foo", null], + ["http://www.w3.org/XML/1998/namespace", "1foo", "INVALID_CHARACTER_ERR"], + ["http://www.w3.org/XML/1998/namespace", "f1oo", null], + ["http://www.w3.org/XML/1998/namespace", "foo1", null], + ["http://www.w3.org/XML/1998/namespace", ":foo", null], + ["http://www.w3.org/XML/1998/namespace", "f:oo", null], + ["http://www.w3.org/XML/1998/namespace", "foo:", "INVALID_CHARACTER_ERR"], + ["http://www.w3.org/XML/1998/namespace", "xml", null], + ["http://www.w3.org/XML/1998/namespace", "xmlns", "NAMESPACE_ERR"], + ["http://www.w3.org/XML/1998/namespace", "xmlfoo", null], + ["http://www.w3.org/XML/1998/namespace", "xml:foo", null], + ["http://www.w3.org/XML/1998/namespace", "xmlns:foo", "NAMESPACE_ERR"], + ["http://www.w3.org/XML/1998/namespace", "xmlfoo:bar", null], + ["http://www.w3.org/XML/1998/namespaces", "xml:foo", "NAMESPACE_ERR"], + ["http://www.w3.org/xml/1998/namespace", "xml:foo", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "foo", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "1foo", "INVALID_CHARACTER_ERR"], + ["http://www.w3.org/2000/xmlns/", "f1oo", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "foo1", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", ":foo", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "f:oo", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "foo:", "INVALID_CHARACTER_ERR"], + ["http://www.w3.org/2000/xmlns/", "xml", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "xmlns", null], + ["http://www.w3.org/2000/xmlns/", "xmlfoo", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "xml:foo", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "xmlns:foo", null], + ["http://www.w3.org/2000/xmlns/", "xmlfoo:bar", "NAMESPACE_ERR"], + ["http://www.w3.org/2000/xmlns/", "foo:xmlns", "NAMESPACE_ERR"], + ["foo:", "foo", null], + ["foo:", "1foo", "INVALID_CHARACTER_ERR"], + ["foo:", "f1oo", null], + ["foo:", "foo1", null], + ["foo:", ":foo", null], + ["foo:", "f:oo", null], + ["foo:", "foo:", "INVALID_CHARACTER_ERR"], + ["foo:", "xml", null], + ["foo:", "xmlns", "NAMESPACE_ERR"], + ["foo:", "xmlfoo", null], + ["foo:", "xml:foo", "NAMESPACE_ERR"], + ["foo:", "xmlns:foo", "NAMESPACE_ERR"], + ["foo:", "xmlfoo:bar", null], +]