From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- testing/web-platform/tests/dom/OWNERS | 6 + .../HTMLCollection-as-proto-length-get-throws.html | 13 + .../dom/collections/HTMLCollection-empty-name.html | 65 ++ .../HTMLCollection-supported-property-indices.html | 179 ++++ .../HTMLCollection-supported-property-names.html | 135 +++ .../domstringmap-supported-property-names.html | 54 + .../namednodemap-supported-property-names.html | 30 + testing/web-platform/tests/dom/common.js | 1083 ++++++++++++++++++++ testing/web-platform/tests/dom/constants.js | 11 + .../dom/events/AddEventListenerOptions-once.html | 81 ++ .../events/AddEventListenerOptions-passive.html | 113 ++ .../web-platform/tests/dom/events/CustomEvent.html | 19 + .../tests/dom/events/Event-constants.html | 23 + .../tests/dom/events/Event-constructors.html | 115 +++ .../Event-defaultPrevented-after-dispatch.html | 26 + .../tests/dom/events/Event-defaultPrevented.html | 42 + .../dom/events/Event-dispatch-bubbles-false.html | 98 ++ .../dom/events/Event-dispatch-bubbles-true.html | 108 ++ .../dom/events/Event-dispatch-detached-click.html | 19 + .../events/Event-dispatch-handlers-changed.html | 92 ++ .../Event-dispatch-multiple-stopPropagation.html | 51 + .../dom/events/Event-dispatch-omitted-capture.html | 70 ++ .../tests/dom/events/Event-dispatch-order.html | 26 + .../dom/events/Event-dispatch-other-document.html | 22 + .../events/Event-dispatch-propagation-stopped.html | 59 ++ .../dom/events/Event-dispatch-redispatch.html | 28 + .../tests/dom/events/Event-dispatch-reenter.html | 66 ++ .../dom/events/Event-dispatch-target-moved.html | 73 ++ .../dom/events/Event-dispatch-target-removed.html | 72 ++ .../tests/dom/events/Event-dispatch-throwing.html | 51 + .../dom/events/Event-init-while-dispatching.html | 83 ++ .../tests/dom/events/Event-initEvent.html | 118 +++ .../tests/dom/events/Event-propagation.html | 41 + .../dom/events/Event-subclasses-constructors.html | 153 +++ .../tests/dom/events/Event-type-empty.html | 35 + .../web-platform/tests/dom/events/Event-type.html | 22 + .../dom/events/EventListener-handleEvent.html | 41 + .../EventListener-incumbent-global-1.sub.html | 20 + .../EventListener-incumbent-global-2.sub.html | 20 + ...ntListener-incumbent-global-subframe-1.sub.html | 13 + ...ntListener-incumbent-global-subframe-2.sub.html | 13 + ...tListener-incumbent-global-subsubframe.sub.html | 20 + .../dom/events/EventListenerOptions-capture.html | 98 ++ .../dom/events/EventTarget-addEventListener.html | 16 + .../EventTarget-dispatchEvent-returnvalue.html | 43 + .../dom/events/EventTarget-dispatchEvent.html | 104 ++ .../events/EventTarget-removeEventListener.html | 16 + .../tests/dom/events/ProgressEvent.html | 25 + testing/web-platform/tests/dom/historical.html | 132 +++ .../web-platform/tests/dom/interface-objects.html | 44 + testing/web-platform/tests/dom/interfaces.html | 598 +++++++++++ .../tests/dom/lists/DOMTokenList-Iterable.html | 34 + .../DOMTokenList-coverage-for-attributes.html | 51 + .../tests/dom/lists/DOMTokenList-iteration.html | 50 + .../tests/dom/lists/DOMTokenList-stringifier.html | 25 + .../tests/dom/lists/DOMTokenList-value.html | 24 + .../tests/dom/nodes/CharacterData-appendChild.html | 34 + .../tests/dom/nodes/CharacterData-appendData.html | 70 ++ .../tests/dom/nodes/CharacterData-data.html | 82 ++ .../tests/dom/nodes/CharacterData-deleteData.html | 95 ++ .../tests/dom/nodes/CharacterData-insertData.html | 90 ++ .../tests/dom/nodes/CharacterData-remove.html | 24 + .../tests/dom/nodes/CharacterData-replaceData.html | 163 +++ .../dom/nodes/CharacterData-substringData.html | 137 +++ .../tests/dom/nodes/CharacterData-surrogates.html | 74 ++ .../tests/dom/nodes/ChildNode-after.html | 166 +++ .../tests/dom/nodes/ChildNode-before.html | 166 +++ .../tests/dom/nodes/ChildNode-remove.js | 30 + .../tests/dom/nodes/ChildNode-replaceWith.html | 110 ++ .../tests/dom/nodes/Comment-Text-constructor.js | 77 ++ .../tests/dom/nodes/Comment-constructor.html | 11 + .../nodes/DOMImplementation-createDocument.html | 166 +++ .../DOMImplementation-createDocumentType.html | 123 +++ .../DOMImplementation-createHTMLDocument.html | 90 ++ .../nodes/DOMImplementation-createHTMLDocument.js | 25 + .../dom/nodes/DOMImplementation-hasFeature.html | 155 +++ .../nodes/Document-Element-getElementsByTagName.js | 193 ++++ .../Document-Element-getElementsByTagNameNS.js | 128 +++ .../tests/dom/nodes/Document-URL.sub.html | 18 + .../tests/dom/nodes/Document-adoptNode.html | 50 + .../nodes/Document-characterSet-normalization.html | 373 +++++++ .../tests/dom/nodes/Document-constructor.html | 53 + .../contentType/contenttype_bmp.html | 15 + .../contentType/contenttype_css.html | 15 + .../contentType/contenttype_datauri_01.html | 15 + .../contentType/contenttype_datauri_02.html | 15 + .../contentType/contenttype_gif.html | 15 + .../contentType/contenttype_html.html | 15 + .../contentType/contenttype_javascripturi.html | 16 + .../contentType/contenttype_jpg.html | 15 + .../contentType/contenttype_mimeheader_01.html | 15 + .../contentType/contenttype_mimeheader_02.html | 15 + .../contentType/contenttype_png.html | 15 + .../contentType/contenttype_txt.html | 15 + .../contentType/contenttype_xml.html | 15 + .../contentType/createDocument.html | 11 + .../contentType/createHTMLDocument.html | 11 + .../contentType/xhr_responseType_document.html | 18 + .../nodes/Document-contentType/resources/blob.htm | 1 + .../nodes/Document-contentType/resources/blob.txt | 1 + .../nodes/Document-contentType/resources/blob.xml | 2 + .../nodes/Document-contentType/resources/lib.js | 1 + .../nodes/Document-contentType/resources/style.css | 12 + .../dom/nodes/Document-contentType/resources/t.bmp | Bin 0 -> 30054 bytes .../dom/nodes/Document-contentType/resources/t.gif | Bin 0 -> 148 bytes .../dom/nodes/Document-contentType/resources/t.jpg | Bin 0 -> 361 bytes .../dom/nodes/Document-contentType/resources/t.png | Bin 0 -> 228 bytes .../support/contenttype_setter.py | 20 + .../tests/dom/nodes/Document-createAttribute.html | 43 + .../nodes/Document-createComment-createTextNode.js | 22 + .../tests/dom/nodes/Document-createComment.html | 21 + .../bare_mathml.html | 1 + .../bare_mathml.svg | 1 + .../bare_mathml.xhtml | 1 + .../bare_mathml.xml | 1 + .../bare_svg.html | 1 + .../bare_svg.svg | 1 + .../bare_svg.xhtml | 1 + .../bare_svg.xml | 1 + .../bare_xhtml.html | 1 + .../bare_xhtml.svg | 1 + .../bare_xhtml.xhtml | 1 + .../bare_xhtml.xml | 1 + .../empty.html | 0 .../empty.svg | 0 .../empty.xhtml | 0 .../empty.xml | 0 .../generate.py | 77 ++ .../mathml.html | 1 + .../mathml.svg | 1 + .../mathml.xhtml | 1 + .../mathml.xml | 1 + .../minimal_html.html | 1 + .../minimal_html.svg | 1 + .../minimal_html.xhtml | 1 + .../minimal_html.xml | 1 + .../svg.html | 1 + .../Document-createElement-namespace-tests/svg.svg | 1 + .../svg.xhtml | 1 + .../Document-createElement-namespace-tests/svg.xml | 1 + .../xhtml.html | 1 + .../xhtml.svg | 1 + .../xhtml.xhtml | 1 + .../xhtml.xml | 1 + .../xhtml_ns_changed.html | 7 + .../xhtml_ns_changed.svg | 7 + .../xhtml_ns_changed.xhtml | 7 + .../xhtml_ns_changed.xml | 7 + .../xhtml_ns_removed.html | 7 + .../xhtml_ns_removed.svg | 7 + .../xhtml_ns_removed.xhtml | 7 + .../xhtml_ns_removed.xml | 7 + .../nodes/Document-createElement-namespace.html | 119 +++ .../tests/dom/nodes/Document-createElement.html | 157 +++ .../tests/dom/nodes/Document-createElementNS.html | 226 ++++ .../tests/dom/nodes/Document-createElementNS.js | 185 ++++ .../tests/dom/nodes/Document-createEvent.html | 154 +++ .../tests/dom/nodes/Document-createEvent.js | 36 + ...ocument-createProcessingInstruction-xhtml.xhtml | 15 + .../Document-createProcessingInstruction.html | 11 + .../nodes/Document-createProcessingInstruction.js | 39 + .../tests/dom/nodes/Document-createTextNode.html | 21 + .../tests/dom/nodes/Document-createTreeWalker.html | 42 + .../tests/dom/nodes/Document-doctype.html | 21 + .../tests/dom/nodes/Document-getElementById.html | 350 +++++++ .../Document-getElementsByTagName-xhtml.xhtml | 104 ++ .../dom/nodes/Document-getElementsByTagName.html | 11 + .../dom/nodes/Document-getElementsByTagNameNS.html | 11 + .../tests/dom/nodes/Document-implementation.html | 20 + .../tests/dom/nodes/Document-importNode.html | 57 ++ .../dom/nodes/DocumentType-literal-xhtml.xhtml | 23 + .../tests/dom/nodes/DocumentType-literal.html | 17 + .../tests/dom/nodes/DocumentType-remove.html | 16 + .../dom/nodes/Element-childElement-null-svg.svg | 20 + .../nodes/Element-childElement-null-xhtml.xhtml | 20 + .../tests/dom/nodes/Element-childElement-null.html | 15 + .../Element-childElementCount-dynamic-add-svg.svg | 22 + ...ement-childElementCount-dynamic-add-xhtml.xhtml | 22 + .../Element-childElementCount-dynamic-add.html | 17 + ...lement-childElementCount-dynamic-remove-svg.svg | 22 + ...nt-childElementCount-dynamic-remove-xhtml.xhtml | 22 + .../Element-childElementCount-dynamic-remove.html | 17 + .../Element-childElementCount-nochild-svg.svg | 19 + .../Element-childElementCount-nochild-xhtml.xhtml | 19 + .../nodes/Element-childElementCount-nochild.html | 14 + .../dom/nodes/Element-childElementCount-svg.svg | 25 + .../nodes/Element-childElementCount-xhtml.xhtml | 25 + .../tests/dom/nodes/Element-childElementCount.html | 20 + .../tests/dom/nodes/Element-children.html | 58 ++ .../tests/dom/nodes/Element-classlist.html | 407 ++++++++ .../tests/dom/nodes/Element-closest.html | 73 ++ .../Element-firstElementChild-entity-xhtml.xhtml | 27 + .../dom/nodes/Element-firstElementChild-entity.svg | 26 + .../Element-firstElementChild-namespace-svg.svg | 26 + ...Element-firstElementChild-namespace-xhtml.xhtml | 28 + .../nodes/Element-firstElementChild-namespace.html | 21 + .../dom/nodes/Element-firstElementChild-svg.svg | 23 + .../nodes/Element-firstElementChild-xhtml.xhtml | 23 + .../tests/dom/nodes/Element-firstElementChild.html | 18 + .../dom/nodes/Element-getElementsByClassName.html | 21 + ...tsByTagName-change-document-HTMLNess-iframe.xml | 1 + ...ElementsByTagName-change-document-HTMLNess.html | 50 + .../dom/nodes/Element-getElementsByTagName.html | 30 + .../dom/nodes/Element-getElementsByTagNameNS.html | 37 + .../tests/dom/nodes/Element-hasAttributes.html | 40 + .../dom/nodes/Element-insertAdjacentElement.html | 91 ++ .../dom/nodes/Element-insertAdjacentText.html | 76 ++ .../dom/nodes/Element-lastElementChild-svg.svg | 22 + .../dom/nodes/Element-lastElementChild-xhtml.xhtml | 22 + .../tests/dom/nodes/Element-lastElementChild.html | 17 + .../tests/dom/nodes/Element-matches.html | 87 ++ .../tests/dom/nodes/Element-matches.js | 127 +++ .../dom/nodes/Element-nextElementSibling-svg.svg | 23 + .../nodes/Element-nextElementSibling-xhtml.xhtml | 23 + .../dom/nodes/Element-nextElementSibling.html | 18 + .../nodes/Element-previousElementSibling-svg.svg | 28 + .../Element-previousElementSibling-xhtml.xhtml | 28 + .../dom/nodes/Element-previousElementSibling.html | 23 + .../tests/dom/nodes/Element-remove.html | 16 + .../tests/dom/nodes/Element-removeAttributeNS.html | 18 + .../dom/nodes/Element-siblingElement-null-svg.svg | 20 + .../nodes/Element-siblingElement-null-xhtml.xhtml | 20 + .../dom/nodes/Element-siblingElement-null.html | 16 + .../tests/dom/nodes/Element-tagName.html | 50 + .../dom/nodes/MutationObserver-attributes.html | 406 ++++++++ .../dom/nodes/MutationObserver-characterData.html | 215 ++++ .../dom/nodes/MutationObserver-childList.html | 434 ++++++++ .../dom/nodes/MutationObserver-disconnect.html | 48 + .../tests/dom/nodes/MutationObserver-document.html | 167 +++ .../dom/nodes/MutationObserver-inner-outer.html | 65 ++ .../dom/nodes/MutationObserver-takeRecords.html | 53 + .../tests/dom/nodes/Node-appendChild.html | 59 ++ .../web-platform/tests/dom/nodes/Node-baseURI.html | 32 + .../tests/dom/nodes/Node-childNodes.html | 99 ++ .../tests/dom/nodes/Node-cloneNode.html | 272 +++++ .../dom/nodes/Node-compareDocumentPosition.html | 87 ++ .../tests/dom/nodes/Node-constants.html | 39 + .../tests/dom/nodes/Node-contains-xml.xml | 83 ++ .../tests/dom/nodes/Node-contains.html | 36 + .../tests/dom/nodes/Node-insertBefore.html | 306 ++++++ .../tests/dom/nodes/Node-isConnected.html | 95 ++ .../tests/dom/nodes/Node-isEqualNode-iframe1.xml | 1 + .../tests/dom/nodes/Node-isEqualNode-iframe2.xml | 1 + .../tests/dom/nodes/Node-isEqualNode-xhtml.xhtml | 84 ++ .../tests/dom/nodes/Node-isEqualNode.html | 161 +++ .../tests/dom/nodes/Node-isSameNode.html | 100 ++ .../tests/dom/nodes/Node-lookupNamespaceURI.html | 116 +++ .../tests/dom/nodes/Node-lookupPrefix.xhtml | 31 + .../tests/dom/nodes/Node-nodeName-xhtml.xhtml | 42 + .../tests/dom/nodes/Node-nodeName.html | 32 + .../tests/dom/nodes/Node-nodeValue.html | 71 ++ .../tests/dom/nodes/Node-normalize.html | 54 + .../tests/dom/nodes/Node-parentElement.html | 82 ++ .../tests/dom/nodes/Node-parentNode-iframe.html | 1 + .../tests/dom/nodes/Node-parentNode.html | 33 + .../tests/dom/nodes/Node-properties.html | 688 +++++++++++++ .../tests/dom/nodes/Node-removeChild.html | 54 + .../tests/dom/nodes/Node-replaceChild.html | 345 +++++++ .../tests/dom/nodes/Node-textContent.html | 265 +++++ .../tests/dom/nodes/NodeList-Iterable.html | 37 + .../tests/dom/nodes/ParentNode-append.html | 66 ++ .../tests/dom/nodes/ParentNode-prepend.html | 66 ++ .../ParentNode-querySelector-All-content.html | 377 +++++++ .../nodes/ParentNode-querySelector-All-content.xht | 372 +++++++ .../dom/nodes/ParentNode-querySelector-All-xht.xht | 114 +++ .../dom/nodes/ParentNode-querySelector-All.html | 110 ++ .../dom/nodes/ParentNode-querySelector-All.js | 252 +++++ .../nodes/ProcessingInstruction-escapes-1.xhtml | 33 + .../nodes/ProcessingInstruction-literal-1.xhtml | 16 + .../nodes/ProcessingInstruction-literal-2.xhtml | 21 + .../tests/dom/nodes/Text-constructor.html | 11 + .../tests/dom/nodes/Text-splitText.html | 53 + .../tests/dom/nodes/append-on-Document.html | 53 + .../web-platform/tests/dom/nodes/attributes.html | 712 +++++++++++++ testing/web-platform/tests/dom/nodes/attributes.js | 18 + testing/web-platform/tests/dom/nodes/case.html | 18 + testing/web-platform/tests/dom/nodes/case.js | 186 ++++ testing/web-platform/tests/dom/nodes/creators.js | 5 + testing/web-platform/tests/dom/nodes/encoding.py | 5 + .../tests/dom/nodes/getElementsByClassName-01.htm | 13 + .../tests/dom/nodes/getElementsByClassName-02.htm | 14 + .../tests/dom/nodes/getElementsByClassName-03.htm | 18 + .../tests/dom/nodes/getElementsByClassName-04.htm | 18 + .../tests/dom/nodes/getElementsByClassName-05.htm | 18 + .../tests/dom/nodes/getElementsByClassName-06.htm | 20 + .../tests/dom/nodes/getElementsByClassName-07.htm | 15 + .../tests/dom/nodes/getElementsByClassName-08.htm | 15 + .../tests/dom/nodes/getElementsByClassName-09.htm | 15 + .../tests/dom/nodes/getElementsByClassName-10.xml | 19 + .../tests/dom/nodes/getElementsByClassName-11.xml | 24 + .../tests/dom/nodes/getElementsByClassName-12.htm | 15 + .../tests/dom/nodes/getElementsByClassName-13.htm | 19 + .../tests/dom/nodes/getElementsByClassName-14.htm | 16 + .../tests/dom/nodes/getElementsByClassName-15.htm | 18 + .../tests/dom/nodes/getElementsByClassName-16.htm | 16 + .../tests/dom/nodes/getElementsByClassName-17.htm | 15 + .../tests/dom/nodes/getElementsByClassName-18.htm | 17 + .../tests/dom/nodes/getElementsByClassName-19.htm | 54 + .../tests/dom/nodes/getElementsByClassName-20.htm | 61 ++ .../tests/dom/nodes/getElementsByClassName-21.htm | 52 + .../tests/dom/nodes/getElementsByClassName-22.htm | 58 ++ .../tests/dom/nodes/getElementsByClassName-23.htm | 52 + .../tests/dom/nodes/getElementsByClassName-24.htm | 30 + .../tests/dom/nodes/getElementsByClassName-25.htm | 57 ++ .../tests/dom/nodes/getElementsByClassName-26.htm | 30 + .../tests/dom/nodes/getElementsByClassName-27.htm | 32 + .../tests/dom/nodes/getElementsByClassName-28.htm | 31 + .../tests/dom/nodes/getElementsByClassName-29.htm | 51 + .../tests/dom/nodes/getElementsByClassName-30.htm | 190 ++++ .../tests/dom/nodes/getElementsByClassName-31.htm | 22 + .../dom/nodes/getElementsByClassNameFrame.htm | 6 + .../tests/dom/nodes/insert-adjacent.html | 79 ++ .../tests/dom/nodes/mutationobservers.js | 76 ++ .../tests/dom/nodes/prepend-on-Document.html | 53 + .../web-platform/tests/dom/nodes/productions.js | 3 + .../tests/dom/nodes/remove-unscopable.html | 32 + testing/web-platform/tests/dom/nodes/rootNode.html | 82 ++ testing/web-platform/tests/dom/nodes/selectors.js | 734 +++++++++++++ .../tests/dom/ranges/Range-attributes.html | 23 + .../tests/dom/ranges/Range-cloneContents.html | 457 +++++++++ .../tests/dom/ranges/Range-cloneRange.html | 112 ++ .../tests/dom/ranges/Range-collapse.html | 75 ++ .../ranges/Range-commonAncestorContainer-2.html | 33 + .../dom/ranges/Range-commonAncestorContainer.html | 40 + .../dom/ranges/Range-compareBoundaryPoints.html | 182 ++++ .../tests/dom/ranges/Range-comparePoint-2.html | 23 + .../tests/dom/ranges/Range-comparePoint.html | 92 ++ .../tests/dom/ranges/Range-constructor.html | 20 + .../tests/dom/ranges/Range-deleteContents.html | 337 ++++++ .../tests/dom/ranges/Range-detach.html | 14 + .../tests/dom/ranges/Range-extractContents.html | 248 +++++ .../tests/dom/ranges/Range-insertNode.html | 286 ++++++ .../dom/ranges/Range-intersectsNode-binding.html | 25 + .../tests/dom/ranges/Range-intersectsNode.html | 70 ++ .../tests/dom/ranges/Range-isPointInRange.html | 83 ++ .../tests/dom/ranges/Range-mutations.html | 950 +++++++++++++++++ .../tests/dom/ranges/Range-selectNode.html | 99 ++ .../web-platform/tests/dom/ranges/Range-set.html | 221 ++++ .../tests/dom/ranges/Range-stringifier.html | 44 + .../tests/dom/ranges/Range-surroundContents.html | 324 ++++++ .../tests/dom/ranges/Range-test-iframe.html | 56 + .../tests/dom/traversal/NodeFilter-constants.html | 34 + .../tests/dom/traversal/NodeIterator-removal.html | 100 ++ .../tests/dom/traversal/NodeIterator.html | 202 ++++ .../traversal/TreeWalker-acceptNode-filter.html | 155 +++ .../tests/dom/traversal/TreeWalker-basic.html | 154 +++ .../dom/traversal/TreeWalker-currentNode.html | 73 ++ .../TreeWalker-previousNodeLastChildReject.html | 87 ++ .../TreeWalker-previousSiblingLastChildSkip.html | 91 ++ .../dom/traversal/TreeWalker-traversal-reject.html | 109 ++ .../traversal/TreeWalker-traversal-skip-most.html | 66 ++ .../dom/traversal/TreeWalker-traversal-skip.html | 111 ++ .../TreeWalker-walking-outside-a-tree.html | 40 + .../tests/dom/traversal/TreeWalker.html | 298 ++++++ .../tests/dom/traversal/traversal-support.js | 10 + .../tests/dom/traversal/unfinished/001.xml | 53 + .../tests/dom/traversal/unfinished/002.xml | 54 + .../tests/dom/traversal/unfinished/003.xml | 58 ++ .../tests/dom/traversal/unfinished/004.xml | 49 + .../tests/dom/traversal/unfinished/005.xml | 57 ++ .../tests/dom/traversal/unfinished/006.xml | 47 + .../tests/dom/traversal/unfinished/007.xml | 54 + .../tests/dom/traversal/unfinished/008.xml | 48 + .../tests/dom/traversal/unfinished/009.xml | 55 + .../tests/dom/traversal/unfinished/010.xml | 64 ++ .../tests/dom/traversal/unfinished/TODO | 1 + 366 files changed, 26616 insertions(+) create mode 100644 testing/web-platform/tests/dom/OWNERS create mode 100644 testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html create mode 100644 testing/web-platform/tests/dom/collections/HTMLCollection-empty-name.html create mode 100644 testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-indices.html create mode 100644 testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-names.html create mode 100644 testing/web-platform/tests/dom/collections/domstringmap-supported-property-names.html create mode 100644 testing/web-platform/tests/dom/collections/namednodemap-supported-property-names.html create mode 100644 testing/web-platform/tests/dom/common.js create mode 100644 testing/web-platform/tests/dom/constants.js create mode 100644 testing/web-platform/tests/dom/events/AddEventListenerOptions-once.html create mode 100644 testing/web-platform/tests/dom/events/AddEventListenerOptions-passive.html create mode 100644 testing/web-platform/tests/dom/events/CustomEvent.html create mode 100644 testing/web-platform/tests/dom/events/Event-constants.html create mode 100644 testing/web-platform/tests/dom/events/Event-constructors.html create mode 100644 testing/web-platform/tests/dom/events/Event-defaultPrevented-after-dispatch.html create mode 100644 testing/web-platform/tests/dom/events/Event-defaultPrevented.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-bubbles-false.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-bubbles-true.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-detached-click.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-multiple-stopPropagation.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-order.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-other-document.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-propagation-stopped.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-redispatch.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-reenter.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-target-moved.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-target-removed.html create mode 100644 testing/web-platform/tests/dom/events/Event-dispatch-throwing.html create mode 100644 testing/web-platform/tests/dom/events/Event-init-while-dispatching.html create mode 100644 testing/web-platform/tests/dom/events/Event-initEvent.html create mode 100644 testing/web-platform/tests/dom/events/Event-propagation.html create mode 100644 testing/web-platform/tests/dom/events/Event-subclasses-constructors.html create mode 100644 testing/web-platform/tests/dom/events/Event-type-empty.html create mode 100644 testing/web-platform/tests/dom/events/Event-type.html create mode 100644 testing/web-platform/tests/dom/events/EventListener-handleEvent.html create mode 100644 testing/web-platform/tests/dom/events/EventListener-incumbent-global-1.sub.html create mode 100644 testing/web-platform/tests/dom/events/EventListener-incumbent-global-2.sub.html create mode 100644 testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html create mode 100644 testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html create mode 100644 testing/web-platform/tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html create mode 100644 testing/web-platform/tests/dom/events/EventListenerOptions-capture.html create mode 100644 testing/web-platform/tests/dom/events/EventTarget-addEventListener.html create mode 100644 testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html create mode 100644 testing/web-platform/tests/dom/events/EventTarget-dispatchEvent.html create mode 100644 testing/web-platform/tests/dom/events/EventTarget-removeEventListener.html create mode 100644 testing/web-platform/tests/dom/events/ProgressEvent.html create mode 100644 testing/web-platform/tests/dom/historical.html create mode 100644 testing/web-platform/tests/dom/interface-objects.html create mode 100644 testing/web-platform/tests/dom/interfaces.html create mode 100644 testing/web-platform/tests/dom/lists/DOMTokenList-Iterable.html create mode 100644 testing/web-platform/tests/dom/lists/DOMTokenList-coverage-for-attributes.html create mode 100644 testing/web-platform/tests/dom/lists/DOMTokenList-iteration.html create mode 100644 testing/web-platform/tests/dom/lists/DOMTokenList-stringifier.html create mode 100644 testing/web-platform/tests/dom/lists/DOMTokenList-value.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-appendChild.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-appendData.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-data.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-deleteData.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-insertData.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-remove.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-replaceData.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-substringData.html create mode 100644 testing/web-platform/tests/dom/nodes/CharacterData-surrogates.html create mode 100644 testing/web-platform/tests/dom/nodes/ChildNode-after.html create mode 100644 testing/web-platform/tests/dom/nodes/ChildNode-before.html create mode 100644 testing/web-platform/tests/dom/nodes/ChildNode-remove.js create mode 100644 testing/web-platform/tests/dom/nodes/ChildNode-replaceWith.html create mode 100644 testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js create mode 100644 testing/web-platform/tests/dom/nodes/Comment-constructor.html create mode 100644 testing/web-platform/tests/dom/nodes/DOMImplementation-createDocument.html create mode 100644 testing/web-platform/tests/dom/nodes/DOMImplementation-createDocumentType.html create mode 100644 testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.html create mode 100644 testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js create mode 100644 testing/web-platform/tests/dom/nodes/DOMImplementation-hasFeature.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagName.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagNameNS.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-URL.sub.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-adoptNode.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-characterSet-normalization.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-constructor.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_bmp.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_css.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_gif.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_html.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_javascripturi.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_jpg.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_01.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_02.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_png.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_txt.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_xml.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createDocument.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createHTMLDocument.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/contentType/xhr_responseType_document.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.htm create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.txt create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/lib.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/style.css create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.bmp create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.gif create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.jpg create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.png create mode 100644 testing/web-platform/tests/dom/nodes/Document-contentType/support/contenttype_setter.py create mode 100644 testing/web-platform/tests/dom/nodes/Document-createAttribute.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createComment-createTextNode.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-createComment.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.xml create mode 100755 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.svg create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement-namespace.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElement.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElementNS.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createElementNS.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-createEvent.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createEvent.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction.js create mode 100644 testing/web-platform/tests/dom/nodes/Document-createTextNode.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-createTreeWalker.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-doctype.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-getElementById.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-getElementsByTagName-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Document-getElementsByTagName.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-getElementsByTagNameNS.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-implementation.html create mode 100644 testing/web-platform/tests/dom/nodes/Document-importNode.html create mode 100644 testing/web-platform/tests/dom/nodes/DocumentType-literal-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/DocumentType-literal.html create mode 100644 testing/web-platform/tests/dom/nodes/DocumentType-remove.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElement-null-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElement-null-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElement-null.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-childElementCount.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-children.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-classlist.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-closest.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-firstElementChild.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-getElementsByClassName.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml create mode 100644 testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-getElementsByTagName.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-getElementsByTagNameNS.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-hasAttributes.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-insertAdjacentElement.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-insertAdjacentText.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-lastElementChild-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-lastElementChild-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-lastElementChild.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-matches.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-matches.js create mode 100644 testing/web-platform/tests/dom/nodes/Element-nextElementSibling-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-nextElementSibling-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-nextElementSibling.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-previousElementSibling-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-previousElementSibling-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-previousElementSibling.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-remove.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-removeAttributeNS.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-siblingElement-null-svg.svg create mode 100644 testing/web-platform/tests/dom/nodes/Element-siblingElement-null-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Element-siblingElement-null.html create mode 100644 testing/web-platform/tests/dom/nodes/Element-tagName.html create mode 100644 testing/web-platform/tests/dom/nodes/MutationObserver-attributes.html create mode 100644 testing/web-platform/tests/dom/nodes/MutationObserver-characterData.html create mode 100644 testing/web-platform/tests/dom/nodes/MutationObserver-childList.html create mode 100644 testing/web-platform/tests/dom/nodes/MutationObserver-disconnect.html create mode 100644 testing/web-platform/tests/dom/nodes/MutationObserver-document.html create mode 100644 testing/web-platform/tests/dom/nodes/MutationObserver-inner-outer.html create mode 100644 testing/web-platform/tests/dom/nodes/MutationObserver-takeRecords.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-appendChild.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-baseURI.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-childNodes.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-cloneNode.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-compareDocumentPosition.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-constants.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-contains-xml.xml create mode 100644 testing/web-platform/tests/dom/nodes/Node-contains.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-insertBefore.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-isConnected.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe1.xml create mode 100644 testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe2.xml create mode 100644 testing/web-platform/tests/dom/nodes/Node-isEqualNode-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Node-isEqualNode.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-isSameNode.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-lookupNamespaceURI.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-lookupPrefix.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Node-nodeName-xhtml.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Node-nodeName.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-nodeValue.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-normalize.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-parentElement.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-parentNode-iframe.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-parentNode.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-properties.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-removeChild.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-replaceChild.html create mode 100644 testing/web-platform/tests/dom/nodes/Node-textContent.html create mode 100644 testing/web-platform/tests/dom/nodes/NodeList-Iterable.html create mode 100644 testing/web-platform/tests/dom/nodes/ParentNode-append.html create mode 100644 testing/web-platform/tests/dom/nodes/ParentNode-prepend.html create mode 100644 testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.html create mode 100644 testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.xht create mode 100644 testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-xht.xht create mode 100644 testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.html create mode 100644 testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.js create mode 100644 testing/web-platform/tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-1.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-2.xhtml create mode 100644 testing/web-platform/tests/dom/nodes/Text-constructor.html create mode 100644 testing/web-platform/tests/dom/nodes/Text-splitText.html create mode 100644 testing/web-platform/tests/dom/nodes/append-on-Document.html create mode 100644 testing/web-platform/tests/dom/nodes/attributes.html create mode 100644 testing/web-platform/tests/dom/nodes/attributes.js create mode 100644 testing/web-platform/tests/dom/nodes/case.html create mode 100644 testing/web-platform/tests/dom/nodes/case.js create mode 100644 testing/web-platform/tests/dom/nodes/creators.js create mode 100644 testing/web-platform/tests/dom/nodes/encoding.py create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-01.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-02.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-03.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-04.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-05.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-06.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-07.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-08.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-09.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-10.xml create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-11.xml create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-12.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-13.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-14.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-15.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-16.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-17.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-18.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-19.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-20.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-21.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-22.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-23.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-24.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-25.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-26.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-27.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-28.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-29.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-30.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassName-31.htm create mode 100644 testing/web-platform/tests/dom/nodes/getElementsByClassNameFrame.htm create mode 100644 testing/web-platform/tests/dom/nodes/insert-adjacent.html create mode 100644 testing/web-platform/tests/dom/nodes/mutationobservers.js create mode 100644 testing/web-platform/tests/dom/nodes/prepend-on-Document.html create mode 100644 testing/web-platform/tests/dom/nodes/productions.js create mode 100644 testing/web-platform/tests/dom/nodes/remove-unscopable.html create mode 100644 testing/web-platform/tests/dom/nodes/rootNode.html create mode 100644 testing/web-platform/tests/dom/nodes/selectors.js create mode 100644 testing/web-platform/tests/dom/ranges/Range-attributes.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-cloneContents.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-cloneRange.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-collapse.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer-2.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-compareBoundaryPoints.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-comparePoint-2.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-comparePoint.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-constructor.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-deleteContents.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-detach.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-extractContents.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-insertNode.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-intersectsNode-binding.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-intersectsNode.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-isPointInRange.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-mutations.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-selectNode.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-set.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-stringifier.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-surroundContents.html create mode 100644 testing/web-platform/tests/dom/ranges/Range-test-iframe.html create mode 100644 testing/web-platform/tests/dom/traversal/NodeFilter-constants.html create mode 100644 testing/web-platform/tests/dom/traversal/NodeIterator-removal.html create mode 100644 testing/web-platform/tests/dom/traversal/NodeIterator.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-acceptNode-filter.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-basic.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-currentNode.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-previousNodeLastChildReject.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-previousSiblingLastChildSkip.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-traversal-reject.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker-walking-outside-a-tree.html create mode 100644 testing/web-platform/tests/dom/traversal/TreeWalker.html create mode 100644 testing/web-platform/tests/dom/traversal/traversal-support.js create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/001.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/002.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/003.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/004.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/005.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/006.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/007.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/008.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/009.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/010.xml create mode 100644 testing/web-platform/tests/dom/traversal/unfinished/TODO (limited to 'testing/web-platform/tests/dom') diff --git a/testing/web-platform/tests/dom/OWNERS b/testing/web-platform/tests/dom/OWNERS new file mode 100644 index 000000000..fad498154 --- /dev/null +++ b/testing/web-platform/tests/dom/OWNERS @@ -0,0 +1,6 @@ +@ayg +@jdm +@Ms2ger +@plehegar +@zcorpan +@zqzhang diff --git a/testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html b/testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html new file mode 100644 index 000000000..225c9e61a --- /dev/null +++ b/testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html @@ -0,0 +1,13 @@ + + +Make sure browsers throw when getting .length on some random object whose proto is an HTMLCollection + + + diff --git a/testing/web-platform/tests/dom/collections/HTMLCollection-empty-name.html b/testing/web-platform/tests/dom/collections/HTMLCollection-empty-name.html new file mode 100644 index 000000000..4fc34db7f --- /dev/null +++ b/testing/web-platform/tests/dom/collections/HTMLCollection-empty-name.html @@ -0,0 +1,65 @@ + + +HTMLCollection and empty names + + +
+
+
+
+ +
+ diff --git a/testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-indices.html b/testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-indices.html new file mode 100644 index 000000000..62ee6bb6a --- /dev/null +++ b/testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-indices.html @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-names.html b/testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-names.html new file mode 100644 index 000000000..0a9df1ad6 --- /dev/null +++ b/testing/web-platform/tests/dom/collections/HTMLCollection-supported-property-names.html @@ -0,0 +1,135 @@ + + + + + + +
+ + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/collections/domstringmap-supported-property-names.html b/testing/web-platform/tests/dom/collections/domstringmap-supported-property-names.html new file mode 100644 index 000000000..430aa44c3 --- /dev/null +++ b/testing/web-platform/tests/dom/collections/domstringmap-supported-property-names.html @@ -0,0 +1,54 @@ + + +DOMStringMap Test: Supported property names + + +
+ +
Simple
+ +
Simple
+ +
+ John Doe +
+ +
Jane Doe
+ +
Jim Doe
+ + diff --git a/testing/web-platform/tests/dom/collections/namednodemap-supported-property-names.html b/testing/web-platform/tests/dom/collections/namednodemap-supported-property-names.html new file mode 100644 index 000000000..2c5dee4ef --- /dev/null +++ b/testing/web-platform/tests/dom/collections/namednodemap-supported-property-names.html @@ -0,0 +1,30 @@ + + +NamedNodeMap Test: Supported property names + + +
+
Simple
+ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/common.js b/testing/web-platform/tests/dom/common.js new file mode 100644 index 000000000..70367b2ef --- /dev/null +++ b/testing/web-platform/tests/dom/common.js @@ -0,0 +1,1083 @@ +"use strict"; +// Written by Aryeh Gregor + +// TODO: iframes, contenteditable/designMode + +// Everything is done in functions in this test harness, so we have to declare +// all the variables before use to make sure they can be reused. +var testDiv, paras, detachedDiv, detachedPara1, detachedPara2, + foreignDoc, foreignPara1, foreignPara2, xmlDoc, xmlElement, + detachedXmlElement, detachedTextNode, foreignTextNode, + detachedForeignTextNode, xmlTextNode, detachedXmlTextNode, + processingInstruction, detachedProcessingInstruction, comment, + detachedComment, foreignComment, detachedForeignComment, xmlComment, + detachedXmlComment, docfrag, foreignDocfrag, xmlDocfrag, doctype, + foreignDoctype, xmlDoctype; +var testRangesShort, testRanges, testPoints, testNodesShort, testNodes; + +function setupRangeTests() { + testDiv = document.querySelector("#test"); + if (testDiv) { + testDiv.parentNode.removeChild(testDiv); + } + testDiv = document.createElement("div"); + testDiv.id = "test"; + document.body.insertBefore(testDiv, document.body.firstChild); + + paras = []; + paras.push(document.createElement("p")); + paras[0].setAttribute("id", "a"); + // Test some diacritics, to make sure browsers are using code units here + // and not something like grapheme clusters. + paras[0].textContent = "A\u0308b\u0308c\u0308d\u0308e\u0308f\u0308g\u0308h\u0308\n"; + testDiv.appendChild(paras[0]); + + paras.push(document.createElement("p")); + paras[1].setAttribute("id", "b"); + paras[1].setAttribute("style", "display:none"); + paras[1].textContent = "Ijklmnop\n"; + testDiv.appendChild(paras[1]); + + paras.push(document.createElement("p")); + paras[2].setAttribute("id", "c"); + paras[2].textContent = "Qrstuvwx"; + testDiv.appendChild(paras[2]); + + paras.push(document.createElement("p")); + paras[3].setAttribute("id", "d"); + paras[3].setAttribute("style", "display:none"); + paras[3].textContent = "Yzabcdef"; + testDiv.appendChild(paras[3]); + + paras.push(document.createElement("p")); + paras[4].setAttribute("id", "e"); + paras[4].setAttribute("style", "display:none"); + paras[4].textContent = "Ghijklmn"; + testDiv.appendChild(paras[4]); + + detachedDiv = document.createElement("div"); + detachedPara1 = document.createElement("p"); + detachedPara1.appendChild(document.createTextNode("Opqrstuv")); + detachedPara2 = document.createElement("p"); + detachedPara2.appendChild(document.createTextNode("Wxyzabcd")); + detachedDiv.appendChild(detachedPara1); + detachedDiv.appendChild(detachedPara2); + + // Opera doesn't automatically create a doctype for a new HTML document, + // contrary to spec. It also doesn't let you add doctypes to documents + // after the fact through any means I've tried. So foreignDoc in Opera + // will have no doctype, foreignDoctype will be null, and Opera will fail + // some tests somewhat mysteriously as a result. + foreignDoc = document.implementation.createHTMLDocument(""); + foreignPara1 = foreignDoc.createElement("p"); + foreignPara1.appendChild(foreignDoc.createTextNode("Efghijkl")); + foreignPara2 = foreignDoc.createElement("p"); + foreignPara2.appendChild(foreignDoc.createTextNode("Mnopqrst")); + foreignDoc.body.appendChild(foreignPara1); + foreignDoc.body.appendChild(foreignPara2); + + // Now we get to do really silly stuff, which nobody in the universe is + // ever going to actually do, but the spec defines behavior, so too bad. + // Testing is fun! + xmlDoctype = document.implementation.createDocumentType("qorflesnorf", "abcde", "x\"'y"); + xmlDoc = document.implementation.createDocument(null, null, xmlDoctype); + detachedXmlElement = xmlDoc.createElement("everyone-hates-hyphenated-element-names"); + detachedTextNode = document.createTextNode("Uvwxyzab"); + detachedForeignTextNode = foreignDoc.createTextNode("Cdefghij"); + detachedXmlTextNode = xmlDoc.createTextNode("Klmnopqr"); + // PIs only exist in XML documents, so don't bother with document or + // foreignDoc. + detachedProcessingInstruction = xmlDoc.createProcessingInstruction("whippoorwill", "chirp chirp chirp"); + detachedComment = document.createComment("Stuvwxyz"); + // Hurrah, we finally got to "z" at the end! + detachedForeignComment = foreignDoc.createComment("אריה יהודה"); + detachedXmlComment = xmlDoc.createComment("בן חיים אליעזר"); + + // We should also test with document fragments that actually contain stuff + // . . . but, maybe later. + docfrag = document.createDocumentFragment(); + foreignDocfrag = foreignDoc.createDocumentFragment(); + xmlDocfrag = xmlDoc.createDocumentFragment(); + + xmlElement = xmlDoc.createElement("igiveuponcreativenames"); + xmlTextNode = xmlDoc.createTextNode("do re mi fa so la ti"); + xmlElement.appendChild(xmlTextNode); + processingInstruction = xmlDoc.createProcessingInstruction("somePI", 'Did you know that ":syn sync fromstart" is very useful when using vim to edit large amounts of JavaScript embedded in HTML?'); + xmlDoc.appendChild(xmlElement); + xmlDoc.appendChild(processingInstruction); + xmlComment = xmlDoc.createComment("I maliciously created a comment that will break incautious XML serializers, but Firefox threw an exception, so all I got was this lousy T-shirt"); + xmlDoc.appendChild(xmlComment); + + comment = document.createComment("Alphabet soup?"); + testDiv.appendChild(comment); + + foreignComment = foreignDoc.createComment('"Commenter" and "commentator" mean different things. I\'ve seen non-native speakers trip up on this.'); + foreignDoc.appendChild(foreignComment); + foreignTextNode = foreignDoc.createTextNode("I admit that I harbor doubts about whether we really need so many things to test, but it's too late to stop now."); + foreignDoc.body.appendChild(foreignTextNode); + + doctype = document.doctype; + foreignDoctype = foreignDoc.doctype; + + testRangesShort = [ + // Various ranges within the text node children of different + // paragraphs. All should be valid. + "[paras[0].firstChild, 0, paras[0].firstChild, 0]", + "[paras[0].firstChild, 0, paras[0].firstChild, 1]", + "[paras[0].firstChild, 2, paras[0].firstChild, 8]", + "[paras[0].firstChild, 2, paras[0].firstChild, 9]", + "[paras[1].firstChild, 0, paras[1].firstChild, 0]", + "[paras[1].firstChild, 2, paras[1].firstChild, 9]", + "[detachedPara1.firstChild, 0, detachedPara1.firstChild, 0]", + "[detachedPara1.firstChild, 2, detachedPara1.firstChild, 8]", + "[foreignPara1.firstChild, 0, foreignPara1.firstChild, 0]", + "[foreignPara1.firstChild, 2, foreignPara1.firstChild, 8]", + // Now try testing some elements, not just text nodes. + "[document.documentElement, 0, document.documentElement, 1]", + "[document.documentElement, 0, document.documentElement, 2]", + "[document.documentElement, 1, document.documentElement, 2]", + "[document.head, 1, document.head, 1]", + "[document.body, 4, document.body, 5]", + "[foreignDoc.documentElement, 0, foreignDoc.documentElement, 1]", + "[paras[0], 0, paras[0], 1]", + "[detachedPara1, 0, detachedPara1, 1]", + // Now try some ranges that span elements. + "[paras[0].firstChild, 0, paras[1].firstChild, 0]", + "[paras[0].firstChild, 0, paras[1].firstChild, 8]", + "[paras[0].firstChild, 3, paras[3], 1]", + // How about something that spans a node and its descendant? + "[paras[0], 0, paras[0].firstChild, 7]", + "[testDiv, 2, paras[4], 1]", + // Then a few more interesting things just for good measure. + "[document, 0, document, 1]", + "[document, 0, document, 2]", + "[comment, 2, comment, 3]", + "[testDiv, 0, comment, 5]", + "[foreignDoc, 1, foreignComment, 2]", + "[foreignDoc.body, 0, foreignTextNode, 36]", + "[xmlDoc, 1, xmlComment, 0]", + "[detachedTextNode, 0, detachedTextNode, 8]", + "[detachedForeignTextNode, 0, detachedForeignTextNode, 8]", + "[detachedXmlTextNode, 0, detachedXmlTextNode, 8]", + "[detachedComment, 3, detachedComment, 4]", + "[detachedForeignComment, 0, detachedForeignComment, 1]", + "[detachedXmlComment, 2, detachedXmlComment, 6]", + "[docfrag, 0, docfrag, 0]", + "[processingInstruction, 0, processingInstruction, 4]", + ]; + + testRanges = testRangesShort.concat([ + "[paras[1].firstChild, 0, paras[1].firstChild, 1]", + "[paras[1].firstChild, 2, paras[1].firstChild, 8]", + "[detachedPara1.firstChild, 0, detachedPara1.firstChild, 1]", + "[foreignPara1.firstChild, 0, foreignPara1.firstChild, 1]", + "[foreignDoc.head, 1, foreignDoc.head, 1]", + "[foreignDoc.body, 0, foreignDoc.body, 0]", + "[paras[0], 0, paras[0], 0]", + "[detachedPara1, 0, detachedPara1, 0]", + "[testDiv, 1, paras[2].firstChild, 5]", + "[document.documentElement, 1, document.body, 0]", + "[foreignDoc.documentElement, 1, foreignDoc.body, 0]", + "[document, 1, document, 2]", + "[paras[2].firstChild, 4, comment, 2]", + "[paras[3], 1, comment, 8]", + "[foreignDoc, 0, foreignDoc, 0]", + "[xmlDoc, 0, xmlDoc, 0]", + "[detachedForeignTextNode, 7, detachedForeignTextNode, 7]", + "[detachedXmlTextNode, 7, detachedXmlTextNode, 7]", + "[detachedComment, 5, detachedComment, 5]", + "[detachedForeignComment, 4, detachedForeignComment, 4]", + "[foreignDocfrag, 0, foreignDocfrag, 0]", + "[xmlDocfrag, 0, xmlDocfrag, 0]", + ]); + + testPoints = [ + // Various positions within the page, some invalid. Remember that + // paras[0] is visible, and paras[1] is display: none. + "[paras[0].firstChild, -1]", + "[paras[0].firstChild, 0]", + "[paras[0].firstChild, 1]", + "[paras[0].firstChild, 2]", + "[paras[0].firstChild, 8]", + "[paras[0].firstChild, 9]", + "[paras[0].firstChild, 10]", + "[paras[0].firstChild, 65535]", + "[paras[1].firstChild, -1]", + "[paras[1].firstChild, 0]", + "[paras[1].firstChild, 1]", + "[paras[1].firstChild, 2]", + "[paras[1].firstChild, 8]", + "[paras[1].firstChild, 9]", + "[paras[1].firstChild, 10]", + "[paras[1].firstChild, 65535]", + "[detachedPara1.firstChild, 0]", + "[detachedPara1.firstChild, 1]", + "[detachedPara1.firstChild, 8]", + "[detachedPara1.firstChild, 9]", + "[foreignPara1.firstChild, 0]", + "[foreignPara1.firstChild, 1]", + "[foreignPara1.firstChild, 8]", + "[foreignPara1.firstChild, 9]", + // Now try testing some elements, not just text nodes. + "[document.documentElement, -1]", + "[document.documentElement, 0]", + "[document.documentElement, 1]", + "[document.documentElement, 2]", + "[document.documentElement, 7]", + "[document.head, 1]", + "[document.body, 3]", + "[foreignDoc.documentElement, 0]", + "[foreignDoc.documentElement, 1]", + "[foreignDoc.head, 0]", + "[foreignDoc.body, 1]", + "[paras[0], 0]", + "[paras[0], 1]", + "[paras[0], 2]", + "[paras[1], 0]", + "[paras[1], 1]", + "[paras[1], 2]", + "[detachedPara1, 0]", + "[detachedPara1, 1]", + "[testDiv, 0]", + "[testDiv, 3]", + // Then a few more interesting things just for good measure. + "[document, -1]", + "[document, 0]", + "[document, 1]", + "[document, 2]", + "[document, 3]", + "[comment, -1]", + "[comment, 0]", + "[comment, 4]", + "[comment, 96]", + "[foreignDoc, 0]", + "[foreignDoc, 1]", + "[foreignComment, 2]", + "[foreignTextNode, 0]", + "[foreignTextNode, 36]", + "[xmlDoc, -1]", + "[xmlDoc, 0]", + "[xmlDoc, 1]", + "[xmlDoc, 5]", + "[xmlComment, 0]", + "[xmlComment, 4]", + "[processingInstruction, 0]", + "[processingInstruction, 5]", + "[processingInstruction, 9]", + "[detachedTextNode, 0]", + "[detachedTextNode, 8]", + "[detachedForeignTextNode, 0]", + "[detachedForeignTextNode, 8]", + "[detachedXmlTextNode, 0]", + "[detachedXmlTextNode, 8]", + "[detachedProcessingInstruction, 12]", + "[detachedComment, 3]", + "[detachedComment, 5]", + "[detachedForeignComment, 0]", + "[detachedForeignComment, 4]", + "[detachedXmlComment, 2]", + "[docfrag, 0]", + "[foreignDocfrag, 0]", + "[xmlDocfrag, 0]", + "[doctype, 0]", + "[doctype, -17]", + "[doctype, 1]", + "[foreignDoctype, 0]", + "[xmlDoctype, 0]", + ]; + + testNodesShort = [ + "paras[0]", + "paras[0].firstChild", + "paras[1].firstChild", + "foreignPara1", + "foreignPara1.firstChild", + "detachedPara1", + "detachedPara1.firstChild", + "document", + "detachedDiv", + "foreignDoc", + "foreignPara2", + "xmlDoc", + "xmlElement", + "detachedTextNode", + "foreignTextNode", + "processingInstruction", + "detachedProcessingInstruction", + "comment", + "detachedComment", + "docfrag", + "doctype", + "foreignDoctype", + ]; + + testNodes = testNodesShort.concat([ + "paras[1]", + "detachedPara2", + "detachedPara2.firstChild", + "testDiv", + "detachedXmlElement", + "detachedForeignTextNode", + "xmlTextNode", + "detachedXmlTextNode", + "xmlComment", + "foreignComment", + "detachedForeignComment", + "detachedXmlComment", + "foreignDocfrag", + "xmlDocfrag", + "xmlDoctype", + ]); +} +if ("setup" in window) { + setup(setupRangeTests); +} else { + // Presumably we're running from within an iframe or something + setupRangeTests(); +} + +/** + * The "length" of a node as defined by the Ranges section of DOM4. + */ +function nodeLength(node) { + // "The length of a node node depends on node: + // + // "DocumentType + // "0." + if (node.nodeType == Node.DOCUMENT_TYPE_NODE) { + return 0; + } + // "Text + // "ProcessingInstruction + // "Comment + // "Its length attribute value." + // Browsers don't historically support the length attribute on + // ProcessingInstruction, so to avoid spurious failures, do + // node.data.length instead of node.length. + if (node.nodeType == Node.TEXT_NODE || node.nodeType == Node.PROCESSING_INSTRUCTION_NODE || node.nodeType == Node.COMMENT_NODE) { + return node.data.length; + } + // "Any other node + // "Its number of children." + return node.childNodes.length; +} + +/** + * Returns the furthest ancestor of a Node as defined by the spec. + */ +function furthestAncestor(node) { + var root = node; + while (root.parentNode != null) { + root = root.parentNode; + } + return root; +} + +/** + * "The ancestor containers of a Node are the Node itself and all its + * ancestors." + * + * Is node1 an ancestor container of node2? + */ +function isAncestorContainer(node1, node2) { + return node1 == node2 || + (node2.compareDocumentPosition(node1) & Node.DOCUMENT_POSITION_CONTAINS); +} + +/** + * Returns the first Node that's after node in tree order, or null if node is + * the last Node. + */ +function nextNode(node) { + if (node.hasChildNodes()) { + return node.firstChild; + } + return nextNodeDescendants(node); +} + +/** + * Returns the last Node that's before node in tree order, or null if node is + * the first Node. + */ +function previousNode(node) { + if (node.previousSibling) { + node = node.previousSibling; + while (node.hasChildNodes()) { + node = node.lastChild; + } + return node; + } + return node.parentNode; +} + +/** + * Returns the next Node that's after node and all its descendants in tree + * order, or null if node is the last Node or an ancestor of it. + */ +function nextNodeDescendants(node) { + while (node && !node.nextSibling) { + node = node.parentNode; + } + if (!node) { + return null; + } + return node.nextSibling; +} + +/** + * Returns the ownerDocument of the Node, or the Node itself if it's a + * Document. + */ +function ownerDocument(node) { + return node.nodeType == Node.DOCUMENT_NODE + ? node + : node.ownerDocument; +} + +/** + * Returns true if ancestor is an ancestor of descendant, false otherwise. + */ +function isAncestor(ancestor, descendant) { + if (!ancestor || !descendant) { + return false; + } + while (descendant && descendant != ancestor) { + descendant = descendant.parentNode; + } + return descendant == ancestor; +} + +/** + * Returns true if ancestor is an inclusive ancestor of descendant, false + * otherwise. + */ +function isInclusiveAncestor(ancestor, descendant) { + return ancestor === descendant || isAncestor(ancestor, descendant); +} + +/** + * Returns true if descendant is a descendant of ancestor, false otherwise. + */ +function isDescendant(descendant, ancestor) { + return isAncestor(ancestor, descendant); +} + +/** + * Returns true if descendant is an inclusive descendant of ancestor, false + * otherwise. + */ +function isInclusiveDescendant(descendant, ancestor) { + return descendant === ancestor || isDescendant(descendant, ancestor); +} + +/** + * The position of two boundary points relative to one another, as defined by + * the spec. + */ +function getPosition(nodeA, offsetA, nodeB, offsetB) { + // "If node A is the same as node B, return equal if offset A equals offset + // B, before if offset A is less than offset B, and after if offset A is + // greater than offset B." + if (nodeA == nodeB) { + if (offsetA == offsetB) { + return "equal"; + } + if (offsetA < offsetB) { + return "before"; + } + if (offsetA > offsetB) { + return "after"; + } + } + + // "If node A is after node B in tree order, compute the position of (node + // B, offset B) relative to (node A, offset A). If it is before, return + // after. If it is after, return before." + if (nodeB.compareDocumentPosition(nodeA) & Node.DOCUMENT_POSITION_FOLLOWING) { + var pos = getPosition(nodeB, offsetB, nodeA, offsetA); + if (pos == "before") { + return "after"; + } + if (pos == "after") { + return "before"; + } + } + + // "If node A is an ancestor of node B:" + if (nodeB.compareDocumentPosition(nodeA) & Node.DOCUMENT_POSITION_CONTAINS) { + // "Let child equal node B." + var child = nodeB; + + // "While child is not a child of node A, set child to its parent." + while (child.parentNode != nodeA) { + child = child.parentNode; + } + + // "If the index of child is less than offset A, return after." + if (indexOf(child) < offsetA) { + return "after"; + } + } + + // "Return before." + return "before"; +} + +/** + * "contained" as defined by DOM Range: "A Node node is contained in a range + * range if node's furthest ancestor is the same as range's root, and (node, 0) + * is after range's start, and (node, length of node) is before range's end." + */ +function isContained(node, range) { + var pos1 = getPosition(node, 0, range.startContainer, range.startOffset); + var pos2 = getPosition(node, nodeLength(node), range.endContainer, range.endOffset); + + return furthestAncestor(node) == furthestAncestor(range.startContainer) + && pos1 == "after" + && pos2 == "before"; +} + +/** + * "partially contained" as defined by DOM Range: "A Node is partially + * contained in a range if it is an ancestor container of the range's start but + * not its end, or vice versa." + */ +function isPartiallyContained(node, range) { + var cond1 = isAncestorContainer(node, range.startContainer); + var cond2 = isAncestorContainer(node, range.endContainer); + return (cond1 && !cond2) || (cond2 && !cond1); +} + +/** + * Index of a node as defined by the spec. + */ +function indexOf(node) { + if (!node.parentNode) { + // No preceding sibling nodes, right? + return 0; + } + var i = 0; + while (node != node.parentNode.childNodes[i]) { + i++; + } + return i; +} + +/** + * extractContents() implementation, following the spec. If an exception is + * supposed to be thrown, will return a string with the name (e.g., + * "HIERARCHY_REQUEST_ERR") instead of a document fragment. It might also + * return an arbitrary human-readable string if a condition is hit that implies + * a spec bug. + */ +function myExtractContents(range) { + // "Let frag be a new DocumentFragment whose ownerDocument is the same as + // the ownerDocument of the context object's start node." + var ownerDoc = range.startContainer.nodeType == Node.DOCUMENT_NODE + ? range.startContainer + : range.startContainer.ownerDocument; + var frag = ownerDoc.createDocumentFragment(); + + // "If the context object's start and end are the same, abort this method, + // returning frag." + if (range.startContainer == range.endContainer + && range.startOffset == range.endOffset) { + return frag; + } + + // "Let original start node, original start offset, original end node, and + // original end offset be the context object's start and end nodes and + // offsets, respectively." + var originalStartNode = range.startContainer; + var originalStartOffset = range.startOffset; + var originalEndNode = range.endContainer; + var originalEndOffset = range.endOffset; + + // "If original start node is original end node, and they are a Text, + // ProcessingInstruction, or Comment node:" + if (range.startContainer == range.endContainer + && (range.startContainer.nodeType == Node.TEXT_NODE + || range.startContainer.nodeType == Node.PROCESSING_INSTRUCTION_NODE + || range.startContainer.nodeType == Node.COMMENT_NODE)) { + // "Let clone be the result of calling cloneNode(false) on original + // start node." + var clone = originalStartNode.cloneNode(false); + + // "Set the data of clone to the result of calling + // substringData(original start offset, original end offset − original + // start offset) on original start node." + clone.data = originalStartNode.substringData(originalStartOffset, + originalEndOffset - originalStartOffset); + + // "Append clone as the last child of frag." + frag.appendChild(clone); + + // "Call deleteData(original start offset, original end offset − + // original start offset) on original start node." + originalStartNode.deleteData(originalStartOffset, + originalEndOffset - originalStartOffset); + + // "Abort this method, returning frag." + return frag; + } + + // "Let common ancestor equal original start node." + var commonAncestor = originalStartNode; + + // "While common ancestor is not an ancestor container of original end + // node, set common ancestor to its own parent." + while (!isAncestorContainer(commonAncestor, originalEndNode)) { + commonAncestor = commonAncestor.parentNode; + } + + // "If original start node is an ancestor container of original end node, + // let first partially contained child be null." + var firstPartiallyContainedChild; + if (isAncestorContainer(originalStartNode, originalEndNode)) { + firstPartiallyContainedChild = null; + // "Otherwise, let first partially contained child be the first child of + // common ancestor that is partially contained in the context object." + } else { + for (var i = 0; i < commonAncestor.childNodes.length; i++) { + if (isPartiallyContained(commonAncestor.childNodes[i], range)) { + firstPartiallyContainedChild = commonAncestor.childNodes[i]; + break; + } + } + if (!firstPartiallyContainedChild) { + throw "Spec bug: no first partially contained child!"; + } + } + + // "If original end node is an ancestor container of original start node, + // let last partially contained child be null." + var lastPartiallyContainedChild; + if (isAncestorContainer(originalEndNode, originalStartNode)) { + lastPartiallyContainedChild = null; + // "Otherwise, let last partially contained child be the last child of + // common ancestor that is partially contained in the context object." + } else { + for (var i = commonAncestor.childNodes.length - 1; i >= 0; i--) { + if (isPartiallyContained(commonAncestor.childNodes[i], range)) { + lastPartiallyContainedChild = commonAncestor.childNodes[i]; + break; + } + } + if (!lastPartiallyContainedChild) { + throw "Spec bug: no last partially contained child!"; + } + } + + // "Let contained children be a list of all children of common ancestor + // that are contained in the context object, in tree order." + // + // "If any member of contained children is a DocumentType, raise a + // HIERARCHY_REQUEST_ERR exception and abort these steps." + var containedChildren = []; + for (var i = 0; i < commonAncestor.childNodes.length; i++) { + if (isContained(commonAncestor.childNodes[i], range)) { + if (commonAncestor.childNodes[i].nodeType + == Node.DOCUMENT_TYPE_NODE) { + return "HIERARCHY_REQUEST_ERR"; + } + containedChildren.push(commonAncestor.childNodes[i]); + } + } + + // "If original start node is an ancestor container of original end node, + // set new node to original start node and new offset to original start + // offset." + var newNode, newOffset; + if (isAncestorContainer(originalStartNode, originalEndNode)) { + newNode = originalStartNode; + newOffset = originalStartOffset; + // "Otherwise:" + } else { + // "Let reference node equal original start node." + var referenceNode = originalStartNode; + + // "While reference node's parent is not null and is not an ancestor + // container of original end node, set reference node to its parent." + while (referenceNode.parentNode + && !isAncestorContainer(referenceNode.parentNode, originalEndNode)) { + referenceNode = referenceNode.parentNode; + } + + // "Set new node to the parent of reference node, and new offset to one + // plus the index of reference node." + newNode = referenceNode.parentNode; + newOffset = 1 + indexOf(referenceNode); + } + + // "If first partially contained child is a Text, ProcessingInstruction, or + // Comment node:" + if (firstPartiallyContainedChild + && (firstPartiallyContainedChild.nodeType == Node.TEXT_NODE + || firstPartiallyContainedChild.nodeType == Node.PROCESSING_INSTRUCTION_NODE + || firstPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) { + // "Let clone be the result of calling cloneNode(false) on original + // start node." + var clone = originalStartNode.cloneNode(false); + + // "Set the data of clone to the result of calling substringData() on + // original start node, with original start offset as the first + // argument and (length of original start node − original start offset) + // as the second." + clone.data = originalStartNode.substringData(originalStartOffset, + nodeLength(originalStartNode) - originalStartOffset); + + // "Append clone as the last child of frag." + frag.appendChild(clone); + + // "Call deleteData() on original start node, with original start + // offset as the first argument and (length of original start node − + // original start offset) as the second." + originalStartNode.deleteData(originalStartOffset, + nodeLength(originalStartNode) - originalStartOffset); + // "Otherwise, if first partially contained child is not null:" + } else if (firstPartiallyContainedChild) { + // "Let clone be the result of calling cloneNode(false) on first + // partially contained child." + var clone = firstPartiallyContainedChild.cloneNode(false); + + // "Append clone as the last child of frag." + frag.appendChild(clone); + + // "Let subrange be a new Range whose start is (original start node, + // original start offset) and whose end is (first partially contained + // child, length of first partially contained child)." + var subrange = ownerDoc.createRange(); + subrange.setStart(originalStartNode, originalStartOffset); + subrange.setEnd(firstPartiallyContainedChild, + nodeLength(firstPartiallyContainedChild)); + + // "Let subfrag be the result of calling extractContents() on + // subrange." + var subfrag = myExtractContents(subrange); + + // "For each child of subfrag, in order, append that child to clone as + // its last child." + for (var i = 0; i < subfrag.childNodes.length; i++) { + clone.appendChild(subfrag.childNodes[i]); + } + } + + // "For each contained child in contained children, append contained child + // as the last child of frag." + for (var i = 0; i < containedChildren.length; i++) { + frag.appendChild(containedChildren[i]); + } + + // "If last partially contained child is a Text, ProcessingInstruction, or + // Comment node:" + if (lastPartiallyContainedChild + && (lastPartiallyContainedChild.nodeType == Node.TEXT_NODE + || lastPartiallyContainedChild.nodeType == Node.PROCESSING_INSTRUCTION_NODE + || lastPartiallyContainedChild.nodeType == Node.COMMENT_NODE)) { + // "Let clone be the result of calling cloneNode(false) on original + // end node." + var clone = originalEndNode.cloneNode(false); + + // "Set the data of clone to the result of calling substringData(0, + // original end offset) on original end node." + clone.data = originalEndNode.substringData(0, originalEndOffset); + + // "Append clone as the last child of frag." + frag.appendChild(clone); + + // "Call deleteData(0, original end offset) on original end node." + originalEndNode.deleteData(0, originalEndOffset); + // "Otherwise, if last partially contained child is not null:" + } else if (lastPartiallyContainedChild) { + // "Let clone be the result of calling cloneNode(false) on last + // partially contained child." + var clone = lastPartiallyContainedChild.cloneNode(false); + + // "Append clone as the last child of frag." + frag.appendChild(clone); + + // "Let subrange be a new Range whose start is (last partially + // contained child, 0) and whose end is (original end node, original + // end offset)." + var subrange = ownerDoc.createRange(); + subrange.setStart(lastPartiallyContainedChild, 0); + subrange.setEnd(originalEndNode, originalEndOffset); + + // "Let subfrag be the result of calling extractContents() on + // subrange." + var subfrag = myExtractContents(subrange); + + // "For each child of subfrag, in order, append that child to clone as + // its last child." + for (var i = 0; i < subfrag.childNodes.length; i++) { + clone.appendChild(subfrag.childNodes[i]); + } + } + + // "Set the context object's start and end to (new node, new offset)." + range.setStart(newNode, newOffset); + range.setEnd(newNode, newOffset); + + // "Return frag." + return frag; +} + +/** + * insertNode() implementation, following the spec. If an exception is meant + * to be thrown, will return a string with the expected exception name, for + * instance "HIERARCHY_REQUEST_ERR". + */ +function myInsertNode(range, node) { + // "If range's start node is a ProcessingInstruction or Comment node, or is + // a Text node whose parent is null, or is node, throw an + // "HierarchyRequestError" exception and terminate these steps." + if (range.startContainer.nodeType == Node.PROCESSING_INSTRUCTION_NODE + || range.startContainer.nodeType == Node.COMMENT_NODE + || (range.startContainer.nodeType == Node.TEXT_NODE + && !range.startContainer.parentNode) + || range.startContainer == node) { + return "HIERARCHY_REQUEST_ERR"; + } + + // "Let referenceNode be null." + var referenceNode = null; + + // "If range's start node is a Text node, set referenceNode to that Text node." + if (range.startContainer.nodeType == Node.TEXT_NODE) { + referenceNode = range.startContainer; + + // "Otherwise, set referenceNode to the child of start node whose index is + // start offset, and null if there is no such child." + } else { + if (range.startOffset < range.startContainer.childNodes.length) { + referenceNode = range.startContainer.childNodes[range.startOffset]; + } else { + referenceNode = null; + } + } + + // "Let parent be range's start node if referenceNode is null, and + // referenceNode's parent otherwise." + var parent_ = referenceNode === null ? range.startContainer : + referenceNode.parentNode; + + // "Ensure pre-insertion validity of node into parent before + // referenceNode." + var error = ensurePreInsertionValidity(node, parent_, referenceNode); + if (error) { + return error; + } + + // "If range's start node is a Text node, set referenceNode to the result + // of splitting it with offset range's start offset." + if (range.startContainer.nodeType == Node.TEXT_NODE) { + referenceNode = range.startContainer.splitText(range.startOffset); + } + + // "If node is referenceNode, set referenceNode to its next sibling." + if (node == referenceNode) { + referenceNode = referenceNode.nextSibling; + } + + // "If node's parent is not null, remove node from its parent." + if (node.parentNode) { + node.parentNode.removeChild(node); + } + + // "Let newOffset be parent's length if referenceNode is null, and + // referenceNode's index otherwise." + var newOffset = referenceNode === null ? nodeLength(parent_) : + indexOf(referenceNode); + + // "Increase newOffset by node's length if node is a DocumentFragment node, + // and one otherwise." + newOffset += node.nodeType == Node.DOCUMENT_FRAGMENT_NODE ? + nodeLength(node) : 1; + + // "Pre-insert node into parent before referenceNode." + parent_.insertBefore(node, referenceNode); + + // "If range's start and end are the same, set range's end to (parent, + // newOffset)." + if (range.startContainer == range.endContainer + && range.startOffset == range.endOffset) { + range.setEnd(parent_, newOffset); + } +} + +// To make filter() calls more readable +function isElement(node) { + return node.nodeType == Node.ELEMENT_NODE; +} + +function isText(node) { + return node.nodeType == Node.TEXT_NODE; +} + +function isDoctype(node) { + return node.nodeType == Node.DOCUMENT_TYPE_NODE; +} + +function ensurePreInsertionValidity(node, parent_, child) { + // "If parent is not a Document, DocumentFragment, or Element node, throw a + // HierarchyRequestError." + if (parent_.nodeType != Node.DOCUMENT_NODE + && parent_.nodeType != Node.DOCUMENT_FRAGMENT_NODE + && parent_.nodeType != Node.ELEMENT_NODE) { + return "HIERARCHY_REQUEST_ERR"; + } + + // "If node is a host-including inclusive ancestor of parent, throw a + // HierarchyRequestError." + // + // XXX Does not account for host + if (isInclusiveAncestor(node, parent_)) { + return "HIERARCHY_REQUEST_ERR"; + } + + // "If child is not null and its parent is not parent, throw a NotFoundError + // exception." + if (child && child.parentNode != parent_) { + return "NOT_FOUND_ERR"; + } + + // "If node is not a DocumentFragment, DocumentType, Element, Text, + // ProcessingInstruction, or Comment node, throw a HierarchyRequestError." + if (node.nodeType != Node.DOCUMENT_FRAGMENT_NODE + && node.nodeType != Node.DOCUMENT_TYPE_NODE + && node.nodeType != Node.ELEMENT_NODE + && node.nodeType != Node.TEXT_NODE + && node.nodeType != Node.PROCESSING_INSTRUCTION_NODE + && node.nodeType != Node.COMMENT_NODE) { + return "HIERARCHY_REQUEST_ERR"; + } + + // "If either node is a Text node and parent is a document, or node is a + // doctype and parent is not a document, throw a HierarchyRequestError." + if ((node.nodeType == Node.TEXT_NODE + && parent_.nodeType == Node.DOCUMENT_NODE) + || (node.nodeType == Node.DOCUMENT_TYPE_NODE + && parent_.nodeType != Node.DOCUMENT_NODE)) { + return "HIERARCHY_REQUEST_ERR"; + } + + // "If parent is a document, and any of the statements below, switched on + // node, are true, throw a HierarchyRequestError." + if (parent_.nodeType == Node.DOCUMENT_NODE) { + switch (node.nodeType) { + case Node.DOCUMENT_FRAGMENT_NODE: + // "If node has more than one element child or has a Text node + // child. Otherwise, if node has one element child and either + // parent has an element child, child is a doctype, or child is not + // null and a doctype is following child." + if ([].filter.call(node.childNodes, isElement).length > 1) { + return "HIERARCHY_REQUEST_ERR"; + } + + if ([].some.call(node.childNodes, isText)) { + return "HIERARCHY_REQUEST_ERR"; + } + + if ([].filter.call(node.childNodes, isElement).length == 1) { + if ([].some.call(parent_.childNodes, isElement)) { + return "HIERARCHY_REQUEST_ERR"; + } + + if (child && child.nodeType == Node.DOCUMENT_TYPE_NODE) { + return "HIERARCHY_REQUEST_ERR"; + } + + if (child && [].slice.call(parent_.childNodes, indexOf(child) + 1) + .filter(isDoctype)) { + return "HIERARCHY_REQUEST_ERR"; + } + } + break; + + case Node.ELEMENT_NODE: + // "parent has an element child, child is a doctype, or child is + // not null and a doctype is following child." + if ([].some.call(parent_.childNodes, isElement)) { + return "HIERARCHY_REQUEST_ERR"; + } + + if (child.nodeType == Node.DOCUMENT_TYPE_NODE) { + return "HIERARCHY_REQUEST_ERR"; + } + + if (child && [].slice.call(parent_.childNodes, indexOf(child) + 1) + .filter(isDoctype)) { + return "HIERARCHY_REQUEST_ERR"; + } + break; + + case Node.DOCUMENT_TYPE_NODE: + // "parent has a doctype child, an element is preceding child, or + // child is null and parent has an element child." + if ([].some.call(parent_.childNodes, isDoctype)) { + return "HIERARCHY_REQUEST_ERR"; + } + + if (child && [].slice.call(parent_.childNodes, 0, indexOf(child)) + .some(isElement)) { + return "HIERARCHY_REQUEST_ERR"; + } + + if (!child && [].some.call(parent_.childNodes, isElement)) { + return "HIERARCHY_REQUEST_ERR"; + } + break; + } + } +} + +/** + * Asserts that two nodes are equal, in the sense of isEqualNode(). If they + * aren't, tries to print a relatively informative reason why not. TODO: Move + * this to testharness.js? + */ +function assertNodesEqual(actual, expected, msg) { + if (!actual.isEqualNode(expected)) { + msg = "Actual and expected mismatch for " + msg + ". "; + + while (actual && expected) { + assert_true(actual.nodeType === expected.nodeType + && actual.nodeName === expected.nodeName + && actual.nodeValue === expected.nodeValue, + "First differing node: expected " + format_value(expected) + + ", got " + format_value(actual) + " [" + msg + "]"); + actual = nextNode(actual); + expected = nextNode(expected); + } + + assert_unreached("DOMs were not equal but we couldn't figure out why"); + } +} + +/** + * Given a DOMException, return the name (e.g., "HIERARCHY_REQUEST_ERR"). + */ +function getDomExceptionName(e) { + var ret = null; + for (var prop in e) { + if (/^[A-Z_]+_ERR$/.test(prop) && e[prop] == e.code) { + return prop; + } + } + + throw "Exception seems to not be a DOMException? " + e; +} + +/** + * Given an array of endpoint data [start container, start offset, end + * container, end offset], returns a Range with those endpoints. + */ +function rangeFromEndpoints(endpoints) { + // If we just use document instead of the ownerDocument of endpoints[0], + // WebKit will throw on setStart/setEnd. This is a WebKit bug, but it's in + // range, not selection, so we don't want to fail anything for it. + var range = ownerDocument(endpoints[0]).createRange(); + range.setStart(endpoints[0], endpoints[1]); + range.setEnd(endpoints[2], endpoints[3]); + return range; +} diff --git a/testing/web-platform/tests/dom/constants.js b/testing/web-platform/tests/dom/constants.js new file mode 100644 index 000000000..397df96fb --- /dev/null +++ b/testing/web-platform/tests/dom/constants.js @@ -0,0 +1,11 @@ +function testConstants(objects, constants, msg) { + objects.forEach(function(arr) { + var o = arr[0], desc = arr[1]; + test(function() { + constants.forEach(function(d) { + assert_true(d[0] in o, "Object " + o + " doesn't have " + d[0]) + assert_equals(o[d[0]], d[1], "Object " + o + " value for " + d[0] + " is wrong") + }) + }, "Constants for " + msg + " on " + desc + ".") + }) +} diff --git a/testing/web-platform/tests/dom/events/AddEventListenerOptions-once.html b/testing/web-platform/tests/dom/events/AddEventListenerOptions-once.html new file mode 100644 index 000000000..ae750702c --- /dev/null +++ b/testing/web-platform/tests/dom/events/AddEventListenerOptions-once.html @@ -0,0 +1,81 @@ + + +AddEventListenerOptions.once + + + + +
+ diff --git a/testing/web-platform/tests/dom/events/AddEventListenerOptions-passive.html b/testing/web-platform/tests/dom/events/AddEventListenerOptions-passive.html new file mode 100644 index 000000000..1f0118efa --- /dev/null +++ b/testing/web-platform/tests/dom/events/AddEventListenerOptions-passive.html @@ -0,0 +1,113 @@ + + +EventListenerOptions.passive + + + + +
+ + diff --git a/testing/web-platform/tests/dom/events/CustomEvent.html b/testing/web-platform/tests/dom/events/CustomEvent.html new file mode 100644 index 000000000..c55d5924b --- /dev/null +++ b/testing/web-platform/tests/dom/events/CustomEvent.html @@ -0,0 +1,19 @@ + +CustomEvent + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-constants.html b/testing/web-platform/tests/dom/events/Event-constants.html new file mode 100644 index 000000000..635e9894d --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-constants.html @@ -0,0 +1,23 @@ + +Event constants + + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-constructors.html b/testing/web-platform/tests/dom/events/Event-constructors.html new file mode 100644 index 000000000..a3cd3f80c --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-constructors.html @@ -0,0 +1,115 @@ + +Event constructors + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-defaultPrevented-after-dispatch.html b/testing/web-platform/tests/dom/events/Event-defaultPrevented-after-dispatch.html new file mode 100644 index 000000000..decf7e992 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-defaultPrevented-after-dispatch.html @@ -0,0 +1,26 @@ + + +Event.defaultPrevented is not reset after dipatchEvent() + + + + +
+ + diff --git a/testing/web-platform/tests/dom/events/Event-defaultPrevented.html b/testing/web-platform/tests/dom/events/Event-defaultPrevented.html new file mode 100644 index 000000000..2a3d171b1 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-defaultPrevented.html @@ -0,0 +1,42 @@ + +Event.defaultPrevented + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-bubbles-false.html b/testing/web-platform/tests/dom/events/Event-dispatch-bubbles-false.html new file mode 100644 index 000000000..0f43cb027 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-bubbles-false.html @@ -0,0 +1,98 @@ + + + Event.bubbles attribute is set to false + + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-bubbles-true.html b/testing/web-platform/tests/dom/events/Event-dispatch-bubbles-true.html new file mode 100644 index 000000000..b23605a1e --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-bubbles-true.html @@ -0,0 +1,108 @@ + + + Event.bubbles attribute is set to false + + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-detached-click.html b/testing/web-platform/tests/dom/events/Event-dispatch-detached-click.html new file mode 100644 index 000000000..30e15b8e4 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-detached-click.html @@ -0,0 +1,19 @@ + +Click event on an element not in the document + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html b/testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html new file mode 100644 index 000000000..b325d5c5d --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-handlers-changed.html @@ -0,0 +1,92 @@ + + + Dispatch additional events inside an event listener + + + +
+ + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-multiple-stopPropagation.html b/testing/web-platform/tests/dom/events/Event-dispatch-multiple-stopPropagation.html new file mode 100644 index 000000000..72644bd86 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-multiple-stopPropagation.html @@ -0,0 +1,51 @@ + + + + Multiple dispatchEvent() and stopPropagation() + + + + +
+ + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html b/testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html new file mode 100644 index 000000000..77074d9a3 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-omitted-capture.html @@ -0,0 +1,70 @@ + + +EventTarget.addEventListener: capture argument omitted + + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-order.html b/testing/web-platform/tests/dom/events/Event-dispatch-order.html new file mode 100644 index 000000000..ca9443459 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-order.html @@ -0,0 +1,26 @@ + +Event phases order + + +
+ +
+
+
diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-other-document.html b/testing/web-platform/tests/dom/events/Event-dispatch-other-document.html new file mode 100644 index 000000000..0252a4f7b --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-other-document.html @@ -0,0 +1,22 @@ + +Custom event on an element in another document + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-propagation-stopped.html b/testing/web-platform/tests/dom/events/Event-dispatch-propagation-stopped.html new file mode 100644 index 000000000..889f8cfe1 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-propagation-stopped.html @@ -0,0 +1,59 @@ + + + + Calling stopPropagation() prior to dispatchEvent() + + + + +
+ + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-redispatch.html b/testing/web-platform/tests/dom/events/Event-dispatch-redispatch.html new file mode 100644 index 000000000..4027587bf --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-redispatch.html @@ -0,0 +1,28 @@ + + +EventTarget#dispatchEvent(): redispatching a native event + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-reenter.html b/testing/web-platform/tests/dom/events/Event-dispatch-reenter.html new file mode 100644 index 000000000..71f8517bd --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-reenter.html @@ -0,0 +1,66 @@ + + + Dispatch additional events inside an event listener + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-target-moved.html b/testing/web-platform/tests/dom/events/Event-dispatch-target-moved.html new file mode 100644 index 000000000..facb2c7b9 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-target-moved.html @@ -0,0 +1,73 @@ + + + Determined event propagation path - target moved + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-target-removed.html b/testing/web-platform/tests/dom/events/Event-dispatch-target-removed.html new file mode 100644 index 000000000..531799c3a --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-target-removed.html @@ -0,0 +1,72 @@ + + +Determined event propagation path - target removed + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/Event-dispatch-throwing.html b/testing/web-platform/tests/dom/events/Event-dispatch-throwing.html new file mode 100644 index 000000000..7d1c0d94a --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-dispatch-throwing.html @@ -0,0 +1,51 @@ + + +Throwing in event listeners + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-init-while-dispatching.html b/testing/web-platform/tests/dom/events/Event-init-while-dispatching.html new file mode 100644 index 000000000..2aa1f6701 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-init-while-dispatching.html @@ -0,0 +1,83 @@ + + +Re-initializing events while dispatching them + + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-initEvent.html b/testing/web-platform/tests/dom/events/Event-initEvent.html new file mode 100644 index 000000000..85abdff2f --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-initEvent.html @@ -0,0 +1,118 @@ + +Event.initEvent + + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-propagation.html b/testing/web-platform/tests/dom/events/Event-propagation.html new file mode 100644 index 000000000..459d45c18 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-propagation.html @@ -0,0 +1,41 @@ + +Event propagation tests + +
+ + + diff --git a/testing/web-platform/tests/dom/events/Event-subclasses-constructors.html b/testing/web-platform/tests/dom/events/Event-subclasses-constructors.html new file mode 100644 index 000000000..1741b9600 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-subclasses-constructors.html @@ -0,0 +1,153 @@ + + +Event constructors + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-type-empty.html b/testing/web-platform/tests/dom/events/Event-type-empty.html new file mode 100644 index 000000000..225b85a61 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-type-empty.html @@ -0,0 +1,35 @@ + +Event.type set to the empty string + + + + +
+ diff --git a/testing/web-platform/tests/dom/events/Event-type.html b/testing/web-platform/tests/dom/events/Event-type.html new file mode 100644 index 000000000..22792f5c6 --- /dev/null +++ b/testing/web-platform/tests/dom/events/Event-type.html @@ -0,0 +1,22 @@ + +Event.type + + + + +
+ diff --git a/testing/web-platform/tests/dom/events/EventListener-handleEvent.html b/testing/web-platform/tests/dom/events/EventListener-handleEvent.html new file mode 100644 index 000000000..3b58c4969 --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventListener-handleEvent.html @@ -0,0 +1,41 @@ + + +EventListener::handleEvent() + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/EventListener-incumbent-global-1.sub.html b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-1.sub.html new file mode 100644 index 000000000..9d941385c --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-1.sub.html @@ -0,0 +1,20 @@ + + + + + + + diff --git a/testing/web-platform/tests/dom/events/EventListener-incumbent-global-2.sub.html b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-2.sub.html new file mode 100644 index 000000000..4433c098d --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-2.sub.html @@ -0,0 +1,20 @@ + + + + + + + diff --git a/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html new file mode 100644 index 000000000..25487cc5e --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-1.sub.html @@ -0,0 +1,13 @@ + + + diff --git a/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html new file mode 100644 index 000000000..9c7235e2a --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subframe-2.sub.html @@ -0,0 +1,13 @@ + + + diff --git a/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html new file mode 100644 index 000000000..9ce9f21ca --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html @@ -0,0 +1,20 @@ + + diff --git a/testing/web-platform/tests/dom/events/EventListenerOptions-capture.html b/testing/web-platform/tests/dom/events/EventListenerOptions-capture.html new file mode 100644 index 000000000..f72cf3ca5 --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventListenerOptions-capture.html @@ -0,0 +1,98 @@ + + +EventListenerOptions.capture + + + + +
+ + diff --git a/testing/web-platform/tests/dom/events/EventTarget-addEventListener.html b/testing/web-platform/tests/dom/events/EventTarget-addEventListener.html new file mode 100644 index 000000000..e2a46e581 --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventTarget-addEventListener.html @@ -0,0 +1,16 @@ + + +EventTarget.addEventListener + + + + +
+ diff --git a/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html b/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html new file mode 100644 index 000000000..8804c38a5 --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent-returnvalue.html @@ -0,0 +1,43 @@ + + +EventTarget.dispatchEvent: return value + + + + + +
+ + + + + + + + + + + + + diff --git a/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent.html b/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent.html new file mode 100644 index 000000000..1a8bf3de9 --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventTarget-dispatchEvent.html @@ -0,0 +1,104 @@ + + +EventTarget.dispatchEvent + + + + + + +
+ diff --git a/testing/web-platform/tests/dom/events/EventTarget-removeEventListener.html b/testing/web-platform/tests/dom/events/EventTarget-removeEventListener.html new file mode 100644 index 000000000..da2d7db3c --- /dev/null +++ b/testing/web-platform/tests/dom/events/EventTarget-removeEventListener.html @@ -0,0 +1,16 @@ + + +EventTarget.removeEventListener + + + + +
+ diff --git a/testing/web-platform/tests/dom/events/ProgressEvent.html b/testing/web-platform/tests/dom/events/ProgressEvent.html new file mode 100644 index 000000000..aa947e3f2 --- /dev/null +++ b/testing/web-platform/tests/dom/events/ProgressEvent.html @@ -0,0 +1,25 @@ + +ProgressEvent constructor + + +
+ diff --git a/testing/web-platform/tests/dom/historical.html b/testing/web-platform/tests/dom/historical.html new file mode 100644 index 000000000..cec309308 --- /dev/null +++ b/testing/web-platform/tests/dom/historical.html @@ -0,0 +1,132 @@ + +Historical DOM features must be removed + + +
+ diff --git a/testing/web-platform/tests/dom/interface-objects.html b/testing/web-platform/tests/dom/interface-objects.html new file mode 100644 index 000000000..df4ca51e4 --- /dev/null +++ b/testing/web-platform/tests/dom/interface-objects.html @@ -0,0 +1,44 @@ + +Interfaces + + +
+ diff --git a/testing/web-platform/tests/dom/interfaces.html b/testing/web-platform/tests/dom/interfaces.html new file mode 100644 index 000000000..618eca1f9 --- /dev/null +++ b/testing/web-platform/tests/dom/interfaces.html @@ -0,0 +1,598 @@ + + +DOM IDL tests + + + + + +

DOM IDL tests

+
+ + + diff --git a/testing/web-platform/tests/dom/lists/DOMTokenList-Iterable.html b/testing/web-platform/tests/dom/lists/DOMTokenList-Iterable.html new file mode 100644 index 000000000..4cf84b12a --- /dev/null +++ b/testing/web-platform/tests/dom/lists/DOMTokenList-Iterable.html @@ -0,0 +1,34 @@ + + +DOMTokenList Iterable Test + + + + diff --git a/testing/web-platform/tests/dom/lists/DOMTokenList-coverage-for-attributes.html b/testing/web-platform/tests/dom/lists/DOMTokenList-coverage-for-attributes.html new file mode 100644 index 000000000..880ce2864 --- /dev/null +++ b/testing/web-platform/tests/dom/lists/DOMTokenList-coverage-for-attributes.html @@ -0,0 +1,51 @@ + + +DOMTokenList coverage for attributes + + +
+ diff --git a/testing/web-platform/tests/dom/lists/DOMTokenList-iteration.html b/testing/web-platform/tests/dom/lists/DOMTokenList-iteration.html new file mode 100644 index 000000000..321bbe00d --- /dev/null +++ b/testing/web-platform/tests/dom/lists/DOMTokenList-iteration.html @@ -0,0 +1,50 @@ + + +DOMTokenList iteration: keys, values, etc. + + + + diff --git a/testing/web-platform/tests/dom/lists/DOMTokenList-stringifier.html b/testing/web-platform/tests/dom/lists/DOMTokenList-stringifier.html new file mode 100644 index 000000000..b125388e0 --- /dev/null +++ b/testing/web-platform/tests/dom/lists/DOMTokenList-stringifier.html @@ -0,0 +1,25 @@ + + +DOMTokenList stringifier + + + + +
+ + diff --git a/testing/web-platform/tests/dom/lists/DOMTokenList-value.html b/testing/web-platform/tests/dom/lists/DOMTokenList-value.html new file mode 100644 index 000000000..b0e39111d --- /dev/null +++ b/testing/web-platform/tests/dom/lists/DOMTokenList-value.html @@ -0,0 +1,24 @@ + + +DOMTokenList value + + + + + + diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-appendChild.html b/testing/web-platform/tests/dom/nodes/CharacterData-appendChild.html new file mode 100644 index 000000000..db7d51b91 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-appendChild.html @@ -0,0 +1,34 @@ + + +Node.appendChild applied to CharacterData + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-appendData.html b/testing/web-platform/tests/dom/nodes/CharacterData-appendData.html new file mode 100644 index 000000000..d754218bf --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-appendData.html @@ -0,0 +1,70 @@ + + +CharacterData.appendData + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-data.html b/testing/web-platform/tests/dom/nodes/CharacterData-data.html new file mode 100644 index 000000000..b3b29ea4d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-data.html @@ -0,0 +1,82 @@ + + +CharacterData.data + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-deleteData.html b/testing/web-platform/tests/dom/nodes/CharacterData-deleteData.html new file mode 100644 index 000000000..02ecbe6ab --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-deleteData.html @@ -0,0 +1,95 @@ + + +CharacterData.deleteData + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-insertData.html b/testing/web-platform/tests/dom/nodes/CharacterData-insertData.html new file mode 100644 index 000000000..5777327c2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-insertData.html @@ -0,0 +1,90 @@ + + +CharacterData.insertData + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-remove.html b/testing/web-platform/tests/dom/nodes/CharacterData-remove.html new file mode 100644 index 000000000..aef9d56bf --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-remove.html @@ -0,0 +1,24 @@ + + +CharacterData.remove + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-replaceData.html b/testing/web-platform/tests/dom/nodes/CharacterData-replaceData.html new file mode 100644 index 000000000..624ee5f23 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-replaceData.html @@ -0,0 +1,163 @@ + + +CharacterData.replaceData + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-substringData.html b/testing/web-platform/tests/dom/nodes/CharacterData-substringData.html new file mode 100644 index 000000000..f20b4b202 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-substringData.html @@ -0,0 +1,137 @@ + + +CharacterData.substringData + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/CharacterData-surrogates.html b/testing/web-platform/tests/dom/nodes/CharacterData-surrogates.html new file mode 100644 index 000000000..ff1014c5f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/CharacterData-surrogates.html @@ -0,0 +1,74 @@ + + +Splitting and joining surrogate pairs in CharacterData methods + + + + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/ChildNode-after.html b/testing/web-platform/tests/dom/nodes/ChildNode-after.html new file mode 100644 index 000000000..b5bf7ab5c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ChildNode-after.html @@ -0,0 +1,166 @@ + + +ChildNode.after + + + + + diff --git a/testing/web-platform/tests/dom/nodes/ChildNode-before.html b/testing/web-platform/tests/dom/nodes/ChildNode-before.html new file mode 100644 index 000000000..865942446 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ChildNode-before.html @@ -0,0 +1,166 @@ + + +ChildNode.before + + + + + diff --git a/testing/web-platform/tests/dom/nodes/ChildNode-remove.js b/testing/web-platform/tests/dom/nodes/ChildNode-remove.js new file mode 100644 index 000000000..c36ba0d11 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ChildNode-remove.js @@ -0,0 +1,30 @@ +function testRemove(node, parent, type) { + test(function() { + assert_true("remove" in node); + assert_equals(typeof node.remove, "function"); + assert_equals(node.remove.length, 0); + }, type + " should support remove()"); + test(function() { + assert_equals(node.parentNode, null, "Node should not have a parent"); + assert_equals(node.remove(), undefined); + assert_equals(node.parentNode, null, "Removed new node should not have a parent"); + }, "remove() should work if " + type + " doesn't have a parent"); + test(function() { + assert_equals(node.parentNode, null, "Node should not have a parent"); + parent.appendChild(node); + assert_equals(node.parentNode, parent, "Appended node should have a parent"); + assert_equals(node.remove(), undefined); + assert_equals(node.parentNode, null, "Removed node should not have a parent"); + assert_array_equals(parent.childNodes, [], "Parent should not have children"); + }, "remove() should work if " + type + " does have a parent"); + test(function() { + assert_equals(node.parentNode, null, "Node should not have a parent"); + var before = parent.appendChild(document.createComment("before")); + parent.appendChild(node); + var after = parent.appendChild(document.createComment("after")); + assert_equals(node.parentNode, parent, "Appended node should have a parent"); + assert_equals(node.remove(), undefined); + assert_equals(node.parentNode, null, "Removed node should not have a parent"); + assert_array_equals(parent.childNodes, [before, after], "Parent should have two children left"); + }, "remove() should work if " + type + " does have a parent and siblings"); +} diff --git a/testing/web-platform/tests/dom/nodes/ChildNode-replaceWith.html b/testing/web-platform/tests/dom/nodes/ChildNode-replaceWith.html new file mode 100644 index 000000000..aab8b17f2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ChildNode-replaceWith.html @@ -0,0 +1,110 @@ + + +ChildNode.replaceWith + + + + + diff --git a/testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js b/testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js new file mode 100644 index 000000000..360b9760e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Comment-Text-constructor.js @@ -0,0 +1,77 @@ +function test_constructor(ctor) { + test(function() { + var object = new window[ctor](); + assert_equals(Object.getPrototypeOf(object), + window[ctor].prototype, "Prototype chain: " + ctor); + assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(object)), + CharacterData.prototype, "Prototype chain: CharacterData"); + assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(object))), + Node.prototype, "Prototype chain: Node"); + }, "new " + ctor + "(): prototype chain"); + + test(function() { + var object = new window[ctor](); + assert_true(object instanceof Node, "Should be a Node"); + assert_true(object instanceof CharacterData, "Should be a CharacterData"); + assert_true(object instanceof window[ctor], "Should be a " + ctor); + }, "new " + ctor + "(): instanceof"); + + test(function() { + var object = new window[ctor](); + assert_equals(object.data, ""); + assert_equals(object.nodeValue, ""); + assert_equals(object.ownerDocument, document); + }, "new " + ctor + "(): no arguments"); + + var arguments = [ + [undefined, ""], + [null, "null"], + [42, "42"], + ["", ""], + ["-", "-"], + ["--", "--"], + ["-->", "-->"], + [" +DOMImplementation.createHTMLDocument + + + + + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js b/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js new file mode 100644 index 000000000..3e7e9aa9b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/DOMImplementation-createHTMLDocument.js @@ -0,0 +1,25 @@ +function createHTMLDocuments(checkDoc) { + var tests = [ + ["", "", ""], + [null, "null", "null"], + [undefined, undefined, ""], + ["foo bar baz", "foo bar baz", "foo bar baz"], + ["foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz"], + ["foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz"], + ["foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz"], + ["foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz"], + ] + + tests.forEach(function(t, i) { + var title = t[0], expectedtitle = t[1], normalizedtitle = t[2] + test(function() { + var doc = document.implementation.createHTMLDocument(title); + checkDoc(doc, expectedtitle, normalizedtitle) + }, "createHTMLDocument test " + i + ": " + t.map(function(el) { return format_value(el) })) + }) + + test(function() { + var doc = document.implementation.createHTMLDocument(); + checkDoc(doc, undefined, "") + }, "Missing title argument"); +} diff --git a/testing/web-platform/tests/dom/nodes/DOMImplementation-hasFeature.html b/testing/web-platform/tests/dom/nodes/DOMImplementation-hasFeature.html new file mode 100644 index 000000000..637565a60 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/DOMImplementation-hasFeature.html @@ -0,0 +1,155 @@ + + +DOMImplementation.hasFeature(feature, version) + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagName.js b/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagName.js new file mode 100644 index 000000000..edbac646d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagName.js @@ -0,0 +1,193 @@ +function test_getElementsByTagName(context, element) { + // TODO: getElementsByTagName("*") + test(function() { + assert_false(context.getElementsByTagName("html") instanceof NodeList, + "Should not return a NodeList") + assert_true(context.getElementsByTagName("html") instanceof HTMLCollection, + "Should return an HTMLCollection") + }, "Interfaces") + + test(function() { + var firstCollection = context.getElementsByTagName("html"), + secondCollection = context.getElementsByTagName("html") + assert_true(firstCollection !== secondCollection || + firstCollection === secondCollection) + }, "Caching is allowed") + + test(function() { + var l = context.getElementsByTagName("nosuchtag") + l[5] = "foopy" + assert_equals(l[5], undefined) + assert_equals(l.item(5), null) + }, "Shouldn't be able to set unsigned properties on a HTMLCollection (non-strict mode)") + + test(function() { + var l = context.getElementsByTagName("nosuchtag") + assert_throws(new TypeError(), function() { + "use strict"; + l[5] = "foopy" + }) + assert_equals(l[5], undefined) + assert_equals(l.item(5), null) + }, "Shouldn't be able to set unsigned properties on a HTMLCollection (strict mode)") + + test(function() { + var l = context.getElementsByTagName("nosuchtag") + var fn = l.item; + assert_equals(fn, HTMLCollection.prototype.item); + l.item = "pass" + assert_equals(l.item, "pass") + assert_equals(HTMLCollection.prototype.item, fn); + }, "Should be able to set expando shadowing a proto prop (item)") + + test(function() { + var l = context.getElementsByTagName("nosuchtag") + var fn = l.namedItem; + assert_equals(fn, HTMLCollection.prototype.namedItem); + l.namedItem = "pass" + assert_equals(l.namedItem, "pass") + assert_equals(HTMLCollection.prototype.namedItem, fn); + }, "Should be able to set expando shadowing a proto prop (namedItem)") + + test(function() { + var t1 = element.appendChild(document.createElement("pre")); + t1.id = "x"; + var t2 = element.appendChild(document.createElement("pre")); + t2.setAttribute("name", "y"); + var t3 = element.appendChild(document.createElementNS("", "pre")); + t3.setAttribute("id", "z"); + var t4 = element.appendChild(document.createElementNS("", "pre")); + t4.setAttribute("name", "w"); + this.add_cleanup(function() { + element.removeChild(t1) + element.removeChild(t2) + element.removeChild(t3) + element.removeChild(t4) + }); + + var list = context.getElementsByTagName('pre'); + var pre = list[0]; + assert_equals(pre.id, "x"); + + var exposedNames = { 'x': 0, 'y': 1, 'z': 2 }; + for (var exposedName in exposedNames) { + assert_equals(list[exposedName], list[exposedNames[exposedName]]); + assert_equals(list[exposedName], list.namedItem(exposedName)); + assert_true(exposedName in list, "'" + exposedName + "' in list"); + assert_true(list.hasOwnProperty(exposedName), + "list.hasOwnProperty('" + exposedName + "')"); + } + + var unexposedNames = ["w"]; + for (var unexposedName of unexposedNames) { + assert_false(unexposedName in list); + assert_false(list.hasOwnProperty(unexposedName)); + assert_equals(list[unexposedName], undefined); + assert_equals(list.namedItem(unexposedName), null); + } + + assert_array_equals(Object.getOwnPropertyNames(list).sort(), + ["0", "1", "2", "3", "x", "y", "z"]); + + var desc = Object.getOwnPropertyDescriptor(list, '0'); + assert_equals(typeof desc, "object", "descriptor should be an object"); + assert_true(desc.enumerable, "desc.enumerable"); + assert_true(desc.configurable, "desc.configurable"); + + desc = Object.getOwnPropertyDescriptor(list, 'x'); + assert_equals(typeof desc, "object", "descriptor should be an object"); + assert_false(desc.enumerable, "desc.enumerable"); + assert_true(desc.configurable, "desc.configurable"); + }, "hasOwnProperty, getOwnPropertyDescriptor, getOwnPropertyNames") + + test(function() { + assert_equals(document.createElementNS("http://www.w3.org/1999/xhtml", "i").localName, "i") // Sanity + var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "I")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_equals(t.localName, "I") + assert_equals(t.tagName, "I") + assert_equals(context.getElementsByTagName("I").length, 0) + assert_equals(context.getElementsByTagName("i").length, 0) + }, "HTML element with uppercase tagName never matches in HTML Documents") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "st")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagName("st"), [t]) + assert_array_equals(context.getElementsByTagName("ST"), []) + }, "Element in non-HTML namespace, no prefix, lowercase name") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "ST")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagName("ST"), [t]) + assert_array_equals(context.getElementsByTagName("st"), []) + }, "Element in non-HTML namespace, no prefix, uppercase name") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "te:st")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagName("st"), []) + assert_array_equals(context.getElementsByTagName("ST"), []) + assert_array_equals(context.getElementsByTagName("te:st"), [t]) + assert_array_equals(context.getElementsByTagName("te:ST"), []) + }, "Element in non-HTML namespace, prefix, lowercase name") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "te:ST")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagName("st"), []) + assert_array_equals(context.getElementsByTagName("ST"), []) + assert_array_equals(context.getElementsByTagName("te:st"), []) + assert_array_equals(context.getElementsByTagName("te:ST"), [t]) + }, "Element in non-HTML namespace, prefix, uppercase name") + + test(function() { + var t = element.appendChild(document.createElement("aÇ")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_equals(t.localName, "aÇ") + assert_array_equals(context.getElementsByTagName("AÇ"), [t], "All uppercase input") + assert_array_equals(context.getElementsByTagName("aÇ"), [t], "Ascii lowercase input") + assert_array_equals(context.getElementsByTagName("aç"), [], "All lowercase input") + }, "Element in HTML namespace, no prefix, non-ascii characters in name") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "AÇ")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagName("AÇ"), [t]) + assert_array_equals(context.getElementsByTagName("aÇ"), []) + assert_array_equals(context.getElementsByTagName("aç"), []) + }, "Element in non-HTML namespace, non-ascii characters in name") + + test(function() { + var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "test:aÇ")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagName("TEST:AÇ"), [t], "All uppercase input") + assert_array_equals(context.getElementsByTagName("test:aÇ"), [t], "Ascii lowercase input") + assert_array_equals(context.getElementsByTagName("test:aç"), [], "All lowercase input") + }, "Element in HTML namespace, prefix, non-ascii characters in name") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "TEST:AÇ")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagName("TEST:AÇ"), [t], "All uppercase input") + assert_array_equals(context.getElementsByTagName("test:aÇ"), [], "Ascii lowercase input") + assert_array_equals(context.getElementsByTagName("test:aç"), [], "All lowercase input") + }, "Element in non-HTML namespace, prefix, non-ascii characters in name") + + test(function() { + var actual = context.getElementsByTagName("*"); + var expected = []; + var get_elements = function(node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child = node.childNodes[i]; + if (child.nodeType === child.ELEMENT_NODE) { + expected.push(child); + get_elements(child); + } + } + } + get_elements(context); + assert_array_equals(actual, expected); + }, "getElementsByTagName('*')") +} diff --git a/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagNameNS.js b/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagNameNS.js new file mode 100644 index 000000000..a1bb31587 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-Element-getElementsByTagNameNS.js @@ -0,0 +1,128 @@ +function test_getElementsByTagNameNS(context, element) { + test(function() { + assert_false(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html") instanceof NodeList, "NodeList") + assert_true(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html") instanceof HTMLCollection, "HTMLCollection") + var firstCollection = context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html"), + secondCollection = context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "html") + assert_true(firstCollection !== secondCollection || firstCollection === secondCollection, + "Caching is allowed.") + }) + + test(function() { + var t = element.appendChild(document.createElementNS("test", "body")) + this.add_cleanup(function() {element.removeChild(t)}) + var actual = context.getElementsByTagNameNS("*", "body"); + var expected = []; + var get_elements = function(node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child = node.childNodes[i]; + if (child.nodeType === child.ELEMENT_NODE) { + if (child.localName == "body") { + expected.push(child); + } + get_elements(child); + } + } + } + get_elements(context); + assert_array_equals(actual, expected); + }, "getElementsByTagNameNS('*', 'body')") + + test(function() { + assert_array_equals(context.getElementsByTagNameNS("", "*"), []); + var t = element.appendChild(document.createElementNS("", "body")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("", "*"), [t]); + }, "Empty string namespace") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "body")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("test", "body"), [t]); + }, "body element in test namespace, no prefix") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "test:body")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("test", "body"), [t]); + }, "body element in test namespace, prefix") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "BODY")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("test", "BODY"), [t]); + assert_array_equals(context.getElementsByTagNameNS("test", "body"), []); + }, "BODY element in test namespace, no prefix") + + test(function() { + var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "abc")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "abc"), [t]); + assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), []); + assert_array_equals(context.getElementsByTagNameNS("test", "ABC"), []); + }, "abc element in html namespace") + + test(function() { + var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "ABC")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "abc"), []); + assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "ABC"), [t]); + }, "ABC element in html namespace") + + test(function() { + var t = element.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "AÇ")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "AÇ"), [t]); + assert_array_equals(context.getElementsByTagNameNS("test", "aÇ"), []); + assert_array_equals(context.getElementsByTagNameNS("test", "aç"), []); + }, "AÇ, case sensitivity") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "test:BODY")) + this.add_cleanup(function() {element.removeChild(t)}) + assert_array_equals(context.getElementsByTagNameNS("test", "BODY"), [t]); + assert_array_equals(context.getElementsByTagNameNS("test", "body"), []); + }, "BODY element in test namespace, prefix") + + test(function() { + var t = element.appendChild(document.createElementNS("test", "test:test")) + this.add_cleanup(function() {element.removeChild(t)}) + var actual = context.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "*"); + var expected = []; + var get_elements = function(node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child = node.childNodes[i]; + if (child.nodeType === child.ELEMENT_NODE) { + if (child !== t) { + expected.push(child); + } + get_elements(child); + } + } + } + get_elements(context); + assert_array_equals(actual, expected); + }, "getElementsByTagNameNS('http://www.w3.org/1999/xhtml', '*')") + + test(function() { + var actual = context.getElementsByTagNameNS("*", "*"); + var expected = []; + var get_elements = function(node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child = node.childNodes[i]; + if (child.nodeType === child.ELEMENT_NODE) { + expected.push(child); + get_elements(child); + } + } + } + get_elements(context); + assert_array_equals(actual, expected); + }, "getElementsByTagNameNS('*', '*')") + + test(function() { + assert_array_equals(context.getElementsByTagNameNS("**", "*"), []); + assert_array_equals(context.getElementsByTagNameNS(null, "0"), []); + assert_array_equals(context.getElementsByTagNameNS(null, "div"), []); + }, "Empty lists") +} diff --git a/testing/web-platform/tests/dom/nodes/Document-URL.sub.html b/testing/web-platform/tests/dom/nodes/Document-URL.sub.html new file mode 100644 index 000000000..8e9601107 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-URL.sub.html @@ -0,0 +1,18 @@ + + +Document.URL with redirect + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-adoptNode.html b/testing/web-platform/tests/dom/nodes/Document-adoptNode.html new file mode 100644 index 000000000..584d5d9fe --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-adoptNode.html @@ -0,0 +1,50 @@ + + +Document.adoptNode + + + +
+x + diff --git a/testing/web-platform/tests/dom/nodes/Document-characterSet-normalization.html b/testing/web-platform/tests/dom/nodes/Document-characterSet-normalization.html new file mode 100644 index 000000000..746792fb7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-characterSet-normalization.html @@ -0,0 +1,373 @@ + +document.characterSet (inputEncoding and charset as aliases) normalization tests + + +
+ + + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-constructor.html b/testing/web-platform/tests/dom/nodes/Document-constructor.html new file mode 100644 index 000000000..11549da4a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-constructor.html @@ -0,0 +1,53 @@ + + + +Document constructor + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_bmp.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_bmp.html new file mode 100644 index 000000000..828643741 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_bmp.html @@ -0,0 +1,15 @@ + +BMP document.contentType === 'image/bmp' + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_css.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_css.html new file mode 100644 index 000000000..0eb35edd5 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_css.html @@ -0,0 +1,15 @@ + +CSS document.contentType === 'text/css' + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html new file mode 100644 index 000000000..79c63644d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html @@ -0,0 +1,15 @@ + +Data URI document.contentType === 'text/plain' when data URI MIME type is not set + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html new file mode 100644 index 000000000..2e82c7c1f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html @@ -0,0 +1,15 @@ + +Data URI document.contentType === 'text/html' when data URI MIME type is set + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_gif.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_gif.html new file mode 100644 index 000000000..8dd66dae5 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_gif.html @@ -0,0 +1,15 @@ + +GIF document.contentType === 'image/gif' + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_html.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_html.html new file mode 100644 index 000000000..2b2d7263e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_html.html @@ -0,0 +1,15 @@ + +HTM document.contentType === 'text/html' + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_javascripturi.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_javascripturi.html new file mode 100644 index 000000000..956589615 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_javascripturi.html @@ -0,0 +1,16 @@ + +Javascript URI document.contentType === 'text/html' + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_jpg.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_jpg.html new file mode 100644 index 000000000..13f57ec8b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_jpg.html @@ -0,0 +1,15 @@ + +JPG document.contentType === 'image/jpeg' + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_01.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_01.html new file mode 100644 index 000000000..87885efba --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_01.html @@ -0,0 +1,15 @@ + +Custom document.contentType === 'text/xml' when explicitly set to this value + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_02.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_02.html new file mode 100644 index 000000000..33870147f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_mimeheader_02.html @@ -0,0 +1,15 @@ + +Custom document.contentType === 'text/html' when explicitly set to this value and an attempt is made to override this value in an HTML meta header + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_png.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_png.html new file mode 100644 index 000000000..a214ad3e9 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_png.html @@ -0,0 +1,15 @@ + +PNG document.contentType === 'image/png' + + +
+ \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_txt.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_txt.html new file mode 100644 index 000000000..f40f641fb --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_txt.html @@ -0,0 +1,15 @@ + +TXT document.contentType === 'text/plain' + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_xml.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_xml.html new file mode 100644 index 000000000..c382de849 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/contenttype_xml.html @@ -0,0 +1,15 @@ + +XML document.contentType === 'application/xml' + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createDocument.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createDocument.html new file mode 100644 index 000000000..78a952de4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createDocument.html @@ -0,0 +1,11 @@ + +document.implementation.createDocument: document.contentType === 'application/xhtml+xml' + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createHTMLDocument.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createHTMLDocument.html new file mode 100644 index 000000000..185e3c8c9 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/createHTMLDocument.html @@ -0,0 +1,11 @@ + +document.implementation.createHTMLDocument: document.contentType === 'text/html' + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/xhr_responseType_document.html b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/xhr_responseType_document.html new file mode 100644 index 000000000..c2fb6c19f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/contentType/xhr_responseType_document.html @@ -0,0 +1,18 @@ + +XHR - retrieve HTML document: document.contentType === 'application/xml' + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.htm b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.htm new file mode 100644 index 000000000..9d235ed07 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.htm @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.txt b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.txt new file mode 100644 index 000000000..9d235ed07 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.txt @@ -0,0 +1 @@ +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.xml b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.xml new file mode 100644 index 000000000..0922ed14b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/blob.xml @@ -0,0 +1,2 @@ + +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/lib.js b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/lib.js new file mode 100644 index 000000000..c41d336c0 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/lib.js @@ -0,0 +1 @@ +var t; \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/style.css b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/style.css new file mode 100644 index 000000000..bb4ff575b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/style.css @@ -0,0 +1,12 @@ +.unknown +{ + background-color:lightblue; +} +.pass +{ + background-color:lime; +} +.fail +{ + background-color:red; +} diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.bmp b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.bmp new file mode 100644 index 000000000..5697c0aef Binary files /dev/null and b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.bmp differ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.gif b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.gif new file mode 100644 index 000000000..91f269207 Binary files /dev/null and b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.gif differ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.jpg b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.jpg new file mode 100644 index 000000000..72b51899e Binary files /dev/null and b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.jpg differ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.png b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.png new file mode 100644 index 000000000..447d9e301 Binary files /dev/null and b/testing/web-platform/tests/dom/nodes/Document-contentType/resources/t.png differ diff --git a/testing/web-platform/tests/dom/nodes/Document-contentType/support/contenttype_setter.py b/testing/web-platform/tests/dom/nodes/Document-contentType/support/contenttype_setter.py new file mode 100644 index 000000000..02eff653c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-contentType/support/contenttype_setter.py @@ -0,0 +1,20 @@ +def main(request, response): + type = request.GET.first("type", None) + subtype = request.GET.first("subtype", None) + if type and subtype: + response.headers["Content-Type"] = type + "/" + subtype + + removeContentType = request.GET.first("removeContentType", None) + if removeContentType: + try: + del response.headers["Content-Type"] + except KeyError: + pass + + content = '' + mimeHead = request.GET.first("mime", None); + if mimeHead: + content += '' % mimeHead + content += "" + + return content diff --git a/testing/web-platform/tests/dom/nodes/Document-createAttribute.html b/testing/web-platform/tests/dom/nodes/Document-createAttribute.html new file mode 100644 index 000000000..b5afa6ed7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createAttribute.html @@ -0,0 +1,43 @@ + + +Document.createAttribute + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-createComment-createTextNode.js b/testing/web-platform/tests/dom/nodes/Document-createComment-createTextNode.js new file mode 100644 index 000000000..62a38d380 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createComment-createTextNode.js @@ -0,0 +1,22 @@ +function test_create(method, iface, nodeType, nodeName) { + ["\u000b", "a -- b", "a-", "-b", null, undefined].forEach(function(value) { + test(function() { + var c = document[method](value); + var expected = String(value); + assert_true(c instanceof iface); + assert_true(c instanceof CharacterData); + assert_true(c instanceof Node); + assert_equals(c.ownerDocument, document); + assert_equals(c.data, expected, "data"); + assert_equals(c.nodeValue, expected, "nodeValue"); + assert_equals(c.textContent, expected, "textContent"); + assert_equals(c.length, expected.length); + assert_equals(c.nodeType, nodeType); + assert_equals(c.nodeName, nodeName); + assert_equals(c.hasChildNodes(), false); + assert_equals(c.childNodes.length, 0); + assert_equals(c.firstChild, null); + assert_equals(c.lastChild, null); + }, method + "(" + format_value(value) + ")"); + }); +} diff --git a/testing/web-platform/tests/dom/nodes/Document-createComment.html b/testing/web-platform/tests/dom/nodes/Document-createComment.html new file mode 100644 index 000000000..a175c3a2f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createComment.html @@ -0,0 +1,21 @@ + + +Document.createComment + + + + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.html new file mode 100644 index 000000000..b80a99a78 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.svg new file mode 100644 index 000000000..b80a99a78 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xhtml new file mode 100644 index 000000000..b80a99a78 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xml new file mode 100644 index 000000000..b80a99a78 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_mathml.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.html new file mode 100644 index 000000000..dc1ced5b6 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.svg new file mode 100644 index 000000000..dc1ced5b6 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xhtml new file mode 100644 index 000000000..dc1ced5b6 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xml new file mode 100644 index 000000000..dc1ced5b6 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_svg.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.html new file mode 100644 index 000000000..6c70bcfe4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.svg new file mode 100644 index 000000000..6c70bcfe4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xhtml new file mode 100644 index 000000000..6c70bcfe4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xml new file mode 100644 index 000000000..6c70bcfe4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.html new file mode 100644 index 000000000..e69de29bb diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.svg new file mode 100644 index 000000000..e69de29bb diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml new file mode 100644 index 000000000..e69de29bb diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/empty.xml new file mode 100644 index 000000000..e69de29bb diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py new file mode 100755 index 000000000..88c4da198 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/generate.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +import os +import sys + +THIS_NAME = "generate.py" + +# Note: these lists must be kept in sync with the lists in +# Document-createElement-namespace.html, and this script must be run whenever +# the lists are updated. (We could keep the lists in a shared JSON file, but +# seems like too much effort.) +FILES = ( + ("empty", ""), + ("minimal_html", ""), + + ("xhtml", ''), + ("svg", ''), + ("mathml", ''), + + ("bare_xhtml", ""), + ("bare_svg", ""), + ("bare_mathml", ""), + + ("xhtml_ns_removed", """\ + + + +"""), + ("xhtml_ns_changed", """\ + + + +"""), +) + +EXTENSIONS = ( + "html", + "xhtml", + "xml", + "svg", + # Was not able to get server MIME type working properly :( + #"mml", +) + +def __main__(): + if len(sys.argv) > 1: + print "No arguments expected, aborting" + return + + if not os.access(THIS_NAME, os.F_OK): + print "Must be run from the directory of " + THIS_NAME + ", aborting" + return + + for name in os.listdir("."): + if name == THIS_NAME: + continue + os.remove(name) + + manifest = open("MANIFEST", "w") + + for name, contents in FILES: + for extension in EXTENSIONS: + f = open(name + "." + extension, "w") + f.write(contents) + f.close() + manifest.write("support " + name + "." + extension + "\n") + + manifest.close() + +__main__() diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.html new file mode 100644 index 000000000..0bec8e99e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.svg new file mode 100644 index 000000000..0bec8e99e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xhtml new file mode 100644 index 000000000..0bec8e99e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xml new file mode 100644 index 000000000..0bec8e99e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/mathml.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.html new file mode 100644 index 000000000..a33d9859a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.svg new file mode 100644 index 000000000..a33d9859a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xhtml new file mode 100644 index 000000000..a33d9859a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xml new file mode 100644 index 000000000..a33d9859a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/minimal_html.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.html new file mode 100644 index 000000000..64def4af7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.svg new file mode 100644 index 000000000..64def4af7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xhtml new file mode 100644 index 000000000..64def4af7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xml new file mode 100644 index 000000000..64def4af7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/svg.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.html new file mode 100644 index 000000000..1cba99824 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.svg new file mode 100644 index 000000000..1cba99824 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xhtml new file mode 100644 index 000000000..1cba99824 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xhtml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xml new file mode 100644 index 000000000..1cba99824 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.html new file mode 100644 index 000000000..b228c7f74 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.html @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.svg new file mode 100644 index 000000000..b228c7f74 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.svg @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xhtml new file mode 100644 index 000000000..b228c7f74 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xhtml @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xml new file mode 100644 index 000000000..b228c7f74 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.xml @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.html new file mode 100644 index 000000000..dba395fed --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.html @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.svg b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.svg new file mode 100644 index 000000000..dba395fed --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.svg @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xhtml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xhtml new file mode 100644 index 000000000..dba395fed --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xhtml @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xml b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xml new file mode 100644 index 000000000..dba395fed --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.xml @@ -0,0 +1,7 @@ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement-namespace.html b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace.html new file mode 100644 index 000000000..add66bf9a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement-namespace.html @@ -0,0 +1,119 @@ + +document.createElement() namespace tests + +
+ + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElement.html b/testing/web-platform/tests/dom/nodes/Document-createElement.html new file mode 100644 index 000000000..bacaff0f6 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElement.html @@ -0,0 +1,157 @@ + + +Document.createElement + + + + + + + +
+ + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElementNS.html b/testing/web-platform/tests/dom/nodes/Document-createElementNS.html new file mode 100644 index 000000000..68341bcd4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElementNS.html @@ -0,0 +1,226 @@ + + +Document.createElementNS + + + + +
+ + + diff --git a/testing/web-platform/tests/dom/nodes/Document-createElementNS.js b/testing/web-platform/tests/dom/nodes/Document-createElementNS.js new file mode 100644 index 000000000..b390712aa --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createElementNS.js @@ -0,0 +1,185 @@ +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", "INVALID_CHARACTER_ERR"], + [null, "}foo", "INVALID_CHARACTER_ERR"], + [null, "f}oo", "INVALID_CHARACTER_ERR"], + [null, "foo}", "INVALID_CHARACTER_ERR"], + [null, "\uFFFFfoo", "INVALID_CHARACTER_ERR"], + [null, "f\uFFFFoo", "INVALID_CHARACTER_ERR"], + [null, "foo\uFFFF", "INVALID_CHARACTER_ERR"], + [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", "NAMESPACE_ERR"], + ["/", "f:oo", null], + ["/", "foo:", "NAMESPACE_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", "NAMESPACE_ERR"], + ["http://www.w3.org/XML/1998/namespace", "f:oo", null], + ["http://www.w3.org/XML/1998/namespace", "foo:", "NAMESPACE_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:", "NAMESPACE_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", "NAMESPACE_ERR"], + ["foo:", "f:oo", null], + ["foo:", "foo:", "NAMESPACE_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], +] diff --git a/testing/web-platform/tests/dom/nodes/Document-createEvent.html b/testing/web-platform/tests/dom/nodes/Document-createEvent.html new file mode 100644 index 000000000..29a2c010e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createEvent.html @@ -0,0 +1,154 @@ + + +Document.createEvent + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-createEvent.js b/testing/web-platform/tests/dom/nodes/Document-createEvent.js new file mode 100644 index 000000000..e55487ada --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createEvent.js @@ -0,0 +1,36 @@ +var aliases = { + "AnimationEvent": "AnimationEvent", + "BeforeUnloadEvent": "BeforeUnloadEvent", + "CloseEvent": "CloseEvent", + "CompositionEvent": "CompositionEvent", + "CustomEvent": "CustomEvent", + "DeviceMotionEvent": "DeviceMotionEvent", + "DeviceOrientationEvent": "DeviceOrientationEvent", + "DragEvent": "DragEvent", + "ErrorEvent": "ErrorEvent", + "Event": "Event", + "Events": "Event", + "FocusEvent": "FocusEvent", + "HashChangeEvent": "HashChangeEvent", + "HTMLEvents": "Event", + "IDBVersionChangeEvent": "IDBVersionChangeEvent", + "KeyboardEvent": "KeyboardEvent", + "MessageEvent": "MessageEvent", + "MouseEvent": "MouseEvent", + "MouseEvents": "MouseEvent", + "PageTransitionEvent": "PageTransitionEvent", + "PopStateEvent": "PopStateEvent", + "ProgressEvent": "ProgressEvent", + "StorageEvent": "StorageEvent", + "SVGEvents": "Event", + "SVGZoomEvent": "SVGZoomEvent", + "SVGZoomEvents": "SVGZoomEvent", + "TextEvent": "CompositionEvent", + "TouchEvent": "TouchEvent", + "TrackEvent": "TrackEvent", + "TransitionEvent": "TransitionEvent", + "UIEvent": "UIEvent", + "UIEvents": "UIEvent", + "WebGLContextEvent": "WebGLContextEvent", + "WheelEvent": "WheelEvent", +}; diff --git a/testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction-xhtml.xhtml new file mode 100644 index 000000000..d06f70fdc --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction-xhtml.xhtml @@ -0,0 +1,15 @@ + + +Document.createProcessingInstruction in XML documents + + + + + + + + +
+ + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction.js b/testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction.js new file mode 100644 index 000000000..114ac35d9 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createProcessingInstruction.js @@ -0,0 +1,39 @@ +test(function() { + var invalid = [ + ["A", "?>"], + ["\u00B7A", "x"], + ["\u00D7A", "x"], + ["A\u00D7", "x"], + ["\\A", "x"], + ["\f", "x"], + [0, "x"], + ["0", "x"] + ], + valid = [ + ["xml:fail", "x"], + ["A\u00B7A", "x"], + ["a0", "x"] + ] + + for (var i = 0, il = invalid.length; i < il; i++) { + test(function() { + assert_throws("INVALID_CHARACTER_ERR", function() { + document.createProcessingInstruction(invalid[i][0], invalid[i][1]) + }) + }, "Should throw an INVALID_CHARACTER_ERR for target " + + format_value(invalid[i][0]) + " and data " + + format_value(invalid[i][1]) + ".") + } + for (var i = 0, il = valid.length; i < il; ++i) { + test(function() { + var pi = document.createProcessingInstruction(valid[i][0], valid[i][1]); + assert_equals(pi.target, valid[i][0]); + assert_equals(pi.data, valid[i][1]); + assert_equals(pi.ownerDocument, document); + assert_true(pi instanceof ProcessingInstruction); + assert_true(pi instanceof Node); + }, "Should get a ProcessingInstruction for target " + + format_value(valid[i][0]) + " and data " + + format_value(valid[i][1]) + ".") + } +}) diff --git a/testing/web-platform/tests/dom/nodes/Document-createTextNode.html b/testing/web-platform/tests/dom/nodes/Document-createTextNode.html new file mode 100644 index 000000000..ccc1b1b77 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createTextNode.html @@ -0,0 +1,21 @@ + + +Document.createTextNode + + + + + + + + + + + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-createTreeWalker.html b/testing/web-platform/tests/dom/nodes/Document-createTreeWalker.html new file mode 100644 index 000000000..f8f04b068 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-createTreeWalker.html @@ -0,0 +1,42 @@ + + +Document.createTreeWalker + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-doctype.html b/testing/web-platform/tests/dom/nodes/Document-doctype.html new file mode 100644 index 000000000..75bfd8506 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-doctype.html @@ -0,0 +1,21 @@ + + + +Document.doctype + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-getElementById.html b/testing/web-platform/tests/dom/nodes/Document-getElementById.html new file mode 100644 index 000000000..1dec4c085 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-getElementById.html @@ -0,0 +1,350 @@ + + +Document.getElementById + + + + + +
+ + +
+ + +
+ + +
+

P

+ +
+ + +
+
+
+
+
+ + + + diff --git a/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName-xhtml.xhtml new file mode 100644 index 000000000..309a29ae7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName-xhtml.xhtml @@ -0,0 +1,104 @@ + + + +Document.getElementsByTagName + + + + +
+

+
+
+
diff --git a/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName.html b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName.html
new file mode 100644
index 000000000..00e3435c4
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagName.html
@@ -0,0 +1,11 @@
+
+
+Document.getElementsByTagName
+
+
+
+
+
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-getElementsByTagNameNS.html b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagNameNS.html new file mode 100644 index 000000000..063dc9821 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-getElementsByTagNameNS.html @@ -0,0 +1,11 @@ + + +Document.getElementsByTagNameNS + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-implementation.html b/testing/web-platform/tests/dom/nodes/Document-implementation.html new file mode 100644 index 000000000..aed525965 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-implementation.html @@ -0,0 +1,20 @@ + + +Document.implementation + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Document-importNode.html b/testing/web-platform/tests/dom/nodes/Document-importNode.html new file mode 100644 index 000000000..32e2f3169 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Document-importNode.html @@ -0,0 +1,57 @@ + + +Document.importNode + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/DocumentType-literal-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/DocumentType-literal-xhtml.xhtml new file mode 100644 index 000000000..2b6965c14 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/DocumentType-literal-xhtml.xhtml @@ -0,0 +1,23 @@ + + + +DocumentType literals + + + + + + + +
+ + + diff --git a/testing/web-platform/tests/dom/nodes/DocumentType-literal.html b/testing/web-platform/tests/dom/nodes/DocumentType-literal.html new file mode 100644 index 000000000..a755c397b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/DocumentType-literal.html @@ -0,0 +1,17 @@ + +DocumentType literals + + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/DocumentType-remove.html b/testing/web-platform/tests/dom/nodes/DocumentType-remove.html new file mode 100644 index 000000000..9e18d3511 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/DocumentType-remove.html @@ -0,0 +1,16 @@ + + +DocumentType.remove + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-childElement-null-svg.svg b/testing/web-platform/tests/dom/nodes/Element-childElement-null-svg.svg new file mode 100644 index 000000000..388482874 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElement-null-svg.svg @@ -0,0 +1,20 @@ + + +Null test + + + +Test of firstElementChild and lastChildElement returning null +Test + + +test(function() { + var parentEl = document.getElementById("parentEl") + assert_equals(parentEl.firstElementChild, null) + assert_equals(parentEl.lastElementChild, null) +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElement-null-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-childElement-null-xhtml.xhtml new file mode 100644 index 000000000..daedab6d9 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElement-null-xhtml.xhtml @@ -0,0 +1,20 @@ + + + +Null Test + + + + +

Test of firstElementChild and lastChildElement returning null

+
+

Test.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElement-null.html b/testing/web-platform/tests/dom/nodes/Element-childElement-null.html new file mode 100644 index 000000000..1863a41da --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElement-null.html @@ -0,0 +1,15 @@ + + +Null test + + +

Test of firstElementChild and lastChildElement returning null

+
+

Test.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-svg.svg b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-svg.svg new file mode 100644 index 000000000..d149f1ea3 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-svg.svg @@ -0,0 +1,22 @@ + + +Dynamic Adding of Elements + + + +Test of Dynamic Adding of Elements +The result of this test is +unknown. + + +test(function() { + var parentEl = document.getElementById("parentEl"); + var newChild = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + parentEl.appendChild(newChild); + assert_equals(parentEl.childElementCount, 2) +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-xhtml.xhtml new file mode 100644 index 000000000..c97ed1965 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add-xhtml.xhtml @@ -0,0 +1,22 @@ + + + +Dynamic Adding of Elements + + + + +

Test of Dynamic Adding of Elements

+
+

The result of this test is +logged above.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add.html b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add.html new file mode 100644 index 000000000..3e7490b21 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-add.html @@ -0,0 +1,17 @@ + + +Dynamic Adding of Elements + + +

Test of Dynamic Adding of Elements

+
+

The result of this test is +logged above.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-svg.svg b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-svg.svg new file mode 100644 index 000000000..bf99de65a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-svg.svg @@ -0,0 +1,22 @@ + + +Dynamic Removal of Elements + + + +Test of Dynamic Removal of Elements +The result of this test is +unknown. + + +test(function() { + var parentEl = document.getElementById("parentEl"); + var lec = parentEl.lastElementChild; + parentEl.removeChild(lec); + assert_equals(parentEl.childElementCount, 1) +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-xhtml.xhtml new file mode 100644 index 000000000..f0009b0a7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove-xhtml.xhtml @@ -0,0 +1,22 @@ + + + +Dynamic Removal of Elements + + + + +

Test of Removal Adding of Elements

+
+

The result of this test is +logged above.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove.html b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove.html new file mode 100644 index 000000000..3f7e7c7ea --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-dynamic-remove.html @@ -0,0 +1,17 @@ + + +Dynamic Removal of Elements + + +

Test of Dynamic Removal of Elements

+
+

The result of this test is +unknown.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-svg.svg b/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-svg.svg new file mode 100644 index 000000000..8ba574360 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-svg.svg @@ -0,0 +1,19 @@ + + +childElementCount + + + +Test of childElementCount with No Child Element Nodes +Test + + +test(function() { + var parentEl = document.getElementById("parentEl") + assert_equals(parentEl.childElementCount, 0) +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-xhtml.xhtml new file mode 100644 index 000000000..f567a20c2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild-xhtml.xhtml @@ -0,0 +1,19 @@ + + + +childElementCount without Child Element Nodes + + + + +

Test of childElementCount with No Child Element Nodes

+
+

Test.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild.html b/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild.html new file mode 100644 index 000000000..fb52fb205 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-nochild.html @@ -0,0 +1,14 @@ + + +childElementCount without Child Element Nodes + + +

Test of childElementCount with No Child Element Nodes

+
+

Test.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-svg.svg b/testing/web-platform/tests/dom/nodes/Element-childElementCount-svg.svg new file mode 100644 index 000000000..ff93eff62 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-svg.svg @@ -0,0 +1,25 @@ + + +childElementCount + + + +Test of childElementCount +The result of this test is +unknown. + + + + + + +test(function() { + var parentEl = document.getElementById("parentEl") + assert_true("childElementCount" in parentEl) + assert_equals(parentEl.childElementCount, 3) +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-childElementCount-xhtml.xhtml new file mode 100644 index 000000000..6b719ff7a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount-xhtml.xhtml @@ -0,0 +1,25 @@ + + + +childElementCount + + + + +

Test of childElementCount

+
+

The result of this test is +unknown. + + + +

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-childElementCount.html b/testing/web-platform/tests/dom/nodes/Element-childElementCount.html new file mode 100644 index 000000000..8cfe567f9 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-childElementCount.html @@ -0,0 +1,20 @@ + + +childElementCount + + +

Test of childElementCount

+
+

The result of this test is +given above. + + + +

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-children.html b/testing/web-platform/tests/dom/nodes/Element-children.html new file mode 100644 index 000000000..c0210f966 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-children.html @@ -0,0 +1,58 @@ + +HTMLCollection edge cases + + +
+
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-classlist.html b/testing/web-platform/tests/dom/nodes/Element-classlist.html new file mode 100644 index 000000000..22b499e93 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-classlist.html @@ -0,0 +1,407 @@ + + + + Element.classList in case-sensitive documents + + + + + + + + +
+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-closest.html b/testing/web-platform/tests/dom/nodes/Element-closest.html new file mode 100644 index 000000000..386e3bd25 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-closest.html @@ -0,0 +1,73 @@ + + +Test for Element.closest + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity-xhtml.xhtml new file mode 100644 index 000000000..f28005e9c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity-xhtml.xhtml @@ -0,0 +1,27 @@ + +unknown."> +]> + + +Entity References + + + + +

Test of Entity References

+
+

The result of this test is &tree;

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity.svg b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity.svg new file mode 100644 index 000000000..3a20ea79a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-entity.svg @@ -0,0 +1,26 @@ + +unknown."> +]> + +Entity References + + + +Test of Entity References +The result of this test is &tree; + + +test(function() { + var parentEl = document.getElementById("parentEl") + var fec = parentEl.firstElementChild; + assert_true(!!fec) + assert_equals(fec.nodeType, 1) + assert_equals(fec.getAttribute("id"), "first_element_child") +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-svg.svg b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-svg.svg new file mode 100644 index 000000000..d42c08777 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-svg.svg @@ -0,0 +1,26 @@ + + +firstElementChild with namespaces + + + +Test of firstElementChild with namespaces + + + + + +test(function() { + var parentEl = document.getElementById("parentEl"); + var fec = parentEl.firstElementChild; + assert_true(!!fec) + assert_equals(fec.nodeType, 1) + assert_equals(fec.getAttribute("id"), "first_element_child") + assert_equals(fec.localName, "dill") +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-xhtml.xhtml new file mode 100644 index 000000000..29441d278 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace-xhtml.xhtml @@ -0,0 +1,28 @@ + + + +firstElementChild with namespaces + + + + +

Test of firstElementChild with namespaces

+
+ +
+
+

The result of this test is +logged above.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace.html b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace.html new file mode 100644 index 000000000..629deab3a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-namespace.html @@ -0,0 +1,21 @@ + + +firstElementChild with namespaces + + +

Test of firstElementChild with namespaces

+
+

The result of this test is a unknown.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild-svg.svg b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-svg.svg new file mode 100644 index 000000000..359c5b82c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-svg.svg @@ -0,0 +1,23 @@ + + +firstElementChild + + + +Test of firstElementChild +The result of this test is +unknown. + + +test(function() { + var parentEl = document.getElementById("parentEl"); + var fec = parentEl.firstElementChild; + assert_true(!!fec) + assert_equals(fec.nodeType, 1) + assert_equals(fec.getAttribute("id"), "first_element_child") +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-xhtml.xhtml new file mode 100644 index 000000000..302052b0f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild-xhtml.xhtml @@ -0,0 +1,23 @@ + + + +firstElementChild + + + + +

Test of firstElementChild

+
+

The result of this test is +logged above.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-firstElementChild.html b/testing/web-platform/tests/dom/nodes/Element-firstElementChild.html new file mode 100644 index 000000000..12a0c5946 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-firstElementChild.html @@ -0,0 +1,18 @@ + + +firstElementChild + + +

Test of firstElementChild

+
+

The result of this test is +logged above.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-getElementsByClassName.html b/testing/web-platform/tests/dom/nodes/Element-getElementsByClassName.html new file mode 100644 index 000000000..332c3060f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-getElementsByClassName.html @@ -0,0 +1,21 @@ + +Element.getElementsByClassName + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml new file mode 100644 index 000000000..f3f286eaf --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess-iframe.xml @@ -0,0 +1 @@ + diff --git a/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html new file mode 100644 index 000000000..cc118d42c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName-change-document-HTMLNess.html @@ -0,0 +1,50 @@ + + + + + + + diff --git a/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName.html b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName.html new file mode 100644 index 000000000..87c4fe934 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagName.html @@ -0,0 +1,30 @@ + + +Element.getElementsByTagName + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-getElementsByTagNameNS.html b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagNameNS.html new file mode 100644 index 000000000..f826afc39 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-getElementsByTagNameNS.html @@ -0,0 +1,37 @@ + + +Element.getElementsByTagNameNS + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-hasAttributes.html b/testing/web-platform/tests/dom/nodes/Element-hasAttributes.html new file mode 100644 index 000000000..fbb9c233b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-hasAttributes.html @@ -0,0 +1,40 @@ + + + + + + + + +
+

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-insertAdjacentElement.html b/testing/web-platform/tests/dom/nodes/Element-insertAdjacentElement.html new file mode 100644 index 000000000..d03e56680 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-insertAdjacentElement.html @@ -0,0 +1,91 @@ + + + + + + +
+
+
+ + + + + diff --git a/testing/web-platform/tests/dom/nodes/Element-insertAdjacentText.html b/testing/web-platform/tests/dom/nodes/Element-insertAdjacentText.html new file mode 100644 index 000000000..0fafabb51 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-insertAdjacentText.html @@ -0,0 +1,76 @@ + + + + + + +
+
+
+ + diff --git a/testing/web-platform/tests/dom/nodes/Element-lastElementChild-svg.svg b/testing/web-platform/tests/dom/nodes/Element-lastElementChild-svg.svg new file mode 100644 index 000000000..1cec4a130 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-lastElementChild-svg.svg @@ -0,0 +1,22 @@ + + +lastElementChild + + + +Test of lastElementChild +The result of this test is not known. + + +test(function() { + var parentEl = document.getElementById("parentEl"); + var lec = parentEl.lastElementChild; + assert_true(!!lec) + assert_equals(lec.nodeType, 1) + assert_equals(lec.getAttribute("id"), "last_element_child") +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-lastElementChild-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-lastElementChild-xhtml.xhtml new file mode 100644 index 000000000..3150b92a4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-lastElementChild-xhtml.xhtml @@ -0,0 +1,22 @@ + + + +firstElementChild + + + + +

Test of firstElementChild

+
+

The result of this test is logged above.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-lastElementChild.html b/testing/web-platform/tests/dom/nodes/Element-lastElementChild.html new file mode 100644 index 000000000..de7aebdf2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-lastElementChild.html @@ -0,0 +1,17 @@ + + +lastElementChild + + +

Test of lastElementChild

+
+

The result of this test is logged above.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-matches.html b/testing/web-platform/tests/dom/nodes/Element-matches.html new file mode 100644 index 000000000..e04c0f9d1 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-matches.html @@ -0,0 +1,87 @@ + + +Selectors-API Level 2 Test Suite: HTML with Selectors Level 3 + + + + + + + + +
This test requires JavaScript.
+ + diff --git a/testing/web-platform/tests/dom/nodes/Element-matches.js b/testing/web-platform/tests/dom/nodes/Element-matches.js new file mode 100644 index 000000000..1bc0f3d08 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-matches.js @@ -0,0 +1,127 @@ +/* + * Check that the matches() method exists on the given Node + */ +function interfaceCheckMatches(type, obj) { + if (obj.nodeType === obj.ELEMENT_NODE) { + test(function() { + assert_idl_attribute(obj, "matches", type + " supports matches"); + }, type + " supports matches") + } +} + +function runSpecialMatchesTests(type, element) { + test(function() { // 1 + if (element.tagName.toLowerCase() === "null") { + assert_true(element.matches(null), "An element with the tag name '" + element.tagName.toLowerCase() + "' should match."); + } else { + assert_false(element.matches(null), "An element with the tag name '" + element.tagName.toLowerCase() + "' should not match."); + } + }, type + ".matches(null)") + + test(function() { // 2 + if (element.tagName.toLowerCase() === "undefined") { + assert_true(element.matches(undefined), "An element with the tag name '" + element.tagName.toLowerCase() + "' should match."); + } else { + assert_false(element.matches(undefined), "An element with the tag name '" + element.tagName.toLowerCase() + "' should not match."); + } + }, type + ".matches(undefined)") + + test(function() { // 3 + assert_throws(TypeError(), function() { + element.matches(); + }, "This should throw a TypeError.") + }, type + ".matches no parameter") +} + +/* + * Execute queries with the specified invalid selectors for matches() + * Only run these tests when errors are expected. Don't run for valid selector tests. + */ +function runInvalidSelectorTestMatches(type, root, selectors) { + if (root.nodeType === root.ELEMENT_NODE) { + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + + test(function() { + assert_throws("SyntaxError", function() { + root.matches(q) + }) + }, type + ".matches: " + n + ": " + q); + } + } +} + +function runMatchesTest(type, root, selectors, docType) { + var nodeType = getNodeType(root); + + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + var e = s["expect"]; + var u = s["unexpected"]; + + var ctx = s["ctx"]; + var ref = s["ref"]; + + if ((!s["exclude"] || (s["exclude"].indexOf(nodeType) === -1 && s["exclude"].indexOf(docType) === -1)) + && (s["testType"] & TEST_MATCH) ) { + + if (ctx && !ref) { + test(function() { + var j, element, refNode; + for (j = 0; j < e.length; j++) { + element = root.querySelector("#" + e[j]); + refNode = root.querySelector(ctx); + assert_true(element.matches(q, refNode), "The element #" + e[j] + " should match the selector.") + } + + if (u) { + for (j = 0; j < u.length; j++) { + element = root.querySelector("#" + u[j]); + refNode = root.querySelector(ctx); + assert_false(element.matches(q, refNode), "The element #" + u[j] + " should not match the selector.") + } + } + }, type + " Element.matches: " + n + " (with refNode Element): " + q); + } + + if (ref) { + test(function() { + var j, element, refNodes; + for (j = 0; j < e.length; j++) { + element = root.querySelector("#" + e[j]); + refNodes = root.querySelectorAll(ref); + assert_true(element.matches(q, refNodes), "The element #" + e[j] + " should match the selector.") + } + + if (u) { + for (j = 0; j < u.length; j++) { + element = root.querySelector("#" + u[j]); + refNodes = root.querySelectorAll(ref); + assert_false(element.matches(q, refNodes), "The element #" + u[j] + " should not match the selector.") + } + } + }, type + " Element.matches: " + n + " (with refNodes NodeList): " + q); + } + + if (!ctx && !ref) { + test(function() { + for (var j = 0; j < e.length; j++) { + var element = root.querySelector("#" + e[j]); + assert_true(element.matches(q), "The element #" + e[j] + " should match the selector.") + } + + if (u) { + for (j = 0; j < u.length; j++) { + element = root.querySelector("#" + u[j]); + assert_false(element.matches(q), "The element #" + u[j] + " should not match the selector.") + } + } + }, type + " Element.matches: " + n + " (with no refNodes): " + q); + } + } + } +} diff --git a/testing/web-platform/tests/dom/nodes/Element-nextElementSibling-svg.svg b/testing/web-platform/tests/dom/nodes/Element-nextElementSibling-svg.svg new file mode 100644 index 000000000..3e17cad20 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-nextElementSibling-svg.svg @@ -0,0 +1,23 @@ + + +nextElementSibling + + + +Test of nextElementSibling +The result of this test is unknown. + + +test(function() { + var parentEl = document.getElementById("parentEl"); + var fec = document.getElementById("first_element_child"); + var nes = fec.nextElementSibling; + assert_true(!!nes) + assert_equals(nes.nodeType, 1) + assert_equals(nes.getAttribute("id"), "last_element_child") +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-nextElementSibling-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-nextElementSibling-xhtml.xhtml new file mode 100644 index 000000000..915209bda --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-nextElementSibling-xhtml.xhtml @@ -0,0 +1,23 @@ + + + +nextElementSibling + + + + +

Test of nextElementSibling

+
+

The result of this test is unknown.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-nextElementSibling.html b/testing/web-platform/tests/dom/nodes/Element-nextElementSibling.html new file mode 100644 index 000000000..985c602f4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-nextElementSibling.html @@ -0,0 +1,18 @@ + + +nextElementSibling + + +

Test of nextElementSibling

+
+

The result of this test is unknown.

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-previousElementSibling-svg.svg b/testing/web-platform/tests/dom/nodes/Element-previousElementSibling-svg.svg new file mode 100644 index 000000000..671d2c87f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-previousElementSibling-svg.svg @@ -0,0 +1,28 @@ + + +previousElementSibling + + + +Test of previousElementSibling +The result of this test is +unknown. + + + +fnord + + +test(function() { + var parentEl = document.getElementById("parentEl"); + var lec = document.getElementById("last_element_child"); + var pes = lec.previousElementSibling; + assert_true(!!pes) + assert_equals(pes.nodeType, 1) + assert_equals(pes.getAttribute("id"), "middle_element_child") +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-previousElementSibling-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-previousElementSibling-xhtml.xhtml new file mode 100644 index 000000000..7fbbc6d38 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-previousElementSibling-xhtml.xhtml @@ -0,0 +1,28 @@ + + + +previousElementSibling + + + + +

Test of previousElementSibling

+
+

The result of this test is +unknown. + + + +

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-previousElementSibling.html b/testing/web-platform/tests/dom/nodes/Element-previousElementSibling.html new file mode 100644 index 000000000..02c7b16df --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-previousElementSibling.html @@ -0,0 +1,23 @@ + + +previousElementSibling + + +

Test of previousElementSibling

+
+

The result of this test is +unknown. + + + +

+ diff --git a/testing/web-platform/tests/dom/nodes/Element-remove.html b/testing/web-platform/tests/dom/nodes/Element-remove.html new file mode 100644 index 000000000..ab642d660 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-remove.html @@ -0,0 +1,16 @@ + + +Element.remove + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-removeAttributeNS.html b/testing/web-platform/tests/dom/nodes/Element-removeAttributeNS.html new file mode 100644 index 000000000..a2773e6f1 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-removeAttributeNS.html @@ -0,0 +1,18 @@ + +Element.removeAttributeNS + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Element-siblingElement-null-svg.svg b/testing/web-platform/tests/dom/nodes/Element-siblingElement-null-svg.svg new file mode 100644 index 000000000..48c981b8c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-siblingElement-null-svg.svg @@ -0,0 +1,20 @@ + + +Null test + + + +Test of previousElementSibling and nextElementSibling returning null +The result of this test is unknown. + + +test(function() { + var fec = document.getElementById("first_element_child"); + assert_equals(fec.previousElementSibling, null) + assert_equals(fec.nextElementSibling, null) +}) + + diff --git a/testing/web-platform/tests/dom/nodes/Element-siblingElement-null-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Element-siblingElement-null-xhtml.xhtml new file mode 100644 index 000000000..fcf4d54ff --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-siblingElement-null-xhtml.xhtml @@ -0,0 +1,20 @@ + + + +Null Test + + + + +

Test of previousElementSibling and nextElementSibling returning null

+
+

The result of this test is unknown.

+ + + diff --git a/testing/web-platform/tests/dom/nodes/Element-siblingElement-null.html b/testing/web-platform/tests/dom/nodes/Element-siblingElement-null.html new file mode 100644 index 000000000..a7920b4fb --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-siblingElement-null.html @@ -0,0 +1,16 @@ + + +Null test + + +

Test of previousElementSibling and nextElementSibling returning null

+
+

The result of this test is unknown.

+ + diff --git a/testing/web-platform/tests/dom/nodes/Element-tagName.html b/testing/web-platform/tests/dom/nodes/Element-tagName.html new file mode 100644 index 000000000..035a23cc5 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Element-tagName.html @@ -0,0 +1,50 @@ + +Element.tagName + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/MutationObserver-attributes.html b/testing/web-platform/tests/dom/nodes/MutationObserver-attributes.html new file mode 100644 index 000000000..6721b7eec --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/MutationObserver-attributes.html @@ -0,0 +1,406 @@ + + +MutationObservers: attributes mutations + + + +

MutationObservers: attributes mutations

+
+ +
+

+ +

+

+

+

+ + +

+

+

+

+ +

+

+

+

+

+ +

+

+

+ +

+

+

+

+

+

+ +

+

+ +

+

+

+ +

+

+ + +

+

+ +

+

+

+ +

+

+ +

+

+ +

+ +
+ + diff --git a/testing/web-platform/tests/dom/nodes/MutationObserver-characterData.html b/testing/web-platform/tests/dom/nodes/MutationObserver-characterData.html new file mode 100644 index 000000000..addaef03d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/MutationObserver-characterData.html @@ -0,0 +1,215 @@ + + +MutationObservers: characterData mutations + + + +

MutationObservers: characterData mutations

+
+ +
+ +

text content

+ +

text content

+ +

CHAN

+

CHANGED

+

CHANGED

+ +

CHGED

+

CHANGED

+

CHANGED

+ +

CCCHANGED

+

CHANGED

+ +

CCCHANGED

+

CHANGED

+ +

+ +

+ +

CHANN

+

CHANN

+ +

CHANN

+

CHANN

+ +

CHANN

+ +
+ + diff --git a/testing/web-platform/tests/dom/nodes/MutationObserver-childList.html b/testing/web-platform/tests/dom/nodes/MutationObserver-childList.html new file mode 100644 index 000000000..e4c674e02 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/MutationObserver-childList.html @@ -0,0 +1,434 @@ + + +MutationObservers: childList mutations + + + +

MutationObservers: childList mutations

+
+ +
+

+text content +text content +text content +text content +text content +text content +

+ +
+
+

text content

+ +

text content

+

+

+

text content

+ +

PAS

+

CH

+ +

text content

+

text content

+

ANCHGED

+

text content

+

text content

+

text content

+ +

text content

+

text content

+

CHGEDAN

+

text content

+

text content

+

text content

+ + +

text content

+

text content

+

NO CHANGED

+

text content

+ +

text content

+ +

NO CHANGED

+

CHANN

+ +

NO CHANGED

+

CHANN

+ +

CHAED

+

CHAE

+ +

CHANGED

+ +
+ + + + diff --git a/testing/web-platform/tests/dom/nodes/MutationObserver-disconnect.html b/testing/web-platform/tests/dom/nodes/MutationObserver-disconnect.html new file mode 100644 index 000000000..883edecf7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/MutationObserver-disconnect.html @@ -0,0 +1,48 @@ + + +MutationObservers: disconnect + + +

MutationObservers: disconnect

+
+
+

+
+ diff --git a/testing/web-platform/tests/dom/nodes/MutationObserver-document.html b/testing/web-platform/tests/dom/nodes/MutationObserver-document.html new file mode 100644 index 000000000..4662b2345 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/MutationObserver-document.html @@ -0,0 +1,167 @@ + + +MutationObservers: takeRecords + + + +

MutationObservers: document mutations

+
+ +

+ +

+

diff --git a/testing/web-platform/tests/dom/nodes/MutationObserver-inner-outer.html b/testing/web-platform/tests/dom/nodes/MutationObserver-inner-outer.html new file mode 100644 index 000000000..9f6d87141 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/MutationObserver-inner-outer.html @@ -0,0 +1,65 @@ + + +MutationObservers: innerHTML, outerHTML mutations + + + +

MutationObservers: innerHTML, outerHTML mutations

+
+ +
+ +

old text

+ +

old text

+ +

old text

+
+ + diff --git a/testing/web-platform/tests/dom/nodes/MutationObserver-takeRecords.html b/testing/web-platform/tests/dom/nodes/MutationObserver-takeRecords.html new file mode 100644 index 000000000..6a27ef77e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/MutationObserver-takeRecords.html @@ -0,0 +1,53 @@ + + +MutationObservers: takeRecords + + + +

MutationObservers: takeRecords

+
+ +
+ +

+ +
+ + + diff --git a/testing/web-platform/tests/dom/nodes/Node-appendChild.html b/testing/web-platform/tests/dom/nodes/Node-appendChild.html new file mode 100644 index 000000000..684607961 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-appendChild.html @@ -0,0 +1,59 @@ + + +Node.appendChild + + + +
+ + diff --git a/testing/web-platform/tests/dom/nodes/Node-baseURI.html b/testing/web-platform/tests/dom/nodes/Node-baseURI.html new file mode 100644 index 000000000..1672b6ecd --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-baseURI.html @@ -0,0 +1,32 @@ + +Node.baseURI + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Node-childNodes.html b/testing/web-platform/tests/dom/nodes/Node-childNodes.html new file mode 100644 index 000000000..f7586fa74 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-childNodes.html @@ -0,0 +1,99 @@ + + +Node.childNodes + + + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Node-cloneNode.html b/testing/web-platform/tests/dom/nodes/Node-cloneNode.html new file mode 100644 index 000000000..9fb939f7e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-cloneNode.html @@ -0,0 +1,272 @@ + + +Node.cloneNode + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Node-compareDocumentPosition.html b/testing/web-platform/tests/dom/nodes/Node-compareDocumentPosition.html new file mode 100644 index 000000000..afae60aad --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-compareDocumentPosition.html @@ -0,0 +1,87 @@ + +Node.compareDocumentPosition() tests + +
+ + + + + diff --git a/testing/web-platform/tests/dom/nodes/Node-constants.html b/testing/web-platform/tests/dom/nodes/Node-constants.html new file mode 100644 index 000000000..33e7c10e7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-constants.html @@ -0,0 +1,39 @@ + +Node constants + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Node-contains-xml.xml b/testing/web-platform/tests/dom/nodes/Node-contains-xml.xml new file mode 100644 index 000000000..b95b7ffd1 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-contains-xml.xml @@ -0,0 +1,83 @@ + + + +Node.nodeName + + + + + + +
+
+ + Link text +
+ + + diff --git a/testing/web-platform/tests/dom/nodes/Node-contains.html b/testing/web-platform/tests/dom/nodes/Node-contains.html new file mode 100644 index 000000000..a3d644866 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-contains.html @@ -0,0 +1,36 @@ + +Node.contains() tests + +
+ + + + + diff --git a/testing/web-platform/tests/dom/nodes/Node-insertBefore.html b/testing/web-platform/tests/dom/nodes/Node-insertBefore.html new file mode 100644 index 000000000..a9fc83b50 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-insertBefore.html @@ -0,0 +1,306 @@ + +Node.insertBefore + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Node-isConnected.html b/testing/web-platform/tests/dom/nodes/Node-isConnected.html new file mode 100644 index 000000000..da0b460de --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-isConnected.html @@ -0,0 +1,95 @@ + + + +Node.prototype.isConnected + + + + + + + diff --git a/testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe1.xml b/testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe1.xml new file mode 100644 index 000000000..8077e73c2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe1.xml @@ -0,0 +1 @@ + ]> diff --git a/testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe2.xml b/testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe2.xml new file mode 100644 index 000000000..eacc9d17a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-isEqualNode-iframe2.xml @@ -0,0 +1 @@ + ]> diff --git a/testing/web-platform/tests/dom/nodes/Node-isEqualNode-xhtml.xhtml b/testing/web-platform/tests/dom/nodes/Node-isEqualNode-xhtml.xhtml new file mode 100644 index 000000000..3170643d2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-isEqualNode-xhtml.xhtml @@ -0,0 +1,84 @@ + + +Node.isEqualNode + + + + +
+ + diff --git a/testing/web-platform/tests/dom/nodes/Node-properties.html b/testing/web-platform/tests/dom/nodes/Node-properties.html new file mode 100644 index 000000000..10f92e7d7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-properties.html @@ -0,0 +1,688 @@ + +Node assorted property tests + + +
+ + + + diff --git a/testing/web-platform/tests/dom/nodes/Node-removeChild.html b/testing/web-platform/tests/dom/nodes/Node-removeChild.html new file mode 100644 index 000000000..fb2258322 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-removeChild.html @@ -0,0 +1,54 @@ + +Node.removeChild + + + +
+ + diff --git a/testing/web-platform/tests/dom/nodes/Node-replaceChild.html b/testing/web-platform/tests/dom/nodes/Node-replaceChild.html new file mode 100644 index 000000000..e8ba496cd --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-replaceChild.html @@ -0,0 +1,345 @@ + + +Node.replaceChild + + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/Node-textContent.html b/testing/web-platform/tests/dom/nodes/Node-textContent.html new file mode 100644 index 000000000..9378dec80 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Node-textContent.html @@ -0,0 +1,265 @@ + + +Node.textContent + + +
+ diff --git a/testing/web-platform/tests/dom/nodes/NodeList-Iterable.html b/testing/web-platform/tests/dom/nodes/NodeList-Iterable.html new file mode 100644 index 000000000..e1349cd76 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/NodeList-Iterable.html @@ -0,0 +1,37 @@ + + +NodeList Iterable Test + + +

+

+

+

+

+ diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-append.html b/testing/web-platform/tests/dom/nodes/ParentNode-append.html new file mode 100644 index 000000000..dcc398f3f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ParentNode-append.html @@ -0,0 +1,66 @@ + + +ParentNode.append + + + + + diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-prepend.html b/testing/web-platform/tests/dom/nodes/ParentNode-prepend.html new file mode 100644 index 000000000..644693ffe --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ParentNode-prepend.html @@ -0,0 +1,66 @@ + + +ParentNode.prepend + + + + + diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.html b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.html new file mode 100644 index 000000000..affb00af2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.html @@ -0,0 +1,377 @@ + + + + + Selectors-API Test Suite: HTML with Selectors Level 2 using TestHarness: Test Document + + + + + + + + +
+
+ +
+

Universal selector tests inside element with id="universal".

+
+
Some preformatted text with some embedded code
+

This is a normal link: W3C

+
Some more nested elements code hyperlink
+
+ +
+
+
+
+
+

+

+    
+
    + + + + +
    + +
    +
    +
    +
    +
    + +
    + + + + + + + + + +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + + + + + + + + + +

    +
    + +
    +
    +
    +
    +
    +
    + +
    + + + + +
    +
    +
    +
    +
    + +

    +
    + +
    + + + + +
    +
    +
    +
    + +

    +
    + +
    + + + + +
    +
    +
    +
    +
    +
    + +

    +
    + +
    + + + + +
    + +
      +
    1. +
    2. +
    3. +
    4. +
    5. +
    6. +
    7. +
    8. +
    9. +
    10. +
    11. +
    12. +
    + +

    + span1 + em1 + + em2 + span2 + strong1 + em3 + span3 + span4 + strong2 + em4 +

    +
    + +
    +
    +
    +
    + +

    +

    +

    +
    + +
    +

    +

    +

    + +
    +
    +
    +
    + +
    +

    + +

    +

    + + +

    +

    + + + +

    +
    > + +
    +

    +

    +

    +

    Text node

    +

    +
    + + + +
    +
    +
    +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    +
    +
    + +

    +

    +

    +
    + +
    All pseudo-element tests
    + +
    +

    +

    +

    + + +
    +
    +

    +
    +

    +
    +
    +
    +
    + + + + + + +
    + +
    +
    +
    + +
      +
    • +
    • +
    • +
    • +
    + + + + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +

    +
    +
    +
    +

    +

    +
    + +
    +
    +
    +
    +
    +
    +

    +
    +
    +
    +

    +

    +
    + +
    + + +
    +
    + + diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.xht b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.xht new file mode 100644 index 000000000..14faa9bd4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-content.xht @@ -0,0 +1,372 @@ + + + + Selectors-API Test Suite: HTML with Selectors Level 2 using TestHarness: Test Document + + + + + + + +
    +
    + +
    +

    Universal selector tests inside element with id="universal".

    +
    +
    Some preformatted text with some embedded code
    +

    This is a normal link: W3C

    +
    Some more nested elements code hyperlink
    +
    + +
    +
    +
    +
    +
    +

    +
    
    +    
    +
      + + + + +
      + +
      +
      +
      +
      +
      + +
      + + + + + + + + + +
      + +
      +
      + +
      +
      +
      +
      + +
      +
      + + + + + + + + + +

      +
      + +
      +
      +
      +
      +
      +
      + +
      + + + + +
      +
      +
      +
      +
      + +

      +
      + +
      + + + + +
      +
      +
      +
      + +

      +
      + +
      + + + + +
      +
      +
      +
      +
      +
      + +

      +
      + +
      + + + + +
      + +
        +
      1. +
      2. +
      3. +
      4. +
      5. +
      6. +
      7. +
      8. +
      9. +
      10. +
      11. +
      12. +
      + +

      + span1 + em1 + + em2 + span2 + strong1 + em3 + span3 + span4 + strong2 + em4 +

      +
      + +
      +
      +
      +
      + +

      +

      +

      +
      + +
      +

      +

      +

      + +
      +
      +
      +
      + +
      +

      + +

      +

      + + +

      +

      + + + +

      +
      > + +
      +

      +

      +

      +

      Text node

      +

      +
      + + + +
      +
      +
      +
      +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      +
      +
      +
      + +

      +

      +

      +
      + +
      All pseudo-element tests
      + +
      +

      +

      +

      + + +
      +
      +

      +
      +

      +
      +
      +
      +
      + + + + + + +
      + +
      +
      +
      + +
        +
      • +
      • +
      • +
      • +
      + + + + + + +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      +

      +
      +
      +
      +

      +

      +
      + +
      +
      +
      +
      +
      +
      +

      +
      +
      +
      +

      +

      +
      + +
      + + +
      +
      + + diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-xht.xht b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-xht.xht new file mode 100644 index 000000000..7a673202b --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All-xht.xht @@ -0,0 +1,114 @@ + + + +Selectors-API Test Suite: XHTML + + + + + + + +
      This test requires JavaScript.
      + + + + diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.html b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.html new file mode 100644 index 000000000..159b0b967 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.html @@ -0,0 +1,110 @@ + + +Selectors-API Test Suite: HTML + + + + + + +
      This test requires JavaScript.
      + + diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.js b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.js new file mode 100644 index 000000000..4e6bef6d5 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ParentNode-querySelector-All.js @@ -0,0 +1,252 @@ +// Require selectors.js to be included before this. + +/* + * Create and append special elements that cannot be created correctly with HTML markup alone. + */ +function setupSpecialElements(doc, parent) { + // Setup null and undefined tests + parent.appendChild(doc.createElement("null")); + parent.appendChild(doc.createElement("undefined")); + + // Setup namespace tests + var anyNS = doc.createElement("div"); + var noNS = doc.createElement("div"); + anyNS.id = "any-namespace"; + noNS.id = "no-namespace"; + + var divs; + div = [doc.createElement("div"), + doc.createElementNS("http://www.w3.org/1999/xhtml", "div"), + doc.createElementNS("", "div"), + doc.createElementNS("http://www.example.org/ns", "div")]; + + div[0].id = "any-namespace-div1"; + div[1].id = "any-namespace-div2"; + div[2].setAttribute("id", "any-namespace-div3"); // Non-HTML elements can't use .id property + div[3].setAttribute("id", "any-namespace-div4"); + + for (var i = 0; i < div.length; i++) { + anyNS.appendChild(div[i]) + } + + div = [doc.createElement("div"), + doc.createElementNS("http://www.w3.org/1999/xhtml", "div"), + doc.createElementNS("", "div"), + doc.createElementNS("http://www.example.org/ns", "div")]; + + div[0].id = "no-namespace-div1"; + div[1].id = "no-namespace-div2"; + div[2].setAttribute("id", "no-namespace-div3"); // Non-HTML elements can't use .id property + div[3].setAttribute("id", "no-namespace-div4"); + + for (i = 0; i < div.length; i++) { + noNS.appendChild(div[i]) + } + + parent.appendChild(anyNS); + parent.appendChild(noNS); +} + +/* + * Check that the querySelector and querySelectorAll methods exist on the given Node + */ +function interfaceCheck(type, obj) { + test(function() { + var q = typeof obj.querySelector === "function"; + assert_true(q, type + " supports querySelector."); + }, type + " supports querySelector") + + test(function() { + var qa = typeof obj.querySelectorAll === "function"; + assert_true( qa, type + " supports querySelectorAll."); + }, type + " supports querySelectorAll") + + test(function() { + var list = obj.querySelectorAll("div"); + if (obj.ownerDocument) { // The object is not a Document + assert_true(list instanceof obj.ownerDocument.defaultView.NodeList, "The result should be an instance of a NodeList") + } else { // The object is a Document + assert_true(list instanceof obj.defaultView.NodeList, "The result should be an instance of a NodeList") + } + }, type + ".querySelectorAll returns NodeList instance") +} + +/* + * Verify that the NodeList returned by querySelectorAll is static and and that a new list is created after + * each call. A static list should not be affected by subsequent changes to the DOM. + */ +function verifyStaticList(type, doc, root) { + var pre, post, preLength; + + test(function() { + pre = root.querySelectorAll("div"); + preLength = pre.length; + + var div = doc.createElement("div"); + (root.body || root).appendChild(div); + + assert_equals(pre.length, preLength, "The length of the NodeList should not change.") + }, type + ": static NodeList") + + test(function() { + post = root.querySelectorAll("div"), + assert_equals(post.length, preLength + 1, "The length of the new NodeList should be 1 more than the previous list.") + }, type + ": new NodeList") +} + +/* + * Verify handling of special values for the selector parameter, including stringification of + * null and undefined, and the handling of the empty string. + */ +function runSpecialSelectorTests(type, root) { + test(function() { // 1 + assert_equals(root.querySelectorAll(null).length, 1, "This should find one element with the tag name 'NULL'."); + }, type + ".querySelectorAll null") + + test(function() { // 2 + assert_equals(root.querySelectorAll(undefined).length, 1, "This should find one element with the tag name 'UNDEFINED'."); + }, type + ".querySelectorAll undefined") + + test(function() { // 3 + assert_throws(TypeError(), function() { + root.querySelectorAll(); + }, "This should throw a TypeError.") + }, type + ".querySelectorAll no parameter") + + test(function() { // 4 + var elm = root.querySelector(null) + assert_not_equals(elm, null, "This should find an element."); + assert_equals(elm.tagName.toUpperCase(), "NULL", "The tag name should be 'NULL'.") + }, type + ".querySelector null") + + test(function() { // 5 + var elm = root.querySelector(undefined) + assert_not_equals(elm, undefined, "This should find an element."); + assert_equals(elm.tagName.toUpperCase(), "UNDEFINED", "The tag name should be 'UNDEFINED'.") + }, type + ".querySelector undefined") + + test(function() { // 6 + assert_throws(TypeError(), function() { + root.querySelector(); + }, "This should throw a TypeError.") + }, type + ".querySelector no parameter") + + test(function() { // 7 + result = root.querySelectorAll("*"); + var i = 0; + traverse(root, function(elem) { + if (elem !== root) { + assert_equals(elem, result[i], "The result in index " + i + " should be in tree order."); + i++; + } + }) + }, type + ".querySelectorAll tree order"); +} + +/* + * Execute queries with the specified valid selectors for both querySelector() and querySelectorAll() + * Only run these tests when results are expected. Don't run for syntax error tests. + */ +function runValidSelectorTest(type, root, selectors, testType, docType) { + var nodeType = ""; + switch (root.nodeType) { + case Node.DOCUMENT_NODE: + nodeType = "document"; + break; + case Node.ELEMENT_NODE: + nodeType = root.parentNode ? "element" : "detached"; + break; + case Node.DOCUMENT_FRAGMENT_NODE: + nodeType = "fragment"; + break; + default: + assert_unreached(); + nodeType = "unknown"; // This should never happen. + } + + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + var e = s["expect"]; + + if ((!s["exclude"] || (s["exclude"].indexOf(nodeType) === -1 && s["exclude"].indexOf(docType) === -1)) + && (s["testType"] & testType) ) { + var foundall, found; + + test(function() { + foundall = root.querySelectorAll(q); + assert_not_equals(foundall, null, "The method should not return null.") + assert_equals(foundall.length, e.length, "The method should return the expected number of matches.") + + for (var i = 0; i < e.length; i++) { + assert_not_equals(foundall[i], null, "The item in index " + i + " should not be null.") + assert_equals(foundall[i].getAttribute("id"), e[i], "The item in index " + i + " should have the expected ID."); + assert_false(foundall[i].hasAttribute("data-clone"), "This should not be a cloned element."); + } + }, type + ".querySelectorAll: " + n + ": " + q); + + test(function() { + found = root.querySelector(q); + + if (e.length > 0) { + assert_not_equals(found, null, "The method should return a match.") + assert_equals(found.getAttribute("id"), e[0], "The method should return the first match."); + assert_equals(found, foundall[0], "The result should match the first item from querySelectorAll."); + assert_false(found.hasAttribute("data-clone"), "This should not be annotated as a cloned element."); + } else { + assert_equals(found, null, "The method should not match anything."); + } + }, type + ".querySelector: " + n + ": " + q); + } + } +} + +/* + * Execute queries with the specified invalid selectors for both querySelector() and querySelectorAll() + * Only run these tests when errors are expected. Don't run for valid selector tests. + */ +function runInvalidSelectorTest(type, root, selectors) { + for (var i = 0; i < selectors.length; i++) { + var s = selectors[i]; + var n = s["name"]; + var q = s["selector"]; + + test(function() { + assert_throws("SyntaxError", function() { + root.querySelector(q) + }) + }, type + ".querySelector: " + n + ": " + q); + + test(function() { + assert_throws("SyntaxError", function() { + root.querySelectorAll(q) + }) + }, type + ".querySelectorAll: " + n + ": " + q); + } +} + +function traverse(elem, fn) { + if (elem.nodeType === elem.ELEMENT_NODE) { + fn(elem); + } + elem = elem.firstChild; + while (elem) { + traverse(elem, fn); + elem = elem.nextSibling; + } +} + +function getNodeType(node) { + switch (node.nodeType) { + case Node.DOCUMENT_NODE: + return "document"; + case Node.ELEMENT_NODE: + return node.parentNode ? "element" : "detached"; + case Node.DOCUMENT_FRAGMENT_NODE: + return "fragment"; + default: + assert_unreached(); + return "unknown"; // This should never happen. + } +} diff --git a/testing/web-platform/tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml b/testing/web-platform/tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml new file mode 100644 index 000000000..d629a8464 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ProcessingInstruction-escapes-1.xhtml @@ -0,0 +1,33 @@ + + + + + + +ProcessingInstruction numeric escapes + + + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-1.xhtml b/testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-1.xhtml new file mode 100644 index 000000000..4eaf86cbd --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-1.xhtml @@ -0,0 +1,16 @@ + + + +<?xml?> is not a ProcessingInstruction + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-2.xhtml b/testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-2.xhtml new file mode 100644 index 000000000..d878c697c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/ProcessingInstruction-literal-2.xhtml @@ -0,0 +1,21 @@ + + + +ProcessingInstruction literals + + + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/Text-constructor.html b/testing/web-platform/tests/dom/nodes/Text-constructor.html new file mode 100644 index 000000000..dbd9a0be0 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Text-constructor.html @@ -0,0 +1,11 @@ + + +Text constructor + + + + +
      + diff --git a/testing/web-platform/tests/dom/nodes/Text-splitText.html b/testing/web-platform/tests/dom/nodes/Text-splitText.html new file mode 100644 index 000000000..aec1cee52 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/Text-splitText.html @@ -0,0 +1,53 @@ + + +Text.splitText() + + + +
      + diff --git a/testing/web-platform/tests/dom/nodes/append-on-Document.html b/testing/web-platform/tests/dom/nodes/append-on-Document.html new file mode 100644 index 000000000..8d9ce2e3f --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/append-on-Document.html @@ -0,0 +1,53 @@ + + +DocumentType.append + + + + + diff --git a/testing/web-platform/tests/dom/nodes/attributes.html b/testing/web-platform/tests/dom/nodes/attributes.html new file mode 100644 index 000000000..8d983350d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/attributes.html @@ -0,0 +1,712 @@ + + +Attributes tests + + + + + + + +
      + + + + + + + + diff --git a/testing/web-platform/tests/dom/nodes/attributes.js b/testing/web-platform/tests/dom/nodes/attributes.js new file mode 100644 index 000000000..ef32bf6a6 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/attributes.js @@ -0,0 +1,18 @@ +function attr_is(attr, v, ln, ns, p, n) { + assert_equals(attr.value, v) + assert_equals(attr.nodeValue, v) + assert_equals(attr.textContent, v) + assert_equals(attr.localName, ln) + assert_equals(attr.namespaceURI, ns) + assert_equals(attr.prefix, p) + assert_equals(attr.name, n) + assert_equals(attr.nodeName, n); + assert_equals(attr.specified, true) +} + +function attributes_are(el, l) { + for (var i = 0, il = l.length; i < il; i++) { + attr_is(el.attributes[i], l[i][1], l[i][0], (l[i].length < 3) ? null : l[i][2], null, l[i][0]) + assert_equals(el.attributes[i].ownerElement, el) + } +} diff --git a/testing/web-platform/tests/dom/nodes/case.html b/testing/web-platform/tests/dom/nodes/case.html new file mode 100644 index 000000000..c3c195141 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/case.html @@ -0,0 +1,18 @@ + + +Tests for case-sensitivity in APIs + + + + + + + + + + + + + + +
      diff --git a/testing/web-platform/tests/dom/nodes/case.js b/testing/web-platform/tests/dom/nodes/case.js new file mode 100644 index 000000000..8c2da4a44 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/case.js @@ -0,0 +1,186 @@ +/* + * document.createElement(NS) + * + * document.getElementsByTagName(NS) + * + * Element.setAttribute(NS) + * + * Element.getAttribute(NS) + * Element.hasAttribute(NS) + * Element.getElementsByTagName(NS) + */ + +var tests = []; +setup(function() { + var name_inputs = ["abc", "Abc", "ABC", "ä", "Ä"]; + var namespaces = ["http://www.w3.org/1999/xhtml", "http://www.w3.org/2000/svg", "http://FOO"]; + name_inputs.forEach(function(x) { + tests.push(["createElement " + x, test_create_element, [x]]); + tests.push(["setAttribute " +x, test_set_attribute, [x]]); + tests.push(["getAttribute " +x, test_get_attribute, [x]]); + tests.push(["getElementsByTagName a:" +x, test_get_elements_tag_name, + [outer_product(namespaces, ["a"], name_inputs), + x]]); + tests.push(["getElementsByTagName " +x, test_get_elements_tag_name, + [outer_product(namespaces, [null], name_inputs), + x]]); + }); + outer_product(namespaces, name_inputs, name_inputs).forEach(function(x) { + tests.push(["createElementNS " + x, test_create_element_ns, x]); + tests.push(["setAttributeNS " + x, test_set_attribute_ns, x]); + tests.push(["getAttributeNS " + x, test_get_attribute_ns, x]); + }); + outer_product([null].concat(namespaces), name_inputs).forEach(function(x) { + tests.push(["getElementsByTagNameNS " + x, test_get_elements_tag_name_ns, + outer_product(namespaces, name_inputs), x]); + }); + name_inputs.forEach(function(x) { + tests.push(["createElementNS " + x, test_create_element_ns, [null, null, x]]); + tests.push(["setAttributeNS " + x, test_set_attribute_ns, [null, null, x]]); + tests.push(["getAttributeNS " + x, test_get_attribute_ns, [null, null, x]]); + }); + + }); +function outer_product() { + var rv = []; + function compute_outer_product() { + var args = Array.prototype.slice.call(arguments); + var index = args[0]; + if (index < args.length) { + args[index].forEach(function(x) { + compute_outer_product.apply(this, [index+1].concat(args.slice(1, index), x, args.slice(index+1))); + }); + } else { + rv.push(args.slice(1)); + } + } + compute_outer_product.apply(this, [1].concat(Array.prototype.slice.call(arguments))); + return rv; +} + +function expected_case(input) { + //is_html gets set by a global on the page loading the tests + if (is_html) { + return ascii_lowercase(input); + } else { + return input; + } +} + +function ascii_lowercase(input) { + return input.replace(/[A-Z]/g, function(x) { + return x.toLowerCase(); + }); +} + +function get_qualified_name(el) { + if (el.prefix) { + return el.prefix + ":" + el.localName; + } + return el.localName; +} + +function test_create_element(name) { + var node = document.createElement(name); + assert_equals(node.localName, expected_case(name)); +} + +function test_create_element_ns(namespace, prefix, local_name) { + var qualified_name = prefix ? prefix + ":" + local_name : local_name; + var node = document.createElementNS(namespace, qualified_name); + assert_equals(node.prefix, prefix, "prefix"); + assert_equals(node.localName, local_name, "localName"); +} + +function test_set_attribute(name) { + var node = document.createElement("div"); + node.setAttribute(name, "test"); + assert_equals(node.attributes[0].localName, expected_case(name)); +} + +function test_set_attribute_ns(namespace, prefix, local_name) { + var qualified_name = prefix ? prefix + ":" + local_name : local_name; + var node = document.createElement("div"); + node.setAttributeNS(namespace, qualified_name, "test"); + var attr = node.attributes[0]; + assert_equals(attr.prefix, prefix, "prefix"); + assert_equals(attr.localName, local_name, "localName"); +} + +function test_get_attribute(name) { + var node = document.createElement("div"); + node.setAttribute(name, "test"); + var expected_name = expected_case(name); + assert_equals(node.getAttribute(expected_name), "test"); + if (expected_name != name) { + assert_equals(node.getAttribute(expected_name), "test"); + } else if (name !== ascii_lowercase(name)) { + assert_equals(node.getAttribute(ascii_lowercase(name)), null); + } +} + +function test_get_attribute_ns(namespace, prefix, local_name) { + var qualified_name = prefix ? prefix + ":" + local_name : local_name; + var node = document.createElement("div"); + node.setAttributeNS(namespace, qualified_name, "test"); + var expected_name = local_name; + assert_equals(node.getAttributeNS(namespace, expected_name), "test"); + if (local_name !== ascii_lowercase(local_name)) { + assert_equals(node.getAttributeNS(namespace, ascii_lowercase(local_name)), null); + } +} + +function test_get_elements_tag_name(elements_to_create, search_string) { + var container = document.createElement("div"); + elements_to_create.forEach(function(x) { + var qualified_name = x[1] ? x[1] + ":" + x[2] : x[2]; + var element = document.createElementNS(x[0], qualified_name); + container.appendChild(element); + }); + var expected = Array.prototype.filter.call(container.childNodes, + function(node) { + if (is_html && node.namespaceURI === "http://www.w3.org/1999/xhtml") { + return get_qualified_name(node) === expected_case(search_string); + } else { + return get_qualified_name(node) === search_string; + } + }); + document.documentElement.appendChild(container); + try { + assert_array_equals(document.getElementsByTagName(search_string), expected); + } finally { + document.documentElement.removeChild(container); + } +} + +function test_get_elements_tag_name_ns(elements_to_create, search_input) { + var search_uri = search_input[0]; + var search_name = search_input[1]; + var container = document.createElement("div"); + elements_to_create.forEach(function(x) { + var qualified_name = x[1] ? x[1] + ":" + x[2] : x[2]; + var element = document.createElementNS(x[0], qualified_name); + container.appendChild(element); + }); + var expected = Array.prototype.filter.call(container.childNodes, + function(node) { + return node.namespaceURI === search_uri; + return node.localName === search_name; + }); + document.documentElement.appendChild(container); + try { + assert_array_equals(document.getElementsByTagNameNS(search_uri, search_name), expected); + } catch(e) { + throw e; + } finally { + document.documentElement.removeChild(container); + } +} + +function test_func() { + var func = arguments[0]; + var rest = arguments[1]; + func.apply(this, rest); +} + +generate_tests(test_func, tests); diff --git a/testing/web-platform/tests/dom/nodes/creators.js b/testing/web-platform/tests/dom/nodes/creators.js new file mode 100644 index 000000000..8b7415d13 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/creators.js @@ -0,0 +1,5 @@ +var creators = { + "element": "createElement", + "text": "createTextNode", + "comment": "createComment" +}; diff --git a/testing/web-platform/tests/dom/nodes/encoding.py b/testing/web-platform/tests/dom/nodes/encoding.py new file mode 100644 index 000000000..5f889e8db --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/encoding.py @@ -0,0 +1,5 @@ +from cgi import escape + +def main(request, response): + label = request.GET.first('label') + return """""" % escape(label) diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-01.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-01.htm new file mode 100644 index 000000000..457d6c400 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-01.htm @@ -0,0 +1,13 @@ + + + + document.getElementsByClassName(): simple + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-02.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-02.htm new file mode 100644 index 000000000..d5e513fa8 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-02.htm @@ -0,0 +1,14 @@ + + + + document.getElementsByClassName(): also simple + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-03.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-03.htm new file mode 100644 index 000000000..a9e2d3af1 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-03.htm @@ -0,0 +1,18 @@ + + + + document.getElementsByClassName(): changing classes + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-04.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-04.htm new file mode 100644 index 000000000..0c62fed2c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-04.htm @@ -0,0 +1,18 @@ + + + + document.getElementsByClassName(): changing classes + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-05.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-05.htm new file mode 100644 index 000000000..98245f642 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-05.htm @@ -0,0 +1,18 @@ + + + + document.getElementsByClassName(): changing classes + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-06.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-06.htm new file mode 100644 index 000000000..4975a89e0 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-06.htm @@ -0,0 +1,20 @@ + + + + document.getElementsByClassName(): adding element with class + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-07.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-07.htm new file mode 100644 index 000000000..b0102fb2e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-07.htm @@ -0,0 +1,15 @@ + + + + document.getElementsByClassName(): multiple classes + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-08.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-08.htm new file mode 100644 index 000000000..a248af492 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-08.htm @@ -0,0 +1,15 @@ + + + + document.getElementsByClassName(): multiple classes + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-09.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-09.htm new file mode 100644 index 000000000..9011f3068 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-09.htm @@ -0,0 +1,15 @@ + + + + document.getElementsByClassName(): case sensitive + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-10.xml b/testing/web-platform/tests/dom/nodes/getElementsByClassName-10.xml new file mode 100644 index 000000000..b3e3122cb --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-10.xml @@ -0,0 +1,19 @@ + + + document.getElementsByClassName(): compound + + + + +
      +
      + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-11.xml b/testing/web-platform/tests/dom/nodes/getElementsByClassName-11.xml new file mode 100644 index 000000000..8593fa7a0 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-11.xml @@ -0,0 +1,24 @@ + + + document.getElementsByClassName(): "tricky" compound + + + + +
      +
      + + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-12.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-12.htm new file mode 100644 index 000000000..3b7f328b4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-12.htm @@ -0,0 +1,15 @@ + + + + element.getElementsByClassName(): simple + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-13.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-13.htm new file mode 100644 index 000000000..f3af106ae --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-13.htm @@ -0,0 +1,19 @@ + + + + element.getElementsByClassName(): adding an element + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-14.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-14.htm new file mode 100644 index 000000000..77de16298 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-14.htm @@ -0,0 +1,16 @@ + + + + document.getElementsByClassName(): case-insensitive (quirks mode) + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-15.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-15.htm new file mode 100644 index 000000000..89614de30 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-15.htm @@ -0,0 +1,18 @@ + + + + document.getElementsByClassName(array): "a\n" + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-16.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-16.htm new file mode 100644 index 000000000..3f987a7ae --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-16.htm @@ -0,0 +1,16 @@ + + + + document.getElementsByClassName(array): "b","a" + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-17.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-17.htm new file mode 100644 index 000000000..ae5ebda6e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-17.htm @@ -0,0 +1,15 @@ + + + + document.getElementsByClassName(array): "b a" + + + + +
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-18.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-18.htm new file mode 100644 index 000000000..9f6cf75a5 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-18.htm @@ -0,0 +1,17 @@ + + + + element.getElementsByClassName(array): "a", "b" + + + + +
      +

      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-19.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-19.htm new file mode 100644 index 000000000..da233c743 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-19.htm @@ -0,0 +1,54 @@ + + + getElementsByClassName + + + + + + +
      +
      + + text +
      + + + + + + + + + + + + + + + + + + + + + + + +
      text caption
      TEXT head
      td text1
      td text
      td te xt
      TEXT foot
      +
      xt te
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-20.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-20.htm new file mode 100644 index 000000000..6429e37bb --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-20.htm @@ -0,0 +1,61 @@ + + + getElementsByClassName + + + + + + +
      +
      + + text +
      + + + + + + + + + + + + + + + + + + + + + + + +
      text caption
      TEXT head
      td text1
      td text
      td te xt
      TEXT foot
      +
      xt te
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-21.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-21.htm new file mode 100644 index 000000000..339ff2d3e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-21.htm @@ -0,0 +1,52 @@ + + + getElementsByClassName + + + + + + +
      +
      + + text +
      + + + + + + + + + + + + + + + + + + + + + + + +
      text caption
      TEXT head
      td text1
      td text
      td te xt
      TEXT foot
      +
      xt te
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-22.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-22.htm new file mode 100644 index 000000000..c20396700 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-22.htm @@ -0,0 +1,58 @@ + + + getElementsByClassName + + + + + + +
      +
      + + text +
      + + + + + + + + + + + + + + + + + + + + + + + +
      text caption
      TEXT head
      td text1
      td text
      td te xt
      TEXT foot
      +
      xt te
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-23.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-23.htm new file mode 100644 index 000000000..0af8a0995 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-23.htm @@ -0,0 +1,52 @@ + + + getElementsByClassName + + + + + + +
      +
      + + text +
      + + + + + + + + + + + + + + + + + + + + + + + +
      text caption
      TEXT head
      td text1
      td text
      td te xt
      TEXT foot
      +
      xt te
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-24.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-24.htm new file mode 100644 index 000000000..838987ad0 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-24.htm @@ -0,0 +1,30 @@ + + + + getElementsByClassName + + + + + + +
      +
      + + text +
      +
      ΔЙあ叶葉 קم
      + + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-25.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-25.htm new file mode 100644 index 000000000..21f2a9ff7 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-25.htm @@ -0,0 +1,57 @@ + + + getElementsByClassName + + + + + + +
      +
      + + text +
      + + + + + + + + + + + + + + + + + + + + + + + +
      text caption
      TEXT head
      td text1
      td text
      td te xt
      TEXT foot
      +
      xt te
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-26.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-26.htm new file mode 100644 index 000000000..0d7ff1ba1 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-26.htm @@ -0,0 +1,30 @@ + + + getElementsByClassName + + + + + + +
      +
      + te xt +
      + te; xt + test link #foo +
      + text +
      +
      xt te
      + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-27.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-27.htm new file mode 100644 index 000000000..95fc67442 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-27.htm @@ -0,0 +1,32 @@ + + + getElementsByClassName + + + + + + +
      +
      + te xt +
      + te; xt + test link #foo + dummy tag +
      + text +
      +
      xt te
      + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-28.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-28.htm new file mode 100644 index 000000000..1fc94d807 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-28.htm @@ -0,0 +1,31 @@ + + + getElementsByClassName + + + + + + +
      +
      + te xt +
      + te; xt + test link #foo + te xt namespace +
      + text +
      +
      xt te
      + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-29.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-29.htm new file mode 100644 index 000000000..ad489752c --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-29.htm @@ -0,0 +1,51 @@ + + + getElementsByClassName + + + + + + +
      +
      + + text +
      + + + + + + + + + + + + + + + + + + + + + + + +
      text caption
      TEXT head
      td text1
      td text
      td te xt
      TEXT foot
      +
      xt te
      + + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-30.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-30.htm new file mode 100644 index 000000000..c0b4faf2d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-30.htm @@ -0,0 +1,190 @@ + + + getElementsByClassName + + + + + + + + + + +
      + a + abbr + acronym +
      address
      + applet + b + bdo + big +
      blockquote
      +
      + +
      center
      + cite + code + del + dfn + dir +
    • li
    • +
      +
      div
      +
      +
      +
      dd
      +
      + em + font +
      + +
      + legend +
      +
      +

      h1

      +
      + i + + + + ins + kbd + + + + menu + + + + +
        ol
      +

      p

      +
      pre
      + q + s + samp + + small + span + strike + strong + sub + sup + colgroup + + + + + + + + + + + + +
      caption
      th
      td
      + + tt + u +
        ul
      + var + + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassName-31.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassName-31.htm new file mode 100644 index 000000000..0e1ac014a --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassName-31.htm @@ -0,0 +1,22 @@ + + + +getElementsByClassName across documents + + + +
      + diff --git a/testing/web-platform/tests/dom/nodes/getElementsByClassNameFrame.htm b/testing/web-platform/tests/dom/nodes/getElementsByClassNameFrame.htm new file mode 100644 index 000000000..544df60a9 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/getElementsByClassNameFrame.htm @@ -0,0 +1,6 @@ + + + + +getElementsByClassName + diff --git a/testing/web-platform/tests/dom/nodes/insert-adjacent.html b/testing/web-platform/tests/dom/nodes/insert-adjacent.html new file mode 100644 index 000000000..247b7d174 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/insert-adjacent.html @@ -0,0 +1,79 @@ + + + + + + + +
      +
      + + diff --git a/testing/web-platform/tests/dom/nodes/mutationobservers.js b/testing/web-platform/tests/dom/nodes/mutationobservers.js new file mode 100644 index 000000000..772f280be --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/mutationobservers.js @@ -0,0 +1,76 @@ +// Compares a mutation record to a predefined one +// mutationToCheck is a mutation record from the user agent +// expectedRecord is a mutation record minted by the test +// for expectedRecord, if properties are ommitted, they get default ones +function checkRecords(target, mutationToCheck, expectedRecord) { + var mr1; + var mr2; + + + function checkField(property, isArray) { + var field = mr2[property]; + if (isArray === undefined) { + isArray = false; + } + if (field instanceof Function) { + field = field(); + } else if (field === undefined) { + if (isArray) { + field = new Array(); + } else { + field = null; + } + } + if (isArray) { + assert_array_equals(mr1[property], field, property + " didn't match"); + } else { + assert_equals(mr1[property], field, property + " didn't match"); + } + } + + assert_equals(mutationToCheck.length, expectedRecord.length, "mutation records must match"); + for (var item = 0; item < mutationToCheck.length; item++) { + mr1 = mutationToCheck[item]; + mr2 = expectedRecord[item]; + + if (mr2.target instanceof Function) { + assert_equals(mr1.target, mr2.target(), "target node must match"); + } else if (mr2.target !== undefined) { + assert_equals(mr1.target, mr2.target, "target node must match"); + } else { + assert_equals(mr1.target, target, "target node must match"); + } + + checkField("type"); + checkField("addedNodes", true); + checkField("removedNodes", true); + checkField("previousSibling"); + checkField("nextSibling"); + checkField("attributeName"); + checkField("attributeNamespace"); + checkField("oldValue"); + }; +} + +function runMutationTest(node, mutationObserverOptions, mutationRecordSequence, mutationFunction, description, target) { + var test = async_test(description); + + + function moc(mrl, obs) { + test.step( + function () { + if (target === undefined) target = node; + checkRecords(target, mrl, mutationRecordSequence); + test.done(); + } + ); + } + + test.step( + function () { + (new MutationObserver(moc)).observe(node, mutationObserverOptions); + mutationFunction(); + } + ); + return mutationRecordSequence.length +} diff --git a/testing/web-platform/tests/dom/nodes/prepend-on-Document.html b/testing/web-platform/tests/dom/nodes/prepend-on-Document.html new file mode 100644 index 000000000..ccc56894d --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/prepend-on-Document.html @@ -0,0 +1,53 @@ + + +DocumentType.prepend + + + + + diff --git a/testing/web-platform/tests/dom/nodes/productions.js b/testing/web-platform/tests/dom/nodes/productions.js new file mode 100644 index 000000000..2b9959041 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/productions.js @@ -0,0 +1,3 @@ +var invalid_names = ["", "invalid^Name", "\\", "'", '"', "0", "0:a"] // XXX +var valid_names = ["x", ":", "a:0"] +var invalid_qnames = [":a", "b:", "x:y:z"] // XXX diff --git a/testing/web-platform/tests/dom/nodes/remove-unscopable.html b/testing/web-platform/tests/dom/nodes/remove-unscopable.html new file mode 100644 index 000000000..0238b0fa9 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/remove-unscopable.html @@ -0,0 +1,32 @@ + + + + + +
      + diff --git a/testing/web-platform/tests/dom/nodes/rootNode.html b/testing/web-platform/tests/dom/nodes/rootNode.html new file mode 100644 index 000000000..66343e7e2 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/rootNode.html @@ -0,0 +1,82 @@ + + + + +Node.prototype.getRootNode() + + + + + + + + diff --git a/testing/web-platform/tests/dom/nodes/selectors.js b/testing/web-platform/tests/dom/nodes/selectors.js new file mode 100644 index 000000000..ac722a6fe --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/selectors.js @@ -0,0 +1,734 @@ +// Bit-mapped flags to indicate which tests the selector is suitable for +var TEST_QSA = 0x01; // querySelector() and querySelectorAll() tests +var TEST_FIND = 0x04; // find() and findAll() tests, may be unsuitable for querySelector[All] +var TEST_MATCH = 0x10; // matches() tests + +/* + * All of these invalid selectors should result in a SyntaxError being thrown by the APIs. + * + * name: A descriptive name of the selector being tested + * selector: The selector to test + */ +var invalidSelectors = [ + {name: "Empty String", selector: ""}, + {name: "Invalid character", selector: "["}, + {name: "Invalid character", selector: "]"}, + {name: "Invalid character", selector: "("}, + {name: "Invalid character", selector: ")"}, + {name: "Invalid character", selector: "{"}, + {name: "Invalid character", selector: "}"}, + {name: "Invalid character", selector: "<"}, + {name: "Invalid character", selector: ">"}, + {name: "Invalid ID", selector: "#"}, + {name: "Invalid group of selectors", selector: "div,"}, + {name: "Invalid class", selector: "."}, + {name: "Invalid class", selector: ".5cm"}, + {name: "Invalid class", selector: "..test"}, + {name: "Invalid class", selector: ".foo..quux"}, + {name: "Invalid class", selector: ".bar."}, + {name: "Invalid combinator", selector: "div & address, p"}, + {name: "Invalid combinator", selector: "div ++ address, p"}, + {name: "Invalid combinator", selector: "div ~~ address, p"}, + {name: "Invalid [att=value] selector", selector: "[*=test]"}, + {name: "Invalid [att=value] selector", selector: "[*|*=test]"}, + {name: "Invalid [att=value] selector", selector: "[class= space unquoted ]"}, + {name: "Unknown pseudo-class", selector: "div:example"}, + {name: "Unknown pseudo-class", selector: ":example"}, + {name: "Unknown pseudo-element", selector: "div::example"}, + {name: "Unknown pseudo-element", selector: "::example"}, + {name: "Invalid pseudo-element", selector: ":::before"}, + {name: "Undeclared namespace", selector: "ns|div"}, + {name: "Undeclared namespace", selector: ":not(ns|div)"}, + {name: "Invalid namespace", selector: "^|div"}, + {name: "Invalid namespace", selector: "$|div"} +]; + +/* + * All of these should be valid selectors, expected to match zero or more elements in the document. + * None should throw any errors. + * + * name: A descriptive name of the selector being tested + * selector: The selector to test + * expect: A list of IDs of the elements expected to be matched. List must be given in tree order. + * exclude: An array of contexts to exclude from testing. The valid values are: + * ["document", "element", "fragment", "detached", "html", "xhtml"] + * The "html" and "xhtml" values represent the type of document being queried. These are useful + * for tests that are affected by differences between HTML and XML, such as case sensitivity. + * level: An integer indicating the CSS or Selectors level in which the selector being tested was introduced. + * testType: A bit-mapped flag indicating the type of test. + * + * Note: Interactive pseudo-classes (:active :hover and :focus) have not been tested in this test suite. + */ +var validSelectors = [ + // Type Selector + {name: "Type selector, matching html element", selector: "html", expect: ["html"], exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Type selector, matching html element", selector: "html", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_QSA}, + {name: "Type selector, matching body element", selector: "body", expect: ["body"], exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Type selector, matching body element", selector: "body", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_QSA}, + + // Universal Selector + // Testing "*" for entire an entire context node is handled separately. + {name: "Universal selector, matching all children of element with specified ID", selector: "#universal>*", expect: ["universal-p1", "universal-hr1", "universal-pre1", "universal-p2", "universal-address1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Universal selector, matching all grandchildren of element with specified ID", selector: "#universal>*>*", expect: ["universal-code1", "universal-span1", "universal-a1", "universal-code2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Universal selector, matching all children of empty element with specified ID", selector: "#empty>*", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Universal selector, matching all descendants of element with specified ID", selector: "#universal *", expect: ["universal-p1", "universal-code1", "universal-hr1", "universal-pre1", "universal-span1", "universal-p2", "universal-a1", "universal-address1", "universal-code2", "universal-a2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + + // Attribute Selectors + // - presence [att] + {name: "Attribute presence selector, matching align attribute with value", selector: ".attr-presence-div1[align]", expect: ["attr-presence-div1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute presence selector, matching align attribute with empty value", selector: ".attr-presence-div2[align]", expect: ["attr-presence-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute presence selector, matching title attribute, case insensitivity", selector: "#attr-presence [TiTlE]", expect: ["attr-presence-a1", "attr-presence-span1"], exclude: ["xhtml"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute presence selector, not matching title attribute, case sensitivity", selector: "#attr-presence [TiTlE]", expect: [], exclude: ["html"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute presence selector, matching custom data-* attribute", selector: "[data-attr-presence]", expect: ["attr-presence-pre1", "attr-presence-blockquote1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute presence selector, not matching attribute with similar name", selector: ".attr-presence-div3[align], .attr-presence-div4[align]", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Attribute presence selector, matching attribute with non-ASCII characters", selector: "ul[data-中文]", expect: ["attr-presence-ul1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute presence selector, not matching default option without selected attribute", selector: "#attr-presence-select1 option[selected]", expect: [] /* no matches */, level: 2, testType: TEST_QSA}, + {name: "Attribute presence selector, matching option with selected attribute", selector: "#attr-presence-select2 option[selected]", expect: ["attr-presence-select2-option4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute presence selector, matching multiple options with selected attributes", selector: "#attr-presence-select3 option[selected]", expect: ["attr-presence-select3-option2", "attr-presence-select3-option3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + + // - value [att=val] + {name: "Attribute value selector, matching align attribute with value", selector: "#attr-value [align=\"center\"]", expect: ["attr-value-div1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute value selector, matching align attribute with empty value", selector: "#attr-value [align=\"\"]", expect: ["attr-value-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute value selector, not matching align attribute with partial value", selector: "#attr-value [align=\"c\"]", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Attribute value selector, not matching align attribute with incorrect value", selector: "#attr-value [align=\"centera\"]", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Attribute value selector, matching custom data-* attribute with unicode escaped value", selector: "[data-attr-value=\"\\e9\"]", expect: ["attr-value-div3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute value selector, matching custom data-* attribute with escaped character", selector: "[data-attr-value\_foo=\"\\e9\"]", expect: ["attr-value-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute value selector with single-quoted value, matching multiple inputs with type attributes", selector: "#attr-value input[type='hidden'],#attr-value input[type='radio']", expect: ["attr-value-input3", "attr-value-input4", "attr-value-input6", "attr-value-input8", "attr-value-input9"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute value selector with double-quoted value, matching multiple inputs with type attributes", selector: "#attr-value input[type=\"hidden\"],#attr-value input[type='radio']", expect: ["attr-value-input3", "attr-value-input4", "attr-value-input6", "attr-value-input8", "attr-value-input9"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute value selector with unquoted value, matching multiple inputs with type attributes", selector: "#attr-value input[type=hidden],#attr-value input[type=radio]", expect: ["attr-value-input3", "attr-value-input4", "attr-value-input6", "attr-value-input8", "attr-value-input9"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute value selector, matching attribute with value using non-ASCII characters", selector: "[data-attr-value=中文]", expect: ["attr-value-div5"], level: 2, testType: TEST_QSA | TEST_MATCH}, + + // - whitespace-separated list [att~=val] + {name: "Attribute whitespace-separated list selector, matching class attribute with value", selector: "#attr-whitespace [class~=\"div1\"]", expect: ["attr-whitespace-div1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector, not matching class attribute with empty value", selector: "#attr-whitespace [class~=\"\"]", expect: [] /*no matches*/ , level: 2, testType: TEST_QSA}, + {name: "Attribute whitespace-separated list selector, not matching class attribute with partial value", selector: "[data-attr-whitespace~=\"div\"]", expect: [] /*no matches*/ , level: 2, testType: TEST_QSA}, + {name: "Attribute whitespace-separated list selector, matching custom data-* attribute with unicode escaped value", selector: "[data-attr-whitespace~=\"\\0000e9\"]", expect: ["attr-whitespace-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector, matching custom data-* attribute with escaped character", selector: "[data-attr-whitespace\_foo~=\"\\e9\"]", expect: ["attr-whitespace-div5"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with single-quoted value, matching multiple links with rel attributes", selector: "#attr-whitespace a[rel~='bookmark'], #attr-whitespace a[rel~='nofollow']", expect: ["attr-whitespace-a1", "attr-whitespace-a2", "attr-whitespace-a3", "attr-whitespace-a5", "attr-whitespace-a7"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with double-quoted value, matching multiple links with rel attributes", selector: "#attr-whitespace a[rel~=\"bookmark\"],#attr-whitespace a[rel~='nofollow']", expect: ["attr-whitespace-a1", "attr-whitespace-a2", "attr-whitespace-a3", "attr-whitespace-a5", "attr-whitespace-a7"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with unquoted value, matching multiple links with rel attributes", selector: "#attr-whitespace a[rel~=bookmark], #attr-whitespace a[rel~=nofollow]", expect: ["attr-whitespace-a1", "attr-whitespace-a2", "attr-whitespace-a3", "attr-whitespace-a5", "attr-whitespace-a7"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with double-quoted value, not matching value with space", selector: "#attr-whitespace a[rel~=\"book mark\"]", expect: [] /* no matches */, level: 2, testType: TEST_QSA}, + {name: "Attribute whitespace-separated list selector, matching title attribute with value using non-ASCII characters", selector: "#attr-whitespace [title~=中文]", expect: ["attr-whitespace-p1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + + // - hyphen-separated list [att|=val] + {name: "Attribute hyphen-separated list selector, not matching unspecified lang attribute", selector: "#attr-hyphen-div1[lang|=\"en\"]", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Attribute hyphen-separated list selector, matching lang attribute with exact value", selector: "#attr-hyphen-div2[lang|=\"fr\"]", expect: ["attr-hyphen-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute hyphen-separated list selector, matching lang attribute with partial value", selector: "#attr-hyphen-div3[lang|=\"en\"]", expect: ["attr-hyphen-div3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute hyphen-separated list selector, not matching incorrect value", selector: "#attr-hyphen-div4[lang|=\"es-AR\"]", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + + // - substring begins-with [att^=val] (Level 3) + {name: "Attribute begins with selector, matching href attributes beginning with specified substring", selector: "#attr-begins a[href^=\"http://www\"]", expect: ["attr-begins-a1", "attr-begins-a3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute begins with selector, matching lang attributes beginning with specified substring, ", selector: "#attr-begins [lang^=\"en-\"]", expect: ["attr-begins-div2", "attr-begins-div4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute begins with selector, not matching class attribute not beginning with specified substring", selector: "#attr-begins [class^=apple]", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + {name: "Attribute begins with selector with single-quoted value, matching class attribute beginning with specified substring", selector: "#attr-begins [class^=' apple']", expect: ["attr-begins-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute begins with selector with double-quoted value, matching class attribute beginning with specified substring", selector: "#attr-begins [class^=\" apple\"]", expect: ["attr-begins-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute begins with selector with unquoted value, not matching class attribute not beginning with specified substring", selector: "#attr-begins [class^= apple]", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + + // - substring ends-with [att$=val] (Level 3) + {name: "Attribute ends with selector, matching href attributes ending with specified substring", selector: "#attr-ends a[href$=\".org\"]", expect: ["attr-ends-a1", "attr-ends-a3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute ends with selector, matching lang attributes ending with specified substring, ", selector: "#attr-ends [lang$=\"-CH\"]", expect: ["attr-ends-div2", "attr-ends-div4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute ends with selector, not matching class attribute not ending with specified substring", selector: "#attr-ends [class$=apple]", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + {name: "Attribute ends with selector with single-quoted value, matching class attribute ending with specified substring", selector: "#attr-ends [class$='apple ']", expect: ["attr-ends-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute ends with selector with double-quoted value, matching class attribute ending with specified substring", selector: "#attr-ends [class$=\"apple \"]", expect: ["attr-ends-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute ends with selector with unquoted value, not matching class attribute not ending with specified substring", selector: "#attr-ends [class$=apple ]", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + + // - substring contains [att*=val] (Level 3) + {name: "Attribute contains selector, matching href attributes beginning with specified substring", selector: "#attr-contains a[href*=\"http://www\"]", expect: ["attr-contains-a1", "attr-contains-a3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector, matching href attributes ending with specified substring", selector: "#attr-contains a[href*=\".org\"]", expect: ["attr-contains-a1", "attr-contains-a2"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector, matching href attributes containing specified substring", selector: "#attr-contains a[href*=\".example.\"]", expect: ["attr-contains-a1", "attr-contains-a3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector, matching lang attributes beginning with specified substring, ", selector: "#attr-contains [lang*=\"en-\"]", expect: ["attr-contains-div2", "attr-contains-div6"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector, matching lang attributes ending with specified substring, ", selector: "#attr-contains [lang*=\"-CH\"]", expect: ["attr-contains-div3", "attr-contains-div5"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with single-quoted value, matching class attribute beginning with specified substring", selector: "#attr-contains [class*=' apple']", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with single-quoted value, matching class attribute ending with specified substring", selector: "#attr-contains [class*='orange ']", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with single-quoted value, matching class attribute containing specified substring", selector: "#attr-contains [class*='ple banana ora']", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with double-quoted value, matching class attribute beginning with specified substring", selector: "#attr-contains [class*=\" apple\"]", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with double-quoted value, matching class attribute ending with specified substring", selector: "#attr-contains [class*=\"orange \"]", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with double-quoted value, matching class attribute containing specified substring", selector: "#attr-contains [class*=\"ple banana ora\"]", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with unquoted value, matching class attribute beginning with specified substring", selector: "#attr-contains [class*= apple]", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with unquoted value, matching class attribute ending with specified substring", selector: "#attr-contains [class*=orange ]", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "Attribute contains selector with unquoted value, matching class attribute containing specified substring", selector: "#attr-contains [class*= banana ]", expect: ["attr-contains-p1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // Pseudo-classes + // - :root (Level 3) + {name: ":root pseudo-class selector, matching document root element", selector: ":root", expect: ["html"], exclude: ["element", "fragment", "detached"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":root pseudo-class selector, not matching document root element", selector: ":root", expect: [] /*no matches*/, exclude: ["document"], level: 3, testType: TEST_QSA}, + + // - :nth-child(n) (Level 3) + // XXX write descriptions + {name: ":nth-child selector, matching the third child element", selector: "#pseudo-nth-table1 :nth-child(3)", expect: ["pseudo-nth-td3", "pseudo-nth-td9", "pseudo-nth-tr3", "pseudo-nth-td15"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-child selector, matching every third child element", selector: "#pseudo-nth li:nth-child(3n)", expect: ["pseudo-nth-li3", "pseudo-nth-li6", "pseudo-nth-li9", "pseudo-nth-li12"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-child selector, matching every second child element, starting from the fourth", selector: "#pseudo-nth li:nth-child(2n+4)", expect: ["pseudo-nth-li4", "pseudo-nth-li6", "pseudo-nth-li8", "pseudo-nth-li10", "pseudo-nth-li12"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-child selector, matching every fourth child element, starting from the third", selector: "#pseudo-nth-p1 :nth-child(4n-1)", expect: ["pseudo-nth-em2", "pseudo-nth-span3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :nth-last-child (Level 3) + {name: ":nth-last-child selector, matching the third last child element", selector: "#pseudo-nth-table1 :nth-last-child(3)", expect: ["pseudo-nth-tr1", "pseudo-nth-td4", "pseudo-nth-td10", "pseudo-nth-td16"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-last-child selector, matching every third child element from the end", selector: "#pseudo-nth li:nth-last-child(3n)", expect: ["pseudo-nth-li1", "pseudo-nth-li4", "pseudo-nth-li7", "pseudo-nth-li10"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-last-child selector, matching every second child element from the end, starting from the fourth last", selector: "#pseudo-nth li:nth-last-child(2n+4)", expect: ["pseudo-nth-li1", "pseudo-nth-li3", "pseudo-nth-li5", "pseudo-nth-li7", "pseudo-nth-li9"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-last-child selector, matching every fourth element from the end, starting from the third last", selector: "#pseudo-nth-p1 :nth-last-child(4n-1)", expect: ["pseudo-nth-span2", "pseudo-nth-span4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :nth-of-type(n) (Level 3) + {name: ":nth-of-type selector, matching the third em element", selector: "#pseudo-nth-p1 em:nth-of-type(3)", expect: ["pseudo-nth-em3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-of-type selector, matching every second element of their type", selector: "#pseudo-nth-p1 :nth-of-type(2n)", expect: ["pseudo-nth-em2", "pseudo-nth-span2", "pseudo-nth-span4", "pseudo-nth-strong2", "pseudo-nth-em4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-of-type selector, matching every second elemetn of their type, starting from the first", selector: "#pseudo-nth-p1 span:nth-of-type(2n-1)", expect: ["pseudo-nth-span1", "pseudo-nth-span3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :nth-last-of-type(n) (Level 3) + {name: ":nth-last-of-type selector, matching the thrid last em element", selector: "#pseudo-nth-p1 em:nth-last-of-type(3)", expect: ["pseudo-nth-em2"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-last-of-type selector, matching every second last element of their type", selector: "#pseudo-nth-p1 :nth-last-of-type(2n)", expect: ["pseudo-nth-span1", "pseudo-nth-em1", "pseudo-nth-strong1", "pseudo-nth-em3", "pseudo-nth-span3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":nth-last-of-type selector, matching every second last element of their type, starting from the last", selector: "#pseudo-nth-p1 span:nth-last-of-type(2n-1)", expect: ["pseudo-nth-span2", "pseudo-nth-span4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :first-of-type (Level 3) + {name: ":first-of-type selector, matching the first em element", selector: "#pseudo-nth-p1 em:first-of-type", expect: ["pseudo-nth-em1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":first-of-type selector, matching the first of every type of element", selector: "#pseudo-nth-p1 :first-of-type", expect: ["pseudo-nth-span1", "pseudo-nth-em1", "pseudo-nth-strong1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":first-of-type selector, matching the first td element in each table row", selector: "#pseudo-nth-table1 tr :first-of-type", expect: ["pseudo-nth-td1", "pseudo-nth-td7", "pseudo-nth-td13"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :last-of-type (Level 3) + {name: ":last-of-type selector, matching the last em elemnet", selector: "#pseudo-nth-p1 em:last-of-type", expect: ["pseudo-nth-em4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":last-of-type selector, matching the last of every type of element", selector: "#pseudo-nth-p1 :last-of-type", expect: ["pseudo-nth-span4", "pseudo-nth-strong2", "pseudo-nth-em4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":last-of-type selector, matching the last td element in each table row", selector: "#pseudo-nth-table1 tr :last-of-type", expect: ["pseudo-nth-td6", "pseudo-nth-td12", "pseudo-nth-td18"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :first-child + {name: ":first-child pseudo-class selector, matching first child div element", selector: "#pseudo-first-child div:first-child", expect: ["pseudo-first-child-div1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: ":first-child pseudo-class selector, doesn't match non-first-child elements", selector: ".pseudo-first-child-div2:first-child, .pseudo-first-child-div3:first-child", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: ":first-child pseudo-class selector, matching first-child of multiple elements", selector: "#pseudo-first-child span:first-child", expect: ["pseudo-first-child-span1", "pseudo-first-child-span3", "pseudo-first-child-span5"], level: 2, testType: TEST_QSA | TEST_MATCH}, + + // - :last-child (Level 3) + {name: ":last-child pseudo-class selector, matching last child div element", selector: "#pseudo-last-child div:last-child", expect: ["pseudo-last-child-div3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":last-child pseudo-class selector, doesn't match non-last-child elements", selector: ".pseudo-last-child-div1:last-child, .pseudo-last-child-div2:first-child", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + {name: ":last-child pseudo-class selector, matching first-child of multiple elements", selector: "#pseudo-last-child span:last-child", expect: ["pseudo-last-child-span2", "pseudo-last-child-span4", "pseudo-last-child-span6"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :only-child (Level 3) + {name: ":pseudo-only-child pseudo-class selector, matching all only-child elements", selector: "#pseudo-only :only-child", expect: ["pseudo-only-span1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":pseudo-only-child pseudo-class selector, matching only-child em elements", selector: "#pseudo-only em:only-child", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + + // - :only-of-type (Level 3) + {name: ":pseudo-only-of-type pseudo-class selector, matching all elements with no siblings of the same type", selector: "#pseudo-only :only-of-type", expect: ["pseudo-only-span1", "pseudo-only-em1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":pseudo-only-of-type pseudo-class selector, matching em elements with no siblings of the same type", selector: "#pseudo-only em:only-of-type", expect: ["pseudo-only-em1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :empty (Level 3) + {name: ":empty pseudo-class selector, matching empty p elements", selector: "#pseudo-empty p:empty", expect: ["pseudo-empty-p1", "pseudo-empty-p2"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":empty pseudo-class selector, matching all empty elements", selector: "#pseudo-empty :empty", expect: ["pseudo-empty-p1", "pseudo-empty-p2", "pseudo-empty-span1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :link and :visited + // Implementations may treat all visited links as unvisited, so these cannot be tested separately. + // The only guarantee is that ":link,:visited" matches the set of all visited and unvisited links and that they are individually mutually exclusive sets. + {name: ":link and :visited pseudo-class selectors, matching a and area elements with href attributes", selector: "#pseudo-link :link, #pseudo-link :visited", expect: ["pseudo-link-a1", "pseudo-link-a2", "pseudo-link-area1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: ":link and :visited pseudo-class selectors, matching link elements with href attributes", selector: "#head :link, #head :visited", expect: ["pseudo-link-link1", "pseudo-link-link2"], exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: ":link and :visited pseudo-class selectors, not matching link elements with href attributes", selector: "#head :link, #head :visited", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_QSA}, + {name: ":link and :visited pseudo-class selectors, chained, mutually exclusive pseudo-classes match nothing", selector: ":link:visited", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_QSA}, + + // - :target (Level 3) + {name: ":target pseudo-class selector, matching the element referenced by the URL fragment identifier", selector: ":target", expect: [] /*no matches*/, exclude: ["document", "element"], level: 3, testType: TEST_QSA}, + {name: ":target pseudo-class selector, matching the element referenced by the URL fragment identifier", selector: ":target", expect: ["target"], exclude: ["fragment", "detached"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :lang() + {name: ":lang pseudo-class selector, matching inherited language", selector: "#pseudo-lang-div1:lang(en)", expect: ["pseudo-lang-div1"], exclude: ["detached", "fragment"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: ":lang pseudo-class selector, not matching element with no inherited language", selector: "#pseudo-lang-div1:lang(en)", expect: [] /*no matches*/, exclude: ["document", "element"], level: 2, testType: TEST_QSA}, + {name: ":lang pseudo-class selector, matching specified language with exact value", selector: "#pseudo-lang-div2:lang(fr)", expect: ["pseudo-lang-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: ":lang pseudo-class selector, matching specified language with partial value", selector: "#pseudo-lang-div3:lang(en)", expect: ["pseudo-lang-div3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: ":lang pseudo-class selector, not matching incorrect language", selector: "#pseudo-lang-div4:lang(es-AR)", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + + // - :enabled (Level 3) + {name: ":enabled pseudo-class selector, matching all enabled form controls", selector: "#pseudo-ui :enabled", expect: ["pseudo-ui-input1", "pseudo-ui-input2", "pseudo-ui-input3", "pseudo-ui-input4", "pseudo-ui-input5", "pseudo-ui-input6", + "pseudo-ui-input7", "pseudo-ui-input8", "pseudo-ui-input9", "pseudo-ui-textarea1", "pseudo-ui-button1"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :disabled (Level 3) + {name: ":enabled pseudo-class selector, matching all disabled form controls", selector: "#pseudo-ui :disabled", expect: ["pseudo-ui-input10", "pseudo-ui-input11", "pseudo-ui-input12", "pseudo-ui-input13", "pseudo-ui-input14", "pseudo-ui-input15", + "pseudo-ui-input16", "pseudo-ui-input17", "pseudo-ui-input18", "pseudo-ui-textarea2", "pseudo-ui-button2"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :checked (Level 3) + {name: ":checked pseudo-class selector, matching checked radio buttons and checkboxes", selector: "#pseudo-ui :checked", expect: ["pseudo-ui-input4", "pseudo-ui-input6", "pseudo-ui-input13", "pseudo-ui-input15"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // - :not(s) (Level 3) + {name: ":not pseudo-class selector, matching ", selector: "#not>:not(div)", expect: ["not-p1", "not-p2", "not-p3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":not pseudo-class selector, matching ", selector: "#not * :not(:first-child)", expect: ["not-em1", "not-em2", "not-em3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: ":not pseudo-class selector, matching nothing", selector: ":not(*)", expect: [] /* no matches */, level: 3, testType: TEST_QSA}, + {name: ":not pseudo-class selector, matching nothing", selector: ":not(*|*)", expect: [] /* no matches */, level: 3, testType: TEST_QSA}, + + // Pseudo-elements + // - ::first-line + {name: ":first-line pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:first-line", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "::first-line pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::first-line", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + + // - ::first-letter + {name: ":first-letter pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:first-letter", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "::first-letter pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::first-letter", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + + // - ::before + {name: ":before pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:before", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "::before pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::before", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + + // - ::after + {name: ":after pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:after", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "::after pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::after", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + + // Class Selectors + {name: "Class selector, matching element with specified class", selector: ".class-p", expect: ["class-p1","class-p2", "class-p3"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Class selector, chained, matching only elements with all specified classes", selector: "#class .apple.orange.banana", expect: ["class-div1", "class-div2", "class-p4", "class-div3", "class-p6", "class-div4"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Class Selector, chained, with type selector", selector: "div.apple.banana.orange", expect: ["class-div1", "class-div2", "class-div3", "class-div4"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Class selector, matching element with class value using non-ASCII characters (1)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci", expect: ["class-span1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Class selector, matching multiple elements with class value using non-ASCII characters", selector: ".\u53F0\u5317", expect: ["class-span1","class-span2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Class selector, chained, matching element with multiple class values using non-ASCII characters (1)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci.\u53F0\u5317", expect: ["class-span1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Class selector, matching element with class with escaped character", selector: ".foo\\:bar", expect: ["class-span3"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Class selector, matching element with class with escaped character", selector: ".test\\.foo\\[5\\]bar", expect: ["class-span4"], level: 1, testType: TEST_QSA | TEST_MATCH}, + + // ID Selectors + {name: "ID selector, matching element with specified id", selector: "#id #id-div1", expect: ["id-div1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "ID selector, chained, matching element with specified id", selector: "#id-div1, #id-div1", expect: ["id-div1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "ID selector, chained, matching element with specified id", selector: "#id-div1, #id-div2", expect: ["id-div1", "id-div2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "ID Selector, chained, with type selector", selector: "div#id-div1, div#id-div2", expect: ["id-div1", "id-div2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "ID selector, not matching non-existent descendant", selector: "#id #none", expect: [] /*no matches*/, level: 1, testType: TEST_QSA}, + {name: "ID selector, not matching non-existent ancestor", selector: "#none #id-div1", expect: [] /*no matches*/, level: 1, testType: TEST_QSA}, + {name: "ID selector, matching multiple elements with duplicate id", selector: "#id-li-duplicate", expect: ["id-li-duplicate", "id-li-duplicate", "id-li-duplicate", "id-li-duplicate"], level: 1, testType: TEST_QSA | TEST_MATCH}, + + {name: "ID selector, matching id value using non-ASCII characters (1)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "ID selector, matching id value using non-ASCII characters (2)", selector: "#\u53F0\u5317", expect: ["\u53F0\u5317"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "ID selector, matching id values using non-ASCII characters (1)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci, #\u53F0\u5317", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci", "\u53F0\u5317"], level: 1, testType: TEST_QSA | TEST_MATCH}, + + // XXX runMatchesTest() in level2-lib.js can't handle this because obtaining the expected nodes requires escaping characters when generating the selector from 'expect' values + {name: "ID selector, matching element with id with escaped character", selector: "#\\#foo\\:bar", expect: ["#foo:bar"], level: 1, testType: TEST_QSA}, + {name: "ID selector, matching element with id with escaped character", selector: "#test\\.foo\\[5\\]bar", expect: ["test.foo[5]bar"], level: 1, testType: TEST_QSA}, + + // Namespaces + // XXX runMatchesTest() in level2-lib.js can't handle these because non-HTML elements don't have a recognised id + {name: "Namespace selector, matching element with any namespace", selector: "#any-namespace *|div", expect: ["any-namespace-div1", "any-namespace-div2", "any-namespace-div3", "any-namespace-div4"], level: 3, testType: TEST_QSA}, + {name: "Namespace selector, matching div elements in no namespace only", selector: "#no-namespace |div", expect: ["no-namespace-div3"], level: 3, testType: TEST_QSA}, + {name: "Namespace selector, matching any elements in no namespace only", selector: "#no-namespace |*", expect: ["no-namespace-div3"], level: 3, testType: TEST_QSA}, + + // Combinators + // - Descendant combinator ' ' + {name: "Descendant combinator, matching element that is a descendant of an element with id", selector: "#descendant div", expect: ["descendant-div1", "descendant-div2", "descendant-div3", "descendant-div4"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator, matching element with id that is a descendant of an element", selector: "body #descendant-div1", expect: ["descendant-div1"], exclude: ["detached", "fragment"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator, matching element with id that is a descendant of an element", selector: "div #descendant-div1", expect: ["descendant-div1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator, matching element with id that is a descendant of an element with id", selector: "#descendant #descendant-div2", expect: ["descendant-div2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator, matching element with class that is a descendant of an element with id", selector: "#descendant .descendant-div2", expect: ["descendant-div2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator, matching element with class that is a descendant of an element with class", selector: ".descendant-div1 .descendant-div3", expect: ["descendant-div3"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator, not matching element with id that is not a descendant of an element with id", selector: "#descendant-div1 #descendant-div4", expect: [] /*no matches*/, level: 1, testType: TEST_QSA}, + {name: "Descendant combinator, whitespace characters", selector: "#descendant\t\r\n#descendant-div2", expect: ["descendant-div2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + + // - Descendant combinator '>>' + {name: "Descendant combinator '>>', matching element that is a descendant of an element with id", selector: "#descendant>>div", expect: ["descendant-div1", "descendant-div2", "descendant-div3", "descendant-div4"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with id that is a descendant of an element", selector: "body>>#descendant-div1", expect: ["descendant-div1"], exclude: ["detached", "fragment"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with id that is a descendant of an element", selector: "div>>#descendant-div1", expect: ["descendant-div1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with id that is a descendant of an element with id", selector: "#descendant>>#descendant-div2", expect: ["descendant-div2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with class that is a descendant of an element with id", selector: "#descendant>>.descendant-div2", expect: ["descendant-div2"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with class that is a descendant of an element with class", selector: ".descendant-div1>>.descendant-div3", expect: ["descendant-div3"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Descendant combinator '>>', not matching element with id that is not a descendant of an element with id", selector: "#descendant-div1>>#descendant-div4", expect: [] /*no matches*/, level: 1, testType: TEST_QSA}, + + // - Child combinator '>' + {name: "Child combinator, matching element that is a child of an element with id", selector: "#child>div", expect: ["child-div1", "child-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, matching element with id that is a child of an element", selector: "div>#child-div1", expect: ["child-div1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, matching element with id that is a child of an element with id", selector: "#child>#child-div1", expect: ["child-div1"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, matching element with id that is a child of an element with class", selector: "#child-div1>.child-div2", expect: ["child-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, matching element with class that is a child of an element with class", selector: ".child-div1>.child-div2", expect: ["child-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, not matching element with id that is not a child of an element with id", selector: "#child>#child-div3", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Child combinator, not matching element with id that is not a child of an element with class", selector: "#child-div1>.child-div3", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Child combinator, not matching element with class that is not a child of an element with class", selector: ".child-div1>.child-div3", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Child combinator, surrounded by whitespace", selector: "#child-div1\t\r\n>\t\r\n#child-div2", expect: ["child-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, whitespace after", selector: "#child-div1>\t\r\n#child-div2", expect: ["child-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, whitespace before", selector: "#child-div1\t\r\n>#child-div2", expect: ["child-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Child combinator, no whitespace", selector: "#child-div1>#child-div2", expect: ["child-div2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + + // - Adjacent sibling combinator '+' + {name: "Adjacent sibling combinator, matching element that is an adjacent sibling of an element with id", selector: "#adjacent-div2+div", expect: ["adjacent-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with id that is an adjacent sibling of an element", selector: "div+#adjacent-div4", expect: ["adjacent-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with id that is an adjacent sibling of an element with id", selector: "#adjacent-div2+#adjacent-div4", expect: ["adjacent-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with class that is an adjacent sibling of an element with id", selector: "#adjacent-div2+.adjacent-div4", expect: ["adjacent-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with class that is an adjacent sibling of an element with class", selector: ".adjacent-div2+.adjacent-div4", expect: ["adjacent-div4"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching p element that is an adjacent sibling of a div element", selector: "#adjacent div+p", expect: ["adjacent-p2"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, not matching element with id that is not an adjacent sibling of an element with id", selector: "#adjacent-div2+#adjacent-p2, #adjacent-div2+#adjacent-div1", expect: [] /*no matches*/, level: 2, testType: TEST_QSA}, + {name: "Adjacent sibling combinator, surrounded by whitespace", selector: "#adjacent-p2\t\r\n+\t\r\n#adjacent-p3", expect: ["adjacent-p3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, whitespace after", selector: "#adjacent-p2+\t\r\n#adjacent-p3", expect: ["adjacent-p3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, whitespace before", selector: "#adjacent-p2\t\r\n+#adjacent-p3", expect: ["adjacent-p3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + {name: "Adjacent sibling combinator, no whitespace", selector: "#adjacent-p2+#adjacent-p3", expect: ["adjacent-p3"], level: 2, testType: TEST_QSA | TEST_MATCH}, + + // - General sibling combinator ~ (Level 3) + {name: "General sibling combinator, matching element that is a sibling of an element with id", selector: "#sibling-div2~div", expect: ["sibling-div4", "sibling-div6"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, matching element with id that is a sibling of an element", selector: "div~#sibling-div4", expect: ["sibling-div4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, matching element with id that is a sibling of an element with id", selector: "#sibling-div2~#sibling-div4", expect: ["sibling-div4"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, matching element with class that is a sibling of an element with id", selector: "#sibling-div2~.sibling-div", expect: ["sibling-div4", "sibling-div6"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, matching p element that is a sibling of a div element", selector: "#sibling div~p", expect: ["sibling-p2", "sibling-p3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, not matching element with id that is not a sibling after a p element", selector: "#sibling>p~div", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + {name: "General sibling combinator, not matching element with id that is not a sibling after an element with id", selector: "#sibling-div2~#sibling-div3, #sibling-div2~#sibling-div1", expect: [] /*no matches*/, level: 3, testType: TEST_QSA}, + {name: "General sibling combinator, surrounded by whitespace", selector: "#sibling-p2\t\r\n~\t\r\n#sibling-p3", expect: ["sibling-p3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, whitespace after", selector: "#sibling-p2~\t\r\n#sibling-p3", expect: ["sibling-p3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, whitespace before", selector: "#sibling-p2\t\r\n~#sibling-p3", expect: ["sibling-p3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + {name: "General sibling combinator, no whitespace", selector: "#sibling-p2~#sibling-p3", expect: ["sibling-p3"], level: 3, testType: TEST_QSA | TEST_MATCH}, + + // Group of selectors (comma) + {name: "Syntax, group of selectors separator, surrounded by whitespace", selector: "#group em\t\r \n,\t\r \n#group strong", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Syntax, group of selectors separator, whitespace after", selector: "#group em,\t\r\n#group strong", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Syntax, group of selectors separator, whitespace before", selector: "#group em\t\r\n,#group strong", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_QSA | TEST_MATCH}, + {name: "Syntax, group of selectors separator, no whitespace", selector: "#group em,#group strong", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_QSA | TEST_MATCH}, +]; + + +/* + * These selectors are intended to be used with the find(), findAll() and matches() methods. Expected results + * should be determined under the assumption that :scope will be prepended to the selector where appropriate, + * in accordance with the specification. + * + * All of these should be valid relative selectors, expected to match zero or more elements in the document. + * None should throw any errors. + * + * name: A descriptive name of the selector being tested + * + * selector: The selector to test + * + * ctx: A selector to obtain the context object to use for tests invoking context.find(), + * and to use as a single reference node for tests invoking document.find(). + * Note: context = root.querySelector(ctx); + * + * ref: A selector to obtain the reference nodes to be used for the selector. + * Note: If root is the document or an in-document element: + * refNodes = document.querySelectorAll(ref); + * Otherwise, if root is a fragment or detached element: + * refNodes = root.querySelectorAll(ref); + * + * expect: A list of IDs of the elements expected to be matched. List must be given in tree order. + * + * unexpected: A list of IDs of some elements that are not expected to match the given selector. + * This is used to verify that unexpected.matches(selector, refNode) does not match. + * + * exclude: An array of contexts to exclude from testing. The valid values are: + * ["document", "element", "fragment", "detached", "html", "xhtml"] + * The "html" and "xhtml" values represent the type of document being queried. These are useful + * for tests that are affected by differences between HTML and XML, such as case sensitivity. + * + * level: An integer indicating the CSS or Selectors level in which the selector being tested was introduced. + * + * testType: A bit-mapped flag indicating the type of test. + * + * The test function for these tests accepts a specified root node, on which the methods will be invoked during the tests. + * + * Based on whether either 'context' or 'refNodes', or both, are specified the tests will execute the following methods: + * + * Where testType is TEST_FIND: + * + * context.findAll(selector, refNodes) + * context.findAll(selector) // Only if refNodes is not specified + * root.findAll(selector, context) // Only if refNodes is not specified + * root.findAll(selector, refNodes) // Only if context is not specified + * root.findAll(selector) // Only if neither context nor refNodes is specified + * + * Where testType is TEST_QSA + * + * context.querySelectorAll(selector) + * root.querySelectorAll(selector) // Only if neither context nor refNodes is specified + * + * Equivalent tests will be run for .find() as well. + * Note: Do not specify a testType of TEST_QSA where either implied :scope or explicit refNodes + * are required. + * + * Where testType is TEST_MATCH: + * For each expected result given, within the specified root: + * + * expect.matches(selector, context) // Only where refNodes is not specified + * expect.matches(selector, refNodes) + * expect.matches(selector) // Only if neither context nor refNodes is specified + * + * The tests involving refNodes for both find(), findAll() and matches() will each be run by passing the + * collection as a NodeList, an Array and, if there is only a single element, an Element node. + * + * Note: Interactive pseudo-classes (:active :hover and :focus) have not been tested in this test suite. + */ + +var scopedSelectors = [ + //{name: "", selector: "", ctx: "", ref: "", expect: [], level: 1, testType: TEST_FIND | TEST_MATCH}, + + // Universal Selector + {name: "Universal selector, matching all children of the specified reference element", selector: ">*", ctx: "#universal", expect: ["universal-p1", "universal-hr1", "universal-pre1", "universal-p2", "universal-address1"], unexpected: ["universal", "empty"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Universal selector, matching all grandchildren of the specified reference element", selector: ">*>*", ctx: "#universal", expect: ["universal-code1", "universal-span1", "universal-a1", "universal-code2"], unexpected: ["universal", "empty"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Universal selector, matching all children of the specified empty reference element", selector: ">*", ctx: "#empty", expect: [] /*no matches*/, unexpected: ["universal", "empty"], level: 2, testType: TEST_QSA}, + {name: "Universal selector, matching all descendants of the specified reference element", selector: "*", ctx: "#universal", expect: ["universal-p1", "universal-code1", "universal-hr1", "universal-pre1", "universal-span1", + "universal-p2", "universal-a1", "universal-address1", "universal-code2", "universal-a2"], unexpected: ["universal", "empty"], level: 2, testType: TEST_FIND | TEST_MATCH}, + + // Attribute Selectors + // - presence [att] + {name: "Attribute presence selector, matching align attribute with value", selector: ".attr-presence-div1[align]", ctx: "#attr-presence", expect: ["attr-presence-div1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute presence selector, matching align attribute with empty value", selector: ".attr-presence-div2[align]", ctx: "#attr-presence", expect: ["attr-presence-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute presence selector, matching title attribute, case insensitivity", selector: "[TiTlE]", ctx: "#attr-presence", expect: ["attr-presence-a1", "attr-presence-span1"], exclude: ["xhtml"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute presence selector, not matching title attribute, case sensitivity", selector: "[TiTlE]", ctx: "#attr-presence", expect: [], exclude: ["html"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute presence selector, matching custom data-* attribute", selector: "[data-attr-presence]", ctx: "#attr-presence", expect: ["attr-presence-pre1", "attr-presence-blockquote1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute presence selector, not matching attribute with similar name", selector: ".attr-presence-div3[align], .attr-presence-div4[align]", ctx: "#attr-presence", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Attribute presence selector, matching attribute with non-ASCII characters", selector: "ul[data-中文]", ctx: "#attr-presence", expect: ["attr-presence-ul1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute presence selector, not matching default option without selected attribute", selector: "#attr-presence-select1 option[selected]", ctx: "#attr-presence", expect: [] /* no matches */, level: 2, testType: TEST_FIND}, + {name: "Attribute presence selector, matching option with selected attribute", selector: "#attr-presence-select2 option[selected]", ctx: "#attr-presence", expect: ["attr-presence-select2-option4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute presence selector, matching multiple options with selected attributes", selector: "#attr-presence-select3 option[selected]", ctx: "#attr-presence", expect: ["attr-presence-select3-option2", "attr-presence-select3-option3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + + // - value [att=val] + {name: "Attribute value selector, matching align attribute with value", selector: "[align=\"center\"]", ctx: "#attr-value", expect: ["attr-value-div1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute value selector, matching align attribute with empty value", selector: "[align=\"\"]", ctx: "#attr-value", expect: ["attr-value-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute value selector, not matching align attribute with partial value", selector: "[align=\"c\"]", ctx: "#attr-value", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Attribute value selector, not matching align attribute with incorrect value", selector: "[align=\"centera\"]", ctx: "#attr-value", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Attribute value selector, matching custom data-* attribute with unicode escaped value", selector: "[data-attr-value=\"\\e9\"]", ctx: "#attr-value", expect: ["attr-value-div3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute value selector, matching custom data-* attribute with escaped character", selector: "[data-attr-value\_foo=\"\\e9\"]", ctx: "#attr-value", expect: ["attr-value-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute value selector with single-quoted value, matching multiple inputs with type attributes", selector: "input[type='hidden'],#attr-value input[type='radio']", ctx: "#attr-value", expect: ["attr-value-input3", "attr-value-input4", "attr-value-input6", "attr-value-input8", "attr-value-input9"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute value selector with double-quoted value, matching multiple inputs with type attributes", selector: "input[type=\"hidden\"],#attr-value input[type='radio']", ctx: "#attr-value", expect: ["attr-value-input3", "attr-value-input4", "attr-value-input6", "attr-value-input8", "attr-value-input9"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute value selector with unquoted value, matching multiple inputs with type attributes", selector: "input[type=hidden],#attr-value input[type=radio]", ctx: "#attr-value", expect: ["attr-value-input3", "attr-value-input4", "attr-value-input6", "attr-value-input8", "attr-value-input9"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute value selector, matching attribute with value using non-ASCII characters", selector: "[data-attr-value=中文]", ctx: "#attr-value", expect: ["attr-value-div5"], level: 2, testType: TEST_FIND | TEST_MATCH}, + + // - whitespace-separated list [att~=val] + {name: "Attribute whitespace-separated list selector, matching class attribute with value", selector: "[class~=\"div1\"]", ctx: "#attr-whitespace", expect: ["attr-whitespace-div1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector, not matching class attribute with empty value", selector: "[class~=\"\"]", ctx: "#attr-whitespace", expect: [] /*no matches*/ , level: 2, testType: TEST_FIND}, + {name: "Attribute whitespace-separated list selector, not matching class attribute with partial value", selector: "[data-attr-whitespace~=\"div\"]", ctx: "#attr-whitespace", expect: [] /*no matches*/ , level: 2, testType: TEST_FIND}, + {name: "Attribute whitespace-separated list selector, matching custom data-* attribute with unicode escaped value", selector: "[data-attr-whitespace~=\"\\0000e9\"]", ctx: "#attr-whitespace", expect: ["attr-whitespace-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector, matching custom data-* attribute with escaped character", selector: "[data-attr-whitespace\_foo~=\"\\e9\"]", ctx: "#attr-whitespace", expect: ["attr-whitespace-div5"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with single-quoted value, matching multiple links with rel attributes", selector: "a[rel~='bookmark'], #attr-whitespace a[rel~='nofollow']", ctx: "#attr-whitespace", expect: ["attr-whitespace-a1", "attr-whitespace-a2", "attr-whitespace-a3", "attr-whitespace-a5", "attr-whitespace-a7"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with double-quoted value, matching multiple links with rel attributes", selector: "a[rel~=\"bookmark\"],#attr-whitespace a[rel~='nofollow']", ctx: "#attr-whitespace", expect: ["attr-whitespace-a1", "attr-whitespace-a2", "attr-whitespace-a3", "attr-whitespace-a5", "attr-whitespace-a7"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with unquoted value, matching multiple links with rel attributes", selector: "a[rel~=bookmark], #attr-whitespace a[rel~=nofollow]", ctx: "#attr-whitespace", expect: ["attr-whitespace-a1", "attr-whitespace-a2", "attr-whitespace-a3", "attr-whitespace-a5", "attr-whitespace-a7"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute whitespace-separated list selector with double-quoted value, not matching value with space", selector: "a[rel~=\"book mark\"]", ctx: "#attr-whitespace", expect: [] /* no matches */, level: 2, testType: TEST_FIND}, + {name: "Attribute whitespace-separated list selector, matching title attribute with value using non-ASCII characters", selector: "[title~=中文]", ctx: "#attr-whitespace", expect: ["attr-whitespace-p1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + + // - hyphen-separated list [att|=val] + {name: "Attribute hyphen-separated list selector, not matching unspecified lang attribute", selector: "#attr-hyphen-div1[lang|=\"en\"]", ctx: "#attr-hyphen", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Attribute hyphen-separated list selector, matching lang attribute with exact value", selector: "#attr-hyphen-div2[lang|=\"fr\"]", ctx: "#attr-hyphen", expect: ["attr-hyphen-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute hyphen-separated list selector, matching lang attribute with partial value", selector: "#attr-hyphen-div3[lang|=\"en\"]", ctx: "#attr-hyphen", expect: ["attr-hyphen-div3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute hyphen-separated list selector, not matching incorrect value", selector: "#attr-hyphen-div4[lang|=\"es-AR\"]", ctx: "#attr-hyphen", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + + // - substring begins-with [att^=val] (Level 3) + {name: "Attribute begins with selector, matching href attributes beginning with specified substring", selector: "a[href^=\"http://www\"]", ctx: "#attr-begins", expect: ["attr-begins-a1", "attr-begins-a3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute begins with selector, matching lang attributes beginning with specified substring, ", selector: "[lang^=\"en-\"]", ctx: "#attr-begins", expect: ["attr-begins-div2", "attr-begins-div4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute begins with selector, not matching class attribute not beginning with specified substring", selector: "[class^=apple]", ctx: "#attr-begins", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + {name: "Attribute begins with selector with single-quoted value, matching class attribute beginning with specified substring", selector: "[class^=' apple']", ctx: "#attr-begins", expect: ["attr-begins-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute begins with selector with double-quoted value, matching class attribute beginning with specified substring", selector: "[class^=\" apple\"]", ctx: "#attr-begins", expect: ["attr-begins-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute begins with selector with unquoted value, not matching class attribute not beginning with specified substring", selector: "[class^= apple]", ctx: "#attr-begins", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + + // - substring ends-with [att$=val] (Level 3) + {name: "Attribute ends with selector, matching href attributes ending with specified substring", selector: "a[href$=\".org\"]", ctx: "#attr-ends", expect: ["attr-ends-a1", "attr-ends-a3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute ends with selector, matching lang attributes ending with specified substring, ", selector: "[lang$=\"-CH\"]", ctx: "#attr-ends", expect: ["attr-ends-div2", "attr-ends-div4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute ends with selector, not matching class attribute not ending with specified substring", selector: "[class$=apple]", ctx: "#attr-ends", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + {name: "Attribute ends with selector with single-quoted value, matching class attribute ending with specified substring", selector: "[class$='apple ']", ctx: "#attr-ends", expect: ["attr-ends-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute ends with selector with double-quoted value, matching class attribute ending with specified substring", selector: "[class$=\"apple \"]", ctx: "#attr-ends", expect: ["attr-ends-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute ends with selector with unquoted value, not matching class attribute not ending with specified substring", selector: "[class$=apple ]", ctx: "#attr-ends", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + + // - substring contains [att*=val] (Level 3) + {name: "Attribute contains selector, matching href attributes beginning with specified substring", selector: "a[href*=\"http://www\"]", ctx: "#attr-contains", expect: ["attr-contains-a1", "attr-contains-a3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector, matching href attributes ending with specified substring", selector: "a[href*=\".org\"]", ctx: "#attr-contains", expect: ["attr-contains-a1", "attr-contains-a2"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector, matching href attributes containing specified substring", selector: "a[href*=\".example.\"]", ctx: "#attr-contains", expect: ["attr-contains-a1", "attr-contains-a3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector, matching lang attributes beginning with specified substring, ", selector: "[lang*=\"en-\"]", ctx: "#attr-contains", expect: ["attr-contains-div2", "attr-contains-div6"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector, matching lang attributes ending with specified substring, ", selector: "[lang*=\"-CH\"]", ctx: "#attr-contains", expect: ["attr-contains-div3", "attr-contains-div5"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with single-quoted value, matching class attribute beginning with specified substring", selector: "[class*=' apple']", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with single-quoted value, matching class attribute ending with specified substring", selector: "[class*='orange ']", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with single-quoted value, matching class attribute containing specified substring", selector: "[class*='ple banana ora']", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with double-quoted value, matching class attribute beginning with specified substring", selector: "[class*=\" apple\"]", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with double-quoted value, matching class attribute ending with specified substring", selector: "[class*=\"orange \"]", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with double-quoted value, matching class attribute containing specified substring", selector: "[class*=\"ple banana ora\"]", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with unquoted value, matching class attribute beginning with specified substring", selector: "[class*= apple]", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with unquoted value, matching class attribute ending with specified substring", selector: "[class*=orange ]", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "Attribute contains selector with unquoted value, matching class attribute containing specified substring", selector: "[class*= banana ]", ctx: "#attr-contains", expect: ["attr-contains-p1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // Pseudo-classes + // - :root (Level 3) + {name: ":root pseudo-class selector, matching document root element", selector: ":root", expect: ["html"], exclude: ["element", "fragment", "detached"], level: 3, testType: TEST_FIND}, + {name: ":root pseudo-class selector, not matching document root element", selector: ":root", expect: [] /*no matches*/, exclude: ["document"], level: 3, testType: TEST_FIND}, + {name: ":root pseudo-class selector, not matching document root element", selector: ":root", ctx: "#html", expect: [] /*no matches*/, exclude: ["fragment", "detached"], level: 3, testType: TEST_FIND}, + + // - :nth-child(n) (Level 3) + {name: ":nth-child selector, matching the third child element", selector: ":nth-child(3)", ctx: "#pseudo-nth-table1", expect: ["pseudo-nth-td3", "pseudo-nth-td9", "pseudo-nth-tr3", "pseudo-nth-td15"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-child selector, matching every third child element", selector: "li:nth-child(3n)", ctx: "#pseudo-nth", expect: ["pseudo-nth-li3", "pseudo-nth-li6", "pseudo-nth-li9", "pseudo-nth-li12"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-child selector, matching every second child element, starting from the fourth", selector: "li:nth-child(2n+4)", ctx: "#pseudo-nth", expect: ["pseudo-nth-li4", "pseudo-nth-li6", "pseudo-nth-li8", "pseudo-nth-li10", "pseudo-nth-li12"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-child selector, matching every fourth child element, starting from the third", selector: ":nth-child(4n-1)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-em2", "pseudo-nth-span3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :nth-last-child (Level 3) + {name: ":nth-last-child selector, matching the third last child element", selector: ":nth-last-child(3)", ctx: "#pseudo-nth-table1", expect: ["pseudo-nth-tr1", "pseudo-nth-td4", "pseudo-nth-td10", "pseudo-nth-td16"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-last-child selector, matching every third child element from the end", selector: "li:nth-last-child(3n)", ctx: "pseudo-nth", expect: ["pseudo-nth-li1", "pseudo-nth-li4", "pseudo-nth-li7", "pseudo-nth-li10"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-last-child selector, matching every second child element from the end, starting from the fourth last", selector: "li:nth-last-child(2n+4)", ctx: "pseudo-nth", expect: ["pseudo-nth-li1", "pseudo-nth-li3", "pseudo-nth-li5", "pseudo-nth-li7", "pseudo-nth-li9"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-last-child selector, matching every fourth element from the end, starting from the third last", selector: ":nth-last-child(4n-1)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-span2", "pseudo-nth-span4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :nth-of-type(n) (Level 3) + {name: ":nth-of-type selector, matching the third em element", selector: "em:nth-of-type(3)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-em3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-of-type selector, matching every second element of their type", selector: ":nth-of-type(2n)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-em2", "pseudo-nth-span2", "pseudo-nth-span4", "pseudo-nth-strong2", "pseudo-nth-em4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-of-type selector, matching every second elemetn of their type, starting from the first", selector: "span:nth-of-type(2n-1)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-span1", "pseudo-nth-span3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :nth-last-of-type(n) (Level 3) + {name: ":nth-last-of-type selector, matching the thrid last em element", selector: "em:nth-last-of-type(3)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-em2"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-last-of-type selector, matching every second last element of their type", selector: ":nth-last-of-type(2n)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-span1", "pseudo-nth-em1", "pseudo-nth-strong1", "pseudo-nth-em3", "pseudo-nth-span3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":nth-last-of-type selector, matching every second last element of their type, starting from the last", selector: "span:nth-last-of-type(2n-1)", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-span2", "pseudo-nth-span4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :first-of-type (Level 3) + {name: ":first-of-type selector, matching the first em element", selector: "em:first-of-type", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-em1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":first-of-type selector, matching the first of every type of element", selector: ":first-of-type", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-span1", "pseudo-nth-em1", "pseudo-nth-strong1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":first-of-type selector, matching the first td element in each table row", selector: "tr :first-of-type", ctx: "#pseudo-nth-table1", expect: ["pseudo-nth-td1", "pseudo-nth-td7", "pseudo-nth-td13"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :last-of-type (Level 3) + {name: ":last-of-type selector, matching the last em elemnet", selector: "em:last-of-type", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-em4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":last-of-type selector, matching the last of every type of element", selector: ":last-of-type", ctx: "#pseudo-nth-p1", expect: ["pseudo-nth-span4", "pseudo-nth-strong2", "pseudo-nth-em4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":last-of-type selector, matching the last td element in each table row", selector: "tr :last-of-type", ctx: "#pseudo-nth-table1", expect: ["pseudo-nth-td6", "pseudo-nth-td12", "pseudo-nth-td18"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :first-child + {name: ":first-child pseudo-class selector, matching first child div element", selector: "div:first-child", ctx: "#pseudo-first-child", expect: ["pseudo-first-child-div1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: ":first-child pseudo-class selector, doesn't match non-first-child elements", selector: ".pseudo-first-child-div2:first-child, .pseudo-first-child-div3:first-child", ctx: "#pseudo-first-child", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: ":first-child pseudo-class selector, matching first-child of multiple elements", selector: "span:first-child", ctx: "#pseudo-first-child", expect: ["pseudo-first-child-span1", "pseudo-first-child-span3", "pseudo-first-child-span5"], level: 2, testType: TEST_FIND | TEST_MATCH}, + + // - :last-child (Level 3) + {name: ":last-child pseudo-class selector, matching last child div element", selector: "div:last-child", ctx: "#pseudo-last-child", expect: ["pseudo-last-child-div3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":last-child pseudo-class selector, doesn't match non-last-child elements", selector: ".pseudo-last-child-div1:last-child, .pseudo-last-child-div2:first-child", ctx: "#pseudo-last-child", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + {name: ":last-child pseudo-class selector, matching first-child of multiple elements", selector: "span:last-child", ctx: "#pseudo-last-child", expect: ["pseudo-last-child-span2", "pseudo-last-child-span4", "pseudo-last-child-span6"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :only-child (Level 3) + {name: ":pseudo-only-child pseudo-class selector, matching all only-child elements", selector: ":only-child", ctx: "#pseudo-only", expect: ["pseudo-only-span1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":pseudo-only-child pseudo-class selector, matching only-child em elements", selector: "em:only-child", ctx: "#pseudo-only", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + + // - :only-of-type (Level 3) + {name: ":pseudo-only-of-type pseudo-class selector, matching all elements with no siblings of the same type", selector: " :only-of-type", ctx: "#pseudo-only", expect: ["pseudo-only-span1", "pseudo-only-em1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":pseudo-only-of-type pseudo-class selector, matching em elements with no siblings of the same type", selector: " em:only-of-type", ctx: "#pseudo-only", expect: ["pseudo-only-em1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :empty (Level 3) + {name: ":empty pseudo-class selector, matching empty p elements", selector: "p:empty", ctx: "#pseudo-empty", expect: ["pseudo-empty-p1", "pseudo-empty-p2"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":empty pseudo-class selector, matching all empty elements", selector: ":empty", ctx: "#pseudo-empty", expect: ["pseudo-empty-p1", "pseudo-empty-p2", "pseudo-empty-span1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :link and :visited + // Implementations may treat all visited links as unvisited, so these cannot be tested separately. + // The only guarantee is that ":link,:visited" matches the set of all visited and unvisited links and that they are individually mutually exclusive sets. + {name: ":link and :visited pseudo-class selectors, matching a and area elements with href attributes", selector: " :link, #pseudo-link :visited", ctx: "#pseudo-link", expect: ["pseudo-link-a1", "pseudo-link-a2", "pseudo-link-area1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: ":link and :visited pseudo-class selectors, matching link elements with href attributes", selector: " :link, #head :visited", ctx: "#head", expect: ["pseudo-link-link1", "pseudo-link-link2"], exclude: ["element", "fragment", "detached"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: ":link and :visited pseudo-class selectors, not matching link elements with href attributes", selector: " :link, #head :visited", ctx: "#head", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_FIND}, + {name: ":link and :visited pseudo-class selectors, chained, mutually exclusive pseudo-classes match nothing", selector: ":link:visited", ctx: "#html", expect: [] /*no matches*/, exclude: ["document"], level: 1, testType: TEST_FIND}, + +// XXX Figure out context or refNodes for this + // - :target (Level 3) + {name: ":target pseudo-class selector, matching the element referenced by the URL fragment identifier", selector: ":target", ctx: "", expect: [] /*no matches*/, exclude: ["document", "element"], level: 3, testType: TEST_FIND}, + {name: ":target pseudo-class selector, matching the element referenced by the URL fragment identifier", selector: ":target", ctx: "", expect: ["target"], exclude: ["fragment", "detached"], level: 3, testType: TEST_FIND}, + +// XXX Fix ctx in tests below + + // - :lang() + {name: ":lang pseudo-class selector, matching inherited language (1)", selector: "#pseudo-lang-div1:lang(en)", ctx: "", expect: ["pseudo-lang-div1"], exclude: ["detached", "fragment"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: ":lang pseudo-class selector, not matching element with no inherited language", selector: "#pseudo-lang-div1:lang(en)", ctx: "", expect: [] /*no matches*/, exclude: ["document", "element"], level: 2, testType: TEST_FIND}, + {name: ":lang pseudo-class selector, matching specified language with exact value (1)", selector: "#pseudo-lang-div2:lang(fr)", ctx: "", expect: ["pseudo-lang-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: ":lang pseudo-class selector, matching specified language with partial value (1)", selector: "#pseudo-lang-div3:lang(en)", ctx: "", expect: ["pseudo-lang-div3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: ":lang pseudo-class selector, not matching incorrect language", selector: "#pseudo-lang-div4:lang(es-AR)", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + + // - :enabled (Level 3) + {name: ":enabled pseudo-class selector, matching all enabled form controls (1)", selector: "#pseudo-ui :enabled", ctx: "", expect: ["pseudo-ui-input1", "pseudo-ui-input2", "pseudo-ui-input3", "pseudo-ui-input4", "pseudo-ui-input5", "pseudo-ui-input6", + "pseudo-ui-input7", "pseudo-ui-input8", "pseudo-ui-input9", "pseudo-ui-textarea1", "pseudo-ui-button1"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :disabled (Level 3) + {name: ":enabled pseudo-class selector, matching all disabled form controls (1)", selector: "#pseudo-ui :disabled", ctx: "", expect: ["pseudo-ui-input10", "pseudo-ui-input11", "pseudo-ui-input12", "pseudo-ui-input13", "pseudo-ui-input14", "pseudo-ui-input15", + "pseudo-ui-input16", "pseudo-ui-input17", "pseudo-ui-input18", "pseudo-ui-textarea2", "pseudo-ui-button2"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :checked (Level 3) + {name: ":checked pseudo-class selector, matching checked radio buttons and checkboxes (1)", selector: "#pseudo-ui :checked", ctx: "", expect: ["pseudo-ui-input4", "pseudo-ui-input6", "pseudo-ui-input13", "pseudo-ui-input15"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // - :not(s) (Level 3) + {name: ":not pseudo-class selector, matching (1)", selector: "#not>:not(div)", ctx: "", expect: ["not-p1", "not-p2", "not-p3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":not pseudo-class selector, matching (1)", selector: "#not * :not(:first-child)", ctx: "", expect: ["not-em1", "not-em2", "not-em3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: ":not pseudo-class selector, matching nothing", selector: ":not(*)", ctx: "", expect: [] /* no matches */, level: 3, testType: TEST_FIND}, + {name: ":not pseudo-class selector, matching nothing", selector: ":not(*|*)", ctx: "", expect: [] /* no matches */, level: 3, testType: TEST_FIND}, + + // Pseudo-elements + // - ::first-line + {name: ":first-line pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:first-line", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "::first-line pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::first-line", ctx: "", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + + // - ::first-letter + {name: ":first-letter pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:first-letter", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "::first-letter pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::first-letter", ctx: "", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + + // - ::before + {name: ":before pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:before", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "::before pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::before", ctx: "", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + + // - ::after + {name: ":after pseudo-element (one-colon syntax) selector, not matching any elements", selector: "#pseudo-element:after", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "::after pseudo-element (two-colon syntax) selector, not matching any elements", selector: "#pseudo-element::after", ctx: "", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + + // Class Selectors + {name: "Class selector, matching element with specified class (1)", selector: ".class-p", ctx: "", expect: ["class-p1","class-p2", "class-p3"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Class selector, chained, matching only elements with all specified classes (1)", selector: "#class .apple.orange.banana", ctx: "", expect: ["class-div1", "class-div2", "class-p4", "class-div3", "class-p6", "class-div4"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Class Selector, chained, with type selector (1)", selector: "div.apple.banana.orange", ctx: "", expect: ["class-div1", "class-div2", "class-div3", "class-div4"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Class selector, matching element with class value using non-ASCII characters (2)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci", ctx: "", expect: ["class-span1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Class selector, matching multiple elements with class value using non-ASCII characters (1)", selector: ".\u53F0\u5317", ctx: "", expect: ["class-span1","class-span2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Class selector, chained, matching element with multiple class values using non-ASCII characters (2)", selector: ".\u53F0\u5317Ta\u0301ibe\u030Ci.\u53F0\u5317", ctx: "", expect: ["class-span1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Class selector, matching element with class with escaped character (1)", selector: ".foo\\:bar", ctx: "", expect: ["class-span3"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Class selector, matching element with class with escaped character (1)", selector: ".test\\.foo\\[5\\]bar", ctx: "", expect: ["class-span4"], level: 1, testType: TEST_FIND | TEST_MATCH}, + + // ID Selectors + {name: "ID selector, matching element with specified id (1)", selector: "#id #id-div1", ctx: "", expect: ["id-div1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "ID selector, chained, matching element with specified id (1)", selector: "#id-div1, #id-div1", ctx: "", expect: ["id-div1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "ID selector, chained, matching element with specified id (1)", selector: "#id-div1, #id-div2", ctx: "", expect: ["id-div1", "id-div2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "ID Selector, chained, with type selector (1)", selector: "div#id-div1, div#id-div2", ctx: "", expect: ["id-div1", "id-div2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "ID selector, not matching non-existent descendant", selector: "#id #none", ctx: "", expect: [] /*no matches*/, level: 1, testType: TEST_FIND}, + {name: "ID selector, not matching non-existent ancestor", selector: "#none #id-div1", ctx: "", expect: [] /*no matches*/, level: 1, testType: TEST_FIND}, + {name: "ID selector, matching multiple elements with duplicate id (1)", selector: "#id-li-duplicate", ctx: "", expect: ["id-li-duplicate", "id-li-duplicate", "id-li-duplicate", "id-li-duplicate"], level: 1, testType: TEST_FIND | TEST_MATCH}, + + {name: "ID selector, matching id value using non-ASCII characters (3)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci", ctx: "", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "ID selector, matching id value using non-ASCII characters (4)", selector: "#\u53F0\u5317", ctx: "", expect: ["\u53F0\u5317"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "ID selector, matching id values using non-ASCII characters (2)", selector: "#\u53F0\u5317Ta\u0301ibe\u030Ci, #\u53F0\u5317", ctx: "", expect: ["\u53F0\u5317Ta\u0301ibe\u030Ci", "\u53F0\u5317"], level: 1, testType: TEST_FIND | TEST_MATCH}, + + // XXX runMatchesTest() in level2-lib.js can't handle this because obtaining the expected nodes requires escaping characters when generating the selector from 'expect' values + {name: "ID selector, matching element with id with escaped character", selector: "#\\#foo\\:bar", ctx: "", expect: ["#foo:bar"], level: 1, testType: TEST_FIND}, + {name: "ID selector, matching element with id with escaped character", selector: "#test\\.foo\\[5\\]bar", ctx: "", expect: ["test.foo[5]bar"], level: 1, testType: TEST_FIND}, + + // Namespaces + // XXX runMatchesTest() in level2-lib.js can't handle these because non-HTML elements don't have a recognised id + {name: "Namespace selector, matching element with any namespace", selector: "#any-namespace *|div", ctx: "", expect: ["any-namespace-div1", "any-namespace-div2", "any-namespace-div3", "any-namespace-div4"], level: 3, testType: TEST_FIND}, + {name: "Namespace selector, matching div elements in no namespace only", selector: "#no-namespace |div", ctx: "", expect: ["no-namespace-div3"], level: 3, testType: TEST_FIND}, + {name: "Namespace selector, matching any elements in no namespace only", selector: "#no-namespace |*", ctx: "", expect: ["no-namespace-div3"], level: 3, testType: TEST_FIND}, + + // Combinators + // - Descendant combinator ' ' + {name: "Descendant combinator, matching element that is a descendant of an element with id (1)", selector: "#descendant div", ctx: "", expect: ["descendant-div1", "descendant-div2", "descendant-div3", "descendant-div4"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator, matching element with id that is a descendant of an element (1)", selector: "body #descendant-div1", ctx: "", expect: ["descendant-div1"], exclude: ["detached", "fragment"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator, matching element with id that is a descendant of an element (1)", selector: "div #descendant-div1", ctx: "", expect: ["descendant-div1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator, matching element with id that is a descendant of an element with id (1)", selector: "#descendant #descendant-div2", ctx: "", expect: ["descendant-div2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator, matching element with class that is a descendant of an element with id (1)", selector: "#descendant .descendant-div2", ctx: "", expect: ["descendant-div2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator, matching element with class that is a descendant of an element with class (1)", selector: ".descendant-div1 .descendant-div3", ctx: "", expect: ["descendant-div3"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator, not matching element with id that is not a descendant of an element with id", selector: "#descendant-div1 #descendant-div4", ctx: "", expect: [] /*no matches*/, level: 1, testType: TEST_FIND}, + {name: "Descendant combinator, whitespace characters (1)", selector: "#descendant\t\r\n#descendant-div2", ctx: "", expect: ["descendant-div2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + + // - Descendant combinator '>>' + {name: "Descendant combinator '>>', matching element that is a descendant of an element with id (1)", selector: "#descendant>>div", ctx: "", expect: ["descendant-div1", "descendant-div2", "descendant-div3", "descendant-div4"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with id that is a descendant of an element (1)", selector: "body>>#descendant-div1", ctx: "", expect: ["descendant-div1"], exclude: ["detached", "fragment"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with id that is a descendant of an element (1)", selector: "div>>#descendant-div1", ctx: "", expect: ["descendant-div1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with id that is a descendant of an element with id (1)", selector: "#descendant>>#descendant-div2", ctx: "", expect: ["descendant-div2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator '>>', matching element with class that is a descendant of an element with id (1)", selector: "#descendant>>.descendant-div2", ctx: "", expect: ["descendant-div2"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator, '>>', matching element with class that is a descendant of an element with class (1)", selector: ".descendant-div1>>.descendant-div3", ctx: "", expect: ["descendant-div3"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Descendant combinator '>>', not matching element with id that is not a descendant of an element with id", selector: "#descendant-div1>>#descendant-div4", ctx: "", expect: [] /*no matches*/, level: 1, testType: TEST_FIND}, + + // - Child combinator '>' + {name: "Child combinator, matching element that is a child of an element with id (1)", selector: "#child>div", ctx: "", expect: ["child-div1", "child-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, matching element with id that is a child of an element (1)", selector: "div>#child-div1", ctx: "", expect: ["child-div1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, matching element with id that is a child of an element with id (1)", selector: "#child>#child-div1", ctx: "", expect: ["child-div1"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, matching element with id that is a child of an element with class (1)", selector: "#child-div1>.child-div2", ctx: "", expect: ["child-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, matching element with class that is a child of an element with class (1)", selector: ".child-div1>.child-div2", ctx: "", expect: ["child-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, not matching element with id that is not a child of an element with id", selector: "#child>#child-div3", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Child combinator, not matching element with id that is not a child of an element with class", selector: "#child-div1>.child-div3", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Child combinator, not matching element with class that is not a child of an element with class", selector: ".child-div1>.child-div3", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Child combinator, surrounded by whitespace (1)", selector: "#child-div1\t\r\n>\t\r\n#child-div2", ctx: "", expect: ["child-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, whitespace after (1)", selector: "#child-div1>\t\r\n#child-div2", ctx: "", expect: ["child-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, whitespace before (1)", selector: "#child-div1\t\r\n>#child-div2", ctx: "", expect: ["child-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Child combinator, no whitespace (1)", selector: "#child-div1>#child-div2", ctx: "", expect: ["child-div2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + + // - Adjacent sibling combinator '+' + {name: "Adjacent sibling combinator, matching element that is an adjacent sibling of an element with id (1)", selector: "#adjacent-div2+div", ctx: "", expect: ["adjacent-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with id that is an adjacent sibling of an element (1)", selector: "div+#adjacent-div4", ctx: "", expect: ["adjacent-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with id that is an adjacent sibling of an element with id (1)", selector: "#adjacent-div2+#adjacent-div4", ctx: "", expect: ["adjacent-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with class that is an adjacent sibling of an element with id (1)", selector: "#adjacent-div2+.adjacent-div4", ctx: "", expect: ["adjacent-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching element with class that is an adjacent sibling of an element with class (1)", selector: ".adjacent-div2+.adjacent-div4", ctx: "", expect: ["adjacent-div4"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, matching p element that is an adjacent sibling of a div element (1)", selector: "#adjacent div+p", ctx: "", expect: ["adjacent-p2"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, not matching element with id that is not an adjacent sibling of an element with id", selector: "#adjacent-div2+#adjacent-p2, #adjacent-div2+#adjacent-div1", ctx: "", expect: [] /*no matches*/, level: 2, testType: TEST_FIND}, + {name: "Adjacent sibling combinator, surrounded by whitespace (1)", selector: "#adjacent-p2\t\r\n+\t\r\n#adjacent-p3", ctx: "", expect: ["adjacent-p3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, whitespace after (1)", selector: "#adjacent-p2+\t\r\n#adjacent-p3", ctx: "", expect: ["adjacent-p3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, whitespace before (1)", selector: "#adjacent-p2\t\r\n+#adjacent-p3", ctx: "", expect: ["adjacent-p3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + {name: "Adjacent sibling combinator, no whitespace (1)", selector: "#adjacent-p2+#adjacent-p3", ctx: "", expect: ["adjacent-p3"], level: 2, testType: TEST_FIND | TEST_MATCH}, + + // - General sibling combinator ~ (Level 3) + {name: "General sibling combinator, matching element that is a sibling of an element with id (1)", selector: "#sibling-div2~div", ctx: "", expect: ["sibling-div4", "sibling-div6"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, matching element with id that is a sibling of an element (1)", selector: "div~#sibling-div4", ctx: "", expect: ["sibling-div4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, matching element with id that is a sibling of an element with id (1)", selector: "#sibling-div2~#sibling-div4", ctx: "", expect: ["sibling-div4"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, matching element with class that is a sibling of an element with id (1)", selector: "#sibling-div2~.sibling-div", ctx: "", expect: ["sibling-div4", "sibling-div6"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, matching p element that is a sibling of a div element (1)", selector: "#sibling div~p", ctx: "", expect: ["sibling-p2", "sibling-p3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, not matching element with id that is not a sibling after a p element (1)", selector: "#sibling>p~div", ctx: "", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + {name: "General sibling combinator, not matching element with id that is not a sibling after an element with id", selector: "#sibling-div2~#sibling-div3, #sibling-div2~#sibling-div1", ctx: "", expect: [] /*no matches*/, level: 3, testType: TEST_FIND}, + {name: "General sibling combinator, surrounded by whitespace (1)", selector: "#sibling-p2\t\r\n~\t\r\n#sibling-p3", ctx: "", expect: ["sibling-p3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, whitespace after (1)", selector: "#sibling-p2~\t\r\n#sibling-p3", ctx: "", expect: ["sibling-p3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, whitespace before (1)", selector: "#sibling-p2\t\r\n~#sibling-p3", ctx: "", expect: ["sibling-p3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + {name: "General sibling combinator, no whitespace (1)", selector: "#sibling-p2~#sibling-p3", ctx: "", expect: ["sibling-p3"], level: 3, testType: TEST_FIND | TEST_MATCH}, + + // Group of selectors (comma) + {name: "Syntax, group of selectors separator, surrounded by whitespace (1)", selector: "#group em\t\r \n,\t\r \n#group strong", ctx: "", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Syntax, group of selectors separator, whitespace after (1)", selector: "#group em,\t\r\n#group strong", ctx: "", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Syntax, group of selectors separator, whitespace before (1)", selector: "#group em\t\r\n,#group strong", ctx: "", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_FIND | TEST_MATCH}, + {name: "Syntax, group of selectors separator, no whitespace (1)", selector: "#group em,#group strong", ctx: "", expect: ["group-em1", "group-strong1"], level: 1, testType: TEST_FIND | TEST_MATCH}, +]; diff --git a/testing/web-platform/tests/dom/ranges/Range-attributes.html b/testing/web-platform/tests/dom/ranges/Range-attributes.html new file mode 100644 index 000000000..ced47edc5 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-attributes.html @@ -0,0 +1,23 @@ + +Range attributes + + + + +
      + diff --git a/testing/web-platform/tests/dom/ranges/Range-cloneContents.html b/testing/web-platform/tests/dom/ranges/Range-cloneContents.html new file mode 100644 index 000000000..bf75c9204 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-cloneContents.html @@ -0,0 +1,457 @@ + +Range.cloneContents() tests + + +

      To debug test failures, add a query parameter "subtest" with the test id (like +"?subtest=5"). Only that test will be run. Then you can look at the resulting +iframe in the DOM. +

      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-cloneRange.html b/testing/web-platform/tests/dom/ranges/Range-cloneRange.html new file mode 100644 index 000000000..6c736df29 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-cloneRange.html @@ -0,0 +1,112 @@ + +Range.cloneRange() and document.createRange() tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-collapse.html b/testing/web-platform/tests/dom/ranges/Range-collapse.html new file mode 100644 index 000000000..78e1d9fb4 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-collapse.html @@ -0,0 +1,75 @@ + +Range.collapse() and .collapsed tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer-2.html b/testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer-2.html new file mode 100644 index 000000000..f0a3e451c --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer-2.html @@ -0,0 +1,33 @@ + +Range.commonAncestorContainer + + +
      + diff --git a/testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer.html b/testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer.html new file mode 100644 index 000000000..7882ccc31 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-commonAncestorContainer.html @@ -0,0 +1,40 @@ + +Range.commonAncestorContainer tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-compareBoundaryPoints.html b/testing/web-platform/tests/dom/ranges/Range-compareBoundaryPoints.html new file mode 100644 index 000000000..48413ecd8 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-compareBoundaryPoints.html @@ -0,0 +1,182 @@ + +Range.compareBoundaryPoints() tests + + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-comparePoint-2.html b/testing/web-platform/tests/dom/ranges/Range-comparePoint-2.html new file mode 100644 index 000000000..356c8d351 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-comparePoint-2.html @@ -0,0 +1,23 @@ + +Range.comparePoint + + + + +
      + diff --git a/testing/web-platform/tests/dom/ranges/Range-comparePoint.html b/testing/web-platform/tests/dom/ranges/Range-comparePoint.html new file mode 100644 index 000000000..95264796b --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-comparePoint.html @@ -0,0 +1,92 @@ + +Range.comparePoint() tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-constructor.html b/testing/web-platform/tests/dom/ranges/Range-constructor.html new file mode 100644 index 000000000..e8cfbef75 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-constructor.html @@ -0,0 +1,20 @@ + +Range constructor test + +
      + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-deleteContents.html b/testing/web-platform/tests/dom/ranges/Range-deleteContents.html new file mode 100644 index 000000000..40dc40012 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-deleteContents.html @@ -0,0 +1,337 @@ + +Range.deleteContents() tests + + +

      To debug test failures, add a query parameter "subtest" with the test id (like +"?subtest=5"). Only that test will be run. Then you can look at the resulting +iframe in the DOM. +

      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-detach.html b/testing/web-platform/tests/dom/ranges/Range-detach.html new file mode 100644 index 000000000..ac35d7136 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-detach.html @@ -0,0 +1,14 @@ + +Range.detach + + + + +
      + diff --git a/testing/web-platform/tests/dom/ranges/Range-extractContents.html b/testing/web-platform/tests/dom/ranges/Range-extractContents.html new file mode 100644 index 000000000..098837f0c --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-extractContents.html @@ -0,0 +1,248 @@ + +Range.extractContents() tests + + +

      To debug test failures, add a query parameter "subtest" with the test id (like +"?subtest=5"). Only that test will be run. Then you can look at the resulting +iframe in the DOM. +

      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-insertNode.html b/testing/web-platform/tests/dom/ranges/Range-insertNode.html new file mode 100644 index 000000000..4c4073b21 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-insertNode.html @@ -0,0 +1,286 @@ + +Range.insertNode() tests + + +

      To debug test failures, add a query parameter "subtest" with the test id (like +"?subtest=5,16"). Only that test will be run. Then you can look at the resulting +iframes in the DOM. +

      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-intersectsNode-binding.html b/testing/web-platform/tests/dom/ranges/Range-intersectsNode-binding.html new file mode 100644 index 000000000..729388428 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-intersectsNode-binding.html @@ -0,0 +1,25 @@ + +Range.intersectsNode + + + + +
      + diff --git a/testing/web-platform/tests/dom/ranges/Range-intersectsNode.html b/testing/web-platform/tests/dom/ranges/Range-intersectsNode.html new file mode 100644 index 000000000..97e10f6f0 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-intersectsNode.html @@ -0,0 +1,70 @@ + +Range.intersectsNode() tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-isPointInRange.html b/testing/web-platform/tests/dom/ranges/Range-isPointInRange.html new file mode 100644 index 000000000..fa87442b8 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-isPointInRange.html @@ -0,0 +1,83 @@ + +Range.isPointInRange() tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-mutations.html b/testing/web-platform/tests/dom/ranges/Range-mutations.html new file mode 100644 index 000000000..ef99ca2ef --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-mutations.html @@ -0,0 +1,950 @@ + +Range mutation tests + + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-selectNode.html b/testing/web-platform/tests/dom/ranges/Range-selectNode.html new file mode 100644 index 000000000..2d9ec6b9a --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-selectNode.html @@ -0,0 +1,99 @@ + +Range.selectNode() and .selectNodeContents() tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-set.html b/testing/web-platform/tests/dom/ranges/Range-set.html new file mode 100644 index 000000000..5b43c04f4 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-set.html @@ -0,0 +1,221 @@ + +Range setting tests + + + +
      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-stringifier.html b/testing/web-platform/tests/dom/ranges/Range-stringifier.html new file mode 100644 index 000000000..330c7421e --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-stringifier.html @@ -0,0 +1,44 @@ + + +Range stringifier + + + +
      Test div
      +
      Another div
      +
      Last div
      +
      + diff --git a/testing/web-platform/tests/dom/ranges/Range-surroundContents.html b/testing/web-platform/tests/dom/ranges/Range-surroundContents.html new file mode 100644 index 000000000..e8cc11b24 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-surroundContents.html @@ -0,0 +1,324 @@ + + +Range.surroundContents() tests + + +

      To debug test failures, add a query parameter "subtest" with the test id (like +"?subtest=5,16"). Only that test will be run. Then you can look at the resulting +iframes in the DOM. +

      + + + + diff --git a/testing/web-platform/tests/dom/ranges/Range-test-iframe.html b/testing/web-platform/tests/dom/ranges/Range-test-iframe.html new file mode 100644 index 000000000..f354ff758 --- /dev/null +++ b/testing/web-platform/tests/dom/ranges/Range-test-iframe.html @@ -0,0 +1,56 @@ + +Range test iframe + + + + + diff --git a/testing/web-platform/tests/dom/traversal/NodeFilter-constants.html b/testing/web-platform/tests/dom/traversal/NodeFilter-constants.html new file mode 100644 index 000000000..1ce4736cc --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/NodeFilter-constants.html @@ -0,0 +1,34 @@ + +NodeFilter constants + + + +
      + diff --git a/testing/web-platform/tests/dom/traversal/NodeIterator-removal.html b/testing/web-platform/tests/dom/traversal/NodeIterator-removal.html new file mode 100644 index 000000000..b5fc69541 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/NodeIterator-removal.html @@ -0,0 +1,100 @@ + +NodeIterator removal tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/traversal/NodeIterator.html b/testing/web-platform/tests/dom/traversal/NodeIterator.html new file mode 100644 index 000000000..0f618efb4 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/NodeIterator.html @@ -0,0 +1,202 @@ + +NodeIterator tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-acceptNode-filter.html b/testing/web-platform/tests/dom/traversal/TreeWalker-acceptNode-filter.html new file mode 100644 index 000000000..1446f40f6 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-acceptNode-filter.html @@ -0,0 +1,155 @@ + + + + +TreeWalker: acceptNode-filter + + + +
      + + +

      Test JS objects as NodeFilters

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-basic.html b/testing/web-platform/tests/dom/traversal/TreeWalker-basic.html new file mode 100644 index 000000000..d1147637b --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-basic.html @@ -0,0 +1,154 @@ + + + + +TreeWalker: Basic test + + + +
      + + +

      This test checks the basic functionality of TreeWalker.

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-currentNode.html b/testing/web-platform/tests/dom/traversal/TreeWalker-currentNode.html new file mode 100644 index 000000000..8a09940b1 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-currentNode.html @@ -0,0 +1,73 @@ + + + + +TreeWalker: currentNode + + + +
      + + +
      +

      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

      +
      +

      Test TreeWalker currentNode functionality

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-previousNodeLastChildReject.html b/testing/web-platform/tests/dom/traversal/TreeWalker-previousNodeLastChildReject.html new file mode 100644 index 000000000..236ab803c --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-previousNodeLastChildReject.html @@ -0,0 +1,87 @@ + + + + +TreeWalker: previousNodeLastChildReject + + + +
      + + +

      Test that previousNode properly respects the filter.

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-previousSiblingLastChildSkip.html b/testing/web-platform/tests/dom/traversal/TreeWalker-previousSiblingLastChildSkip.html new file mode 100644 index 000000000..17da4d569 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-previousSiblingLastChildSkip.html @@ -0,0 +1,91 @@ + + + + +TreeWalker: previousSiblingLastChildSkip + + + +
      + + +

      Test that previousSibling properly respects the filter.

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-reject.html b/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-reject.html new file mode 100644 index 000000000..273b33236 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-reject.html @@ -0,0 +1,109 @@ + + + + +TreeWalker: traversal-reject + + + +
      + + +

      Test TreeWalker with rejection

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html b/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html new file mode 100644 index 000000000..567ef6655 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip-most.html @@ -0,0 +1,66 @@ + + + + +TreeWalker: traversal-skip-most + + + +
      + + +

      Test TreeWalker with skipping

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip.html b/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip.html new file mode 100644 index 000000000..0e3b81a27 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-traversal-skip.html @@ -0,0 +1,111 @@ + + + + +TreeWalker: traversal-skip + + + +
      + + +

      Test TreeWalker with skipping

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker-walking-outside-a-tree.html b/testing/web-platform/tests/dom/traversal/TreeWalker-walking-outside-a-tree.html new file mode 100644 index 000000000..ad4334512 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker-walking-outside-a-tree.html @@ -0,0 +1,40 @@ + + + + +TreeWalker: walking-outside-a-tree + + + +
      + + +

      [Acid3 - Test 006a] walking outside a tree

      + + + diff --git a/testing/web-platform/tests/dom/traversal/TreeWalker.html b/testing/web-platform/tests/dom/traversal/TreeWalker.html new file mode 100644 index 000000000..e0e285a77 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/TreeWalker.html @@ -0,0 +1,298 @@ + +TreeWalker tests + + +
      + + + + diff --git a/testing/web-platform/tests/dom/traversal/traversal-support.js b/testing/web-platform/tests/dom/traversal/traversal-support.js new file mode 100644 index 000000000..0d5d8ad74 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/traversal-support.js @@ -0,0 +1,10 @@ +// |expected| should be an object indicating the expected type of node. +function assert_node(actual, expected) +{ + assert_true(actual instanceof expected.type, + 'Node type mismatch: actual = ' + actual.nodeType + ', expected = ' + expected.nodeType); + if (typeof(expected.id) !== 'undefined') + assert_equals(actual.id, expected.id); + if (typeof(expected.nodeValue) !== 'undefined') + assert_equals(actual.nodeValue, expected.nodeValue); +} diff --git a/testing/web-platform/tests/dom/traversal/unfinished/001.xml b/testing/web-platform/tests/dom/traversal/unfinished/001.xml new file mode 100644 index 000000000..08bce72fc --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/001.xml @@ -0,0 +1,53 @@ + + + DOM Traversal: NodeIterator: Basics + + + +
      FAIL: Script failed to run.
      + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/traversal/unfinished/002.xml b/testing/web-platform/tests/dom/traversal/unfinished/002.xml new file mode 100644 index 000000000..bf3489688 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/002.xml @@ -0,0 +1,54 @@ + + + DOM Traversal: NodeIterator: Basics Backwards + + + +
      FAIL: Script failed to run.
      + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/traversal/unfinished/003.xml b/testing/web-platform/tests/dom/traversal/unfinished/003.xml new file mode 100644 index 000000000..268e6bb4d --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/003.xml @@ -0,0 +1,58 @@ + + + DOM Traversal: NodeIterator: Removal of nodes that should have no effect + + + + +
      FAIL: Script did not complete.
      +

      + + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/traversal/unfinished/004.xml b/testing/web-platform/tests/dom/traversal/unfinished/004.xml new file mode 100644 index 000000000..618978f02 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/004.xml @@ -0,0 +1,49 @@ + + + DOM Traversal: NodeIterator: Removal of the Reference Node + + + +
      FAIL: Script did not complete.
      +

      + + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/traversal/unfinished/005.xml b/testing/web-platform/tests/dom/traversal/unfinished/005.xml new file mode 100644 index 000000000..643e2f1cd --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/005.xml @@ -0,0 +1,57 @@ + + + DOM Traversal: NodeIterator: Removal of the Reference Node (deep check) + + + +
      FAIL: Script did not complete.
      +

      + + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/traversal/unfinished/006.xml b/testing/web-platform/tests/dom/traversal/unfinished/006.xml new file mode 100644 index 000000000..c2302af83 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/006.xml @@ -0,0 +1,47 @@ + + + DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (forwards) + + + +
      FAIL: Script did not complete.
      +

      + + diff --git a/testing/web-platform/tests/dom/traversal/unfinished/007.xml b/testing/web-platform/tests/dom/traversal/unfinished/007.xml new file mode 100644 index 000000000..98b212e4e --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/007.xml @@ -0,0 +1,54 @@ + + + DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (forwards) (deep check) + + + +
      FAIL: Script did not complete.
      +

      + + diff --git a/testing/web-platform/tests/dom/traversal/unfinished/008.xml b/testing/web-platform/tests/dom/traversal/unfinished/008.xml new file mode 100644 index 000000000..41d7008ae --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/008.xml @@ -0,0 +1,48 @@ + + + DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (backwards) + + + +
      FAIL: Script did not complete.
      +

      + + diff --git a/testing/web-platform/tests/dom/traversal/unfinished/009.xml b/testing/web-platform/tests/dom/traversal/unfinished/009.xml new file mode 100644 index 000000000..c3006ecbd --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/009.xml @@ -0,0 +1,55 @@ + + + DOM Traversal: NodeIterator: Removal of an ancestor of the Reference Node (backwards) (deep check) + + + +
      FAIL: Script did not complete.
      +

      + + diff --git a/testing/web-platform/tests/dom/traversal/unfinished/010.xml b/testing/web-platform/tests/dom/traversal/unfinished/010.xml new file mode 100644 index 000000000..63263a5fd --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/010.xml @@ -0,0 +1,64 @@ + + + DOM Traversal: NodeIterator: Filters + + + +
      FAIL: Script failed to run.
      + + + + + \ No newline at end of file diff --git a/testing/web-platform/tests/dom/traversal/unfinished/TODO b/testing/web-platform/tests/dom/traversal/unfinished/TODO new file mode 100644 index 000000000..cecdf98b0 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/unfinished/TODO @@ -0,0 +1 @@ +Check what happens when a NodeFilter turns a number not in the range 1..3 \ No newline at end of file -- cgit v1.2.3