diff options
236 files changed, 4815 insertions, 891 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 33e5a1e28e2..e82ec5fdbc1 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -3770,44 +3770,44 @@ "url": "/compat/webkit-text-fill-color-property-006.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html" }, { "path": "html/dom/elements/global-attributes/dir_auto-EN-L.html", @@ -11514,6 +11514,10 @@ "url": "/IndexedDB/idbcursor_update_index7.htm" }, { + "path": "IndexedDB/idbcursor_update_index8.htm", + "url": "/IndexedDB/idbcursor_update_index8.htm" + }, + { "path": "IndexedDB/idbcursor_update_objectstore.htm", "url": "/IndexedDB/idbcursor_update_objectstore.htm" }, @@ -11546,6 +11550,10 @@ "url": "/IndexedDB/idbcursor_update_objectstore8.htm" }, { + "path": "IndexedDB/idbcursor_update_objectstore9.htm", + "url": "/IndexedDB/idbcursor_update_objectstore9.htm" + }, + { "path": "IndexedDB/idbdatabase_close.htm", "url": "/IndexedDB/idbdatabase_close.htm" }, @@ -12574,6 +12582,10 @@ "url": "/XMLHttpRequest/open-url-multi-window-5.htm" }, { + "path": "XMLHttpRequest/open-url-multi-window-6.htm", + "url": "/XMLHttpRequest/open-url-multi-window-6.htm" + }, + { "path": "XMLHttpRequest/open-url-multi-window.htm", "url": "/XMLHttpRequest/open-url-multi-window.htm" }, @@ -13794,224 +13806,224 @@ "url": "/cssom-view/scrollingElement.html" }, { - "path": "custom-elements/pre-v1/concepts/custom-elements-type-naming.html", - "url": "/custom-elements/pre-v1/concepts/custom-elements-type-naming.html" + "path": "custom-elements/v0/concepts/custom-elements-type-naming.html", + "url": "/custom-elements/v0/concepts/custom-elements-type-naming.html" }, { - "path": "custom-elements/pre-v1/creating-and-passing-registries/new-registry-test.html", - "url": "/custom-elements/pre-v1/creating-and-passing-registries/new-registry-test.html" + "path": "custom-elements/v0/creating-and-passing-registries/new-registry-test.html", + "url": "/custom-elements/v0/creating-and-passing-registries/new-registry-test.html" }, { - "path": "custom-elements/pre-v1/creating-and-passing-registries/no-registry-test.html", - "url": "/custom-elements/pre-v1/creating-and-passing-registries/no-registry-test.html" + "path": "custom-elements/v0/creating-and-passing-registries/no-registry-test.html", + "url": "/custom-elements/v0/creating-and-passing-registries/no-registry-test.html" }, { - "path": "custom-elements/pre-v1/creating-and-passing-registries/share-registry-create-document.html", - "url": "/custom-elements/pre-v1/creating-and-passing-registries/share-registry-create-document.html" + "path": "custom-elements/v0/creating-and-passing-registries/share-registry-create-document.html", + "url": "/custom-elements/v0/creating-and-passing-registries/share-registry-create-document.html" }, { - "path": "custom-elements/pre-v1/creating-and-passing-registries/share-registry-import-document.html", - "url": "/custom-elements/pre-v1/creating-and-passing-registries/share-registry-import-document.html" + "path": "custom-elements/v0/creating-and-passing-registries/share-registry-import-document.html", + "url": "/custom-elements/v0/creating-and-passing-registries/share-registry-import-document.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html" + "path": "custom-elements/v0/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html", + "url": "/custom-elements/v0/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html" + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html", + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/changing-is-attribute.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/changing-is-attribute.html" + "path": "custom-elements/v0/instantiating/changing-is-attribute.html", + "url": "/custom-elements/v0/instantiating/changing-is-attribute.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-is-attribute.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-is-attribute.html" + "path": "custom-elements/v0/instantiating/custom-element-constructor-is-attribute.html", + "url": "/custom-elements/v0/instantiating/custom-element-constructor-is-attribute.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-local-name.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-local-name.html" + "path": "custom-elements/v0/instantiating/custom-element-constructor-local-name.html", + "url": "/custom-elements/v0/instantiating/custom-element-constructor-local-name.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-namespace.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-namespace.html" + "path": "custom-elements/v0/instantiating/custom-element-constructor-namespace.html", + "url": "/custom-elements/v0/instantiating/custom-element-constructor-namespace.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-node-document.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-node-document.html" + "path": "custom-elements/v0/instantiating/custom-element-constructor-node-document.html", + "url": "/custom-elements/v0/instantiating/custom-element-constructor-node-document.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-prototype.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-prototype.html" + "path": "custom-elements/v0/instantiating/custom-element-constructor-prototype.html", + "url": "/custom-elements/v0/instantiating/custom-element-constructor-prototype.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-prototype.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-prototype.html" + "path": "custom-elements/v0/instantiating/custom-element-prototype.html", + "url": "/custom-elements/v0/instantiating/custom-element-prototype.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-is-attribute.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-is-attribute.html" + "path": "custom-elements/v0/instantiating/custom-element-type-is-attribute.html", + "url": "/custom-elements/v0/instantiating/custom-element-type-is-attribute.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name-and-is-attribute.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name-and-is-attribute.html" + "path": "custom-elements/v0/instantiating/custom-element-type-local-name-and-is-attribute.html", + "url": "/custom-elements/v0/instantiating/custom-element-type-local-name-and-is-attribute.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name.html" + "path": "custom-elements/v0/instantiating/custom-element-type-local-name.html", + "url": "/custom-elements/v0/instantiating/custom-element-type-local-name.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-is-attribute.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-is-attribute.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/create-element-is-attribute.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-is-attribute.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-namespace.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-namespace.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/create-element-namespace.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-namespace.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-is-a-type.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-is-a-type.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-is-a-type.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-is-a-type.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-unresolved.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-unresolved.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-unresolved.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-unresolved.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-is-a-local-name.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-is-a-local-name.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-is-a-local-name.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-is-a-local-name.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element-ns.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element-ns.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element-ns.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element-ns.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element.html" + "path": "custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element.html", + "url": "/custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/non-configurable-constructor-property.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/non-configurable-constructor-property.html" + "path": "custom-elements/v0/instantiating/non-configurable-constructor-property.html", + "url": "/custom-elements/v0/instantiating/non-configurable-constructor-property.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/prototype-is-interface-prototype-object.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/prototype-is-interface-prototype-object.html" + "path": "custom-elements/v0/instantiating/prototype-is-interface-prototype-object.html", + "url": "/custom-elements/v0/instantiating/prototype-is-interface-prototype-object.html" }, { - "path": "custom-elements/pre-v1/instantiating-custom-elements/unchanged-attribute.html", - "url": "/custom-elements/pre-v1/instantiating-custom-elements/unchanged-attribute.html" + "path": "custom-elements/v0/instantiating/unchanged-attribute.html", + "url": "/custom-elements/v0/instantiating/unchanged-attribute.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-default-namespace.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-default-namespace.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-default-namespace.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-default-namespace.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-duplicate-definition.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-duplicate-definition.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-duplicate-definition.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-duplicate-definition.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-invalid-type.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-invalid-type.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-invalid-type.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-invalid-type.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-local-name-lowercased.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-local-name-lowercased.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-local-name-lowercased.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-local-name-lowercased.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-name-is-null.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-name-is-null.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-name-is-null.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-name-is-null.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-no-interface-for-name.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-no-interface-for-name.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-no-interface-for-name.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-no-interface-for-name.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace-name-is-null.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace-name-is-null.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-svg-namespace-name-is-null.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-svg-namespace-name-is-null.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-svg-namespace.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-svg-namespace.html" }, { - "path": "custom-elements/pre-v1/registering/definition-construction-algorithm-type-name-lowercased.html", - "url": "/custom-elements/pre-v1/registering/definition-construction-algorithm-type-name-lowercased.html" + "path": "custom-elements/v0/registering/definition-construction-algorithm-type-name-lowercased.html", + "url": "/custom-elements/v0/registering/definition-construction-algorithm-type-name-lowercased.html" }, { - "path": "custom-elements/pre-v1/registering/element-registration-algorithm-no-registry.html", - "url": "/custom-elements/pre-v1/registering/element-registration-algorithm-no-registry.html" + "path": "custom-elements/v0/registering/element-registration-algorithm-no-registry.html", + "url": "/custom-elements/v0/registering/element-registration-algorithm-no-registry.html" }, { - "path": "custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-name.html", - "url": "/custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-name.html" + "path": "custom-elements/v0/registering/extensions-to-document-interface/custom-element-name.html", + "url": "/custom-elements/v0/registering/extensions-to-document-interface/custom-element-name.html" }, { - "path": "custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-prototype.html", - "url": "/custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-prototype.html" + "path": "custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html", + "url": "/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html", - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html" + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html", + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html", - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html" + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html", + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-elements-interface-html-element.html", - "url": "/custom-elements/pre-v1/registering/unresolved-elements-interface-html-element.html" + "path": "custom-elements/v0/registering/unresolved-elements-interface-html-element.html", + "url": "/custom-elements/v0/registering/unresolved-elements-interface-html-element.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-elements-interface-html-unknown-element.html", - "url": "/custom-elements/pre-v1/registering/unresolved-elements-interface-html-unknown-element.html" + "path": "custom-elements/v0/registering/unresolved-elements-interface-html-unknown-element.html", + "url": "/custom-elements/v0/registering/unresolved-elements-interface-html-unknown-element.html" }, { - "path": "custom-elements/pre-v1/registering/unresolved-elements-interface-svg-element.html", - "url": "/custom-elements/pre-v1/registering/unresolved-elements-interface-svg-element.html" + "path": "custom-elements/v0/registering/unresolved-elements-interface-svg-element.html", + "url": "/custom-elements/v0/registering/unresolved-elements-interface-svg-element.html" }, { "path": "dom/collections/HTMLCollection-as-proto-length-get-throws.html", @@ -14938,10 +14950,58 @@ "url": "/domparsing/XMLSerializer-serializeToString.html" }, { + "path": "domparsing/createContextualFragment.html", + "url": "/domparsing/createContextualFragment.html" + }, + { + "path": "domparsing/innerhtml-01.xhtml", + "url": "/domparsing/innerhtml-01.xhtml" + }, + { + "path": "domparsing/innerhtml-03.xhtml", + "url": "/domparsing/innerhtml-03.xhtml" + }, + { + "path": "domparsing/innerhtml-04.html", + "url": "/domparsing/innerhtml-04.html" + }, + { + "path": "domparsing/innerhtml-05.xhtml", + "url": "/domparsing/innerhtml-05.xhtml" + }, + { + "path": "domparsing/innerhtml-06.html", + "url": "/domparsing/innerhtml-06.html" + }, + { + "path": "domparsing/innerhtml-07.html", + "url": "/domparsing/innerhtml-07.html" + }, + { "path": "domparsing/insert-adjacent.html", "url": "/domparsing/insert-adjacent.html" }, { + "path": "domparsing/insert_adjacent_html.html", + "url": "/domparsing/insert_adjacent_html.html" + }, + { + "path": "domparsing/insert_adjacent_html.xhtml", + "url": "/domparsing/insert_adjacent_html.xhtml" + }, + { + "path": "domparsing/outerhtml-01.html", + "url": "/domparsing/outerhtml-01.html" + }, + { + "path": "domparsing/outerhtml-02.html", + "url": "/domparsing/outerhtml-02.html" + }, + { + "path": "domparsing/xml-serialization.xhtml", + "url": "/domparsing/xml-serialization.xhtml" + }, + { "path": "domxpath/001.html", "url": "/domxpath/001.html" }, @@ -16342,6 +16402,10 @@ "url": "/html/browsers/history/the-history-interface/traverse_the_history_write_onload_2.html" }, { + "path": "html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html", + "url": "/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html" + }, + { "path": "html/browsers/history/the-location-interface/assign_after_load.html", "url": "/html/browsers/history/the-location-interface/assign_after_load.html" }, @@ -17502,10 +17566,18 @@ "url": "/html/semantics/document-metadata/styling/LinkStyle.html" }, { + "path": "html/semantics/document-metadata/the-base-element/base_about_blank.html", + "url": "/html/semantics/document-metadata/the-base-element/base_about_blank.html" + }, + { "path": "html/semantics/document-metadata/the-base-element/base_href_empty.html", "url": "/html/semantics/document-metadata/the-base-element/base_href_empty.html" }, { + "path": "html/semantics/document-metadata/the-base-element/base_href_invalid.html", + "url": "/html/semantics/document-metadata/the-base-element/base_href_invalid.html" + }, + { "path": "html/semantics/document-metadata/the-base-element/base_href_specified.sub.html", "url": "/html/semantics/document-metadata/the-base-element/base_href_specified.sub.html" }, @@ -17518,6 +17590,10 @@ "url": "/html/semantics/document-metadata/the-base-element/base_multiple.html" }, { + "path": "html/semantics/document-metadata/the-base-element/base_srcdoc.html", + "url": "/html/semantics/document-metadata/the-base-element/base_srcdoc.html" + }, + { "path": "html/semantics/document-metadata/the-link-element/link-load-event.html", "url": "/html/semantics/document-metadata/the-link-element/link-load-event.html" }, @@ -18778,6 +18854,10 @@ "url": "/html/semantics/embedded-content/the-embed-element/embed-ignored-in-media-element.html" }, { + "path": "html/semantics/embedded-content/the-iframe-element/iframe-load-event.html", + "url": "/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html" + }, + { "path": "html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm", "url": "/html/semantics/embedded-content/the-iframe-element/iframe_javascript_url_01.htm" }, @@ -19866,6 +19946,10 @@ "url": "/html/syntax/serializing-html-fragments/outerHTML.html" }, { + "path": "html/syntax/serializing-html-fragments/serializing.html", + "url": "/html/syntax/serializing-html-fragments/serializing.html" + }, + { "path": "html/syntax/serializing-xml-fragments/outerHTML.html", "url": "/html/syntax/serializing-xml-fragments/outerHTML.html" }, @@ -27882,6 +27966,14 @@ "url": "/screen-orientation/orientation-reading.html" }, { + "path": "secure-contexts/basic-popup-and-iframe-tests.html", + "url": "/secure-contexts/basic-popup-and-iframe-tests.html" + }, + { + "path": "secure-contexts/basic-popup-and-iframe-tests.https.html", + "url": "/secure-contexts/basic-popup-and-iframe-tests.https.html" + }, + { "path": "selection/Document-open.html", "url": "/selection/Document-open.html" }, @@ -28122,6 +28214,10 @@ "url": "/service-workers/service-worker/multiple-update.https.html" }, { + "path": "service-workers/service-worker/navigate-window.https.html", + "url": "/service-workers/service-worker/navigate-window.https.html" + }, + { "path": "service-workers/service-worker/navigation-redirect.https.html", "url": "/service-workers/service-worker/navigation-redirect.https.html" }, @@ -28278,6 +28374,10 @@ "url": "/service-workers/service-worker/update-after-oneday.https.html" }, { + "path": "service-workers/service-worker/update-recovery.https.html", + "url": "/service-workers/service-worker/update-recovery.https.html" + }, + { "path": "service-workers/service-worker/update.https.html", "url": "/service-workers/service-worker/update.https.html" }, @@ -29006,20 +29106,20 @@ "url": "/web-animations/animation/reverse.html" }, { - "path": "web-animations/keyframe-effect/constructor.html", - "url": "/web-animations/keyframe-effect/constructor.html" + "path": "web-animations/animation/startTime.html", + "url": "/web-animations/animation/startTime.html" }, { - "path": "web-animations/keyframe-effect/effect-easing.html", - "url": "/web-animations/keyframe-effect/effect-easing.html" + "path": "web-animations/document/getAnimations.html", + "url": "/web-animations/document/getAnimations.html" }, { - "path": "web-animations/keyframe-effect/getComputedTiming-currentIteration.html", - "url": "/web-animations/keyframe-effect/getComputedTiming-currentIteration.html" + "path": "web-animations/keyframe-effect/constructor.html", + "url": "/web-animations/keyframe-effect/constructor.html" }, { - "path": "web-animations/keyframe-effect/getComputedTiming-progress.html", - "url": "/web-animations/keyframe-effect/getComputedTiming-progress.html" + "path": "web-animations/keyframe-effect/effect-easing.html", + "url": "/web-animations/keyframe-effect/effect-easing.html" }, { "path": "web-animations/keyframe-effect/getComputedTiming.html", @@ -29030,6 +29130,30 @@ "url": "/web-animations/keyframe-effect/keyframe-handling.html" }, { + "path": "web-animations/keyframe-effect/setFrames.html", + "url": "/web-animations/keyframe-effect/setFrames.html" + }, + { + "path": "web-animations/keyframe-effect/setTarget.html", + "url": "/web-animations/keyframe-effect/setTarget.html" + }, + { + "path": "web-animations/timing-model/animation-effects/active-time.html", + "url": "/web-animations/timing-model/animation-effects/active-time.html" + }, + { + "path": "web-animations/timing-model/animation-effects/current-iteration.html", + "url": "/web-animations/timing-model/animation-effects/current-iteration.html" + }, + { + "path": "web-animations/timing-model/animation-effects/simple-iteration-progress.html", + "url": "/web-animations/timing-model/animation-effects/simple-iteration-progress.html" + }, + { + "path": "web-animations/timing-model/animations/set-the-animation-start-time.html", + "url": "/web-animations/timing-model/animations/set-the-animation-start-time.html" + }, + { "path": "webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html", "url": "/webaudio/the-audio-api/the-audiobuffer-interface/idl-test.html" }, @@ -34362,19 +34486,19 @@ "url": "/cors/status-async.htm" }, { - "path": "custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars-first-char.html", + "path": "custom-elements/v0/concepts/custom-elements-type-allowed-chars-first-char.html", "timeout": "long", - "url": "/custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars-first-char.html" + "url": "/custom-elements/v0/concepts/custom-elements-type-allowed-chars-first-char.html" }, { - "path": "custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars.html", + "path": "custom-elements/v0/concepts/custom-elements-type-allowed-chars.html", "timeout": "long", - "url": "/custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars.html" + "url": "/custom-elements/v0/concepts/custom-elements-type-allowed-chars.html" }, { - "path": "custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html", + "path": "custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html", "timeout": "long", - "url": "/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html" + "url": "/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html" }, { "path": "dom/nodes/Document-characterSet-normalization.html", @@ -36368,52 +36492,52 @@ "url": "/compat/webkit-text-fill-color-property-006.html" } ], - "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html": [ + "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html": [ { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html" } ], - "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html": [ + "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html": [ { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html" } ], - "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html": [ + "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html": [ { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html" } ], - "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html": [ + "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html": [ { - "path": "custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html", + "path": "custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html", "references": [ [ - "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html", + "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html", "==" ] ], - "url": "/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html" + "url": "/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html" } ], "html/dom/elements/global-attributes/dir_auto-EN-L-ref.html": [ @@ -42141,7 +42265,7 @@ } ] }, - "rev": "fab2c513bffb2bd19600d23b495264d123df092f", + "rev": "697b971060b2d475a73c1c3755232a4674d61cf5", "url_base": "/", "version": 3 } diff --git a/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-6.htm.ini b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-6.htm.ini new file mode 100644 index 00000000000..2f530615db1 --- /dev/null +++ b/tests/wpt/metadata/XMLHttpRequest/open-url-multi-window-6.htm.ini @@ -0,0 +1,6 @@ +[open-url-multi-window-6.htm] + type: testharness + expected: TIMEOUT + [XMLHttpRequest: open() in document that is not fully active (but may be active) should throw] + expected: NOTRUN + diff --git a/tests/wpt/metadata/domparsing/createContextualFragment.html.ini b/tests/wpt/metadata/domparsing/createContextualFragment.html.ini new file mode 100644 index 00000000000..3425974106c --- /dev/null +++ b/tests/wpt/metadata/domparsing/createContextualFragment.html.ini @@ -0,0 +1,35 @@ +[createContextualFragment.html] + type: testharness + [Must not throw INVALID_STATE_ERR for a detached node.] + expected: FAIL + + [Simple test with paragraphs] + expected: FAIL + + [Don't auto-create <body> when applied to <html>] + expected: FAIL + + [<script>s should be run when appended to the document (but not before)] + expected: FAIL + + [<html> and <body> must work the same, 1] + expected: FAIL + + [<html> and <body> must work the same, 2] + expected: FAIL + + [Implicit <body> creation] + expected: FAIL + + [Namespace generally shouldn't matter] + expected: FAIL + + [<html> in a different namespace shouldn't be special] + expected: FAIL + + [null should be stringified] + expected: FAIL + + [undefined should be stringified] + expected: FAIL + diff --git a/tests/wpt/metadata/domparsing/innerhtml-01.xhtml.ini b/tests/wpt/metadata/domparsing/innerhtml-01.xhtml.ini new file mode 100644 index 00000000000..ea248239d89 --- /dev/null +++ b/tests/wpt/metadata/domparsing/innerhtml-01.xhtml.ini @@ -0,0 +1,8 @@ +[innerhtml-01.xhtml] + type: testharness + [innerHTML in XHTML: getting while the document is in an invalid state] + expected: FAIL + + [innerHTML in XHTML: getting while the document is in an invalid state 1] + expected: FAIL + diff --git a/tests/wpt/metadata/domparsing/innerhtml-03.xhtml.ini b/tests/wpt/metadata/domparsing/innerhtml-03.xhtml.ini new file mode 100644 index 00000000000..970eccfa590 --- /dev/null +++ b/tests/wpt/metadata/domparsing/innerhtml-03.xhtml.ini @@ -0,0 +1,17 @@ +[innerhtml-03.xhtml] + type: testharness + [innerHTML in XHTML] + expected: FAIL + + [innerHTML in XHTML 1] + expected: FAIL + + [innerHTML in XHTML 3] + expected: FAIL + + [innerHTML in XHTML 4] + expected: FAIL + + [innerHTML in XHTML 7] + expected: FAIL + diff --git a/tests/wpt/metadata/domparsing/innerhtml-05.xhtml.ini b/tests/wpt/metadata/domparsing/innerhtml-05.xhtml.ini new file mode 100644 index 00000000000..166b8e0aaab --- /dev/null +++ b/tests/wpt/metadata/domparsing/innerhtml-05.xhtml.ini @@ -0,0 +1,5 @@ +[innerhtml-05.xhtml] + type: testharness + [innerHTML in XHTML] + expected: FAIL + diff --git a/tests/wpt/metadata/domparsing/insert_adjacent_html.html.ini b/tests/wpt/metadata/domparsing/insert_adjacent_html.html.ini new file mode 100644 index 00000000000..a1028c07ebe --- /dev/null +++ b/tests/wpt/metadata/domparsing/insert_adjacent_html.html.ini @@ -0,0 +1,89 @@ +[insert_adjacent_html.html] + type: testharness + [beforeBegin content without next sibling] + expected: FAIL + + [Afterbegin content without next sibling] + expected: FAIL + + [BeforeEnd content without next sibling] + expected: FAIL + + [afterend content without next sibling] + expected: FAIL + + [beforeBegin content again, with next sibling] + expected: FAIL + + [Afterbegin content again, with next sibling] + expected: FAIL + + [BeforeEnd content again, with next sibling] + expected: FAIL + + [afterend content again, with next sibling] + expected: FAIL + + [Should throw when inserting with invalid position string] + expected: FAIL + + [When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (text)] + expected: FAIL + + [When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (comments)] + expected: FAIL + + [When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (elements)] + expected: FAIL + + [When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (text)] + expected: FAIL + + [When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (comments)] + expected: FAIL + + [When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (elements)] + expected: FAIL + + [Inserting after being and before end should order things correctly] + expected: FAIL + + [beforeBegin child node not in tree but has parent] + expected: FAIL + + [Afterbegin child node not in tree but has parent] + expected: FAIL + + [BeforeEnd child node not in tree but has parent] + expected: FAIL + + [afterend child node not in tree but has parent] + expected: FAIL + + [beforeBegin content2 without next sibling] + expected: FAIL + + [Afterbegin content2 without next sibling] + expected: FAIL + + [BeforeEnd content2 without next sibling] + expected: FAIL + + [afterend content2 without next sibling] + expected: FAIL + + [beforeBegin content2 test again, now that there's a next sibling] + expected: FAIL + + [Afterbegin content2 test again, now that there's a next sibling] + expected: FAIL + + [BeforeEnd content2 test again, now that there's a next sibling] + expected: FAIL + + [afterend content2 test again, now that there's a next sibling] + expected: FAIL + + [Inserting kids of the <html> element should not do weird things with implied <body>/<head> tags] + expected: FAIL + diff --git a/tests/wpt/metadata/domparsing/insert_adjacent_html.xhtml.ini b/tests/wpt/metadata/domparsing/insert_adjacent_html.xhtml.ini new file mode 100644 index 00000000000..5ceb4830cb7 --- /dev/null +++ b/tests/wpt/metadata/domparsing/insert_adjacent_html.xhtml.ini @@ -0,0 +1,89 @@ +[insert_adjacent_html.xhtml] + type: testharness + [beforeBegin content without next sibling] + expected: FAIL + + [Afterbegin content without next sibling] + expected: FAIL + + [BeforeEnd content without next sibling] + expected: FAIL + + [afterend content without next sibling] + expected: FAIL + + [beforeBegin content again, with next sibling] + expected: FAIL + + [Afterbegin content again, with next sibling] + expected: FAIL + + [BeforeEnd content again, with next sibling] + expected: FAIL + + [afterend content again, with next sibling] + expected: FAIL + + [Should throw when inserting with invalid position string] + expected: FAIL + + [When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (text)] + expected: FAIL + + [When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (comments)] + expected: FAIL + + [When the parent node is null, insertAdjacentHTML should throw for beforebegin and afterend (elements)] + expected: FAIL + + [When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (text)] + expected: FAIL + + [When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (comments)] + expected: FAIL + + [When the parent node is a document, insertAdjacentHTML should throw for beforebegin and afterend (elements)] + expected: FAIL + + [Inserting after being and before end should order things correctly] + expected: FAIL + + [beforeBegin child node not in tree but has parent] + expected: FAIL + + [Afterbegin child node not in tree but has parent] + expected: FAIL + + [BeforeEnd child node not in tree but has parent] + expected: FAIL + + [afterend child node not in tree but has parent] + expected: FAIL + + [beforeBegin content2 without next sibling] + expected: FAIL + + [Afterbegin content2 without next sibling] + expected: FAIL + + [BeforeEnd content2 without next sibling] + expected: FAIL + + [afterend content2 without next sibling] + expected: FAIL + + [beforeBegin content2 test again, now that there's a next sibling] + expected: FAIL + + [Afterbegin content2 test again, now that there's a next sibling] + expected: FAIL + + [BeforeEnd content2 test again, now that there's a next sibling] + expected: FAIL + + [afterend content2 test again, now that there's a next sibling] + expected: FAIL + + [insertAdjacentHTML in HTML] + expected: FAIL + diff --git a/tests/wpt/metadata/domparsing/xml-serialization.xhtml.ini b/tests/wpt/metadata/domparsing/xml-serialization.xhtml.ini new file mode 100644 index 00000000000..e35d218f819 --- /dev/null +++ b/tests/wpt/metadata/domparsing/xml-serialization.xhtml.ini @@ -0,0 +1,47 @@ +[xml-serialization.xhtml] + type: testharness + [Comment: containing --] + expected: FAIL + + [Comment: starting with -] + expected: FAIL + + [Comment: ending with -] + expected: FAIL + + [Comment: containing -->] + expected: FAIL + + [DocumentType: empty public and system id] + expected: FAIL + + [DocumentType: empty system id] + expected: FAIL + + [DocumentType: empty public id] + expected: FAIL + + [DocumentType: non-empty public and system id] + expected: FAIL + + [DocumentType: 'APOSTROPHE' (U+0027)] + expected: FAIL + + [DocumentType: 'QUOTATION MARK' (U+0022)] + expected: FAIL + + [DocumentType: 'APOSTROPHE' (U+0027) and 'QUOTATION MARK' (U+0022)] + expected: FAIL + + [ProcessingInstruction: empty data] + expected: FAIL + + [ProcessingInstruction: non-empty data] + expected: FAIL + + [ProcessingInstruction: target contains xml] + expected: FAIL + + [ProcessingInstruction: target contains a 'COLON' (U+003A)] + expected: FAIL + diff --git a/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini b/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini index fa072d925b3..ff811c0abff 100644 --- a/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini +++ b/tests/wpt/metadata/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html.ini @@ -6,3 +6,6 @@ [Dispatching a synthetic PopStateEvent] expected: FAIL + [document.createEvent] + expected: FAIL + diff --git a/tests/wpt/metadata/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html.ini b/tests/wpt/metadata/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html.ini new file mode 100644 index 00000000000..a7900cfcffb --- /dev/null +++ b/tests/wpt/metadata/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html.ini @@ -0,0 +1,9 @@ +[allow_prototype_cycle_through_location.sub.html] + type: testharness + expected: TIMEOUT + [same-origin, same-window location cycle] + expected: FAIL + + [cross-origin location has null prototype] + expected: NOTRUN + diff --git a/tests/wpt/metadata/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html.ini b/tests/wpt/metadata/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html.ini index 717058ccd27..60423ede964 100644 --- a/tests/wpt/metadata/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html.ini +++ b/tests/wpt/metadata/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html.ini @@ -3,3 +3,9 @@ [document: fg/bg/link/vlink/alink-color] expected: FAIL + [getting document color attributes with no body] + expected: FAIL + + [setting document color attributes with no body] + expected: FAIL + diff --git a/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_about_blank.html.ini b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_about_blank.html.ini new file mode 100644 index 00000000000..9cd58e4592f --- /dev/null +++ b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_about_blank.html.ini @@ -0,0 +1,5 @@ +[base_about_blank.html] + type: testharness + [base element in about:blank document should resolve against its fallback base URI] + expected: FAIL + diff --git a/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_href_invalid.html.ini b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_href_invalid.html.ini new file mode 100644 index 00000000000..1324d90c64b --- /dev/null +++ b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_href_invalid.html.ini @@ -0,0 +1,5 @@ +[base_href_invalid.html] + type: testharness + [base element with unparseable href should have .href getter return attr value] + expected: FAIL + diff --git a/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_srcdoc.html.ini b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_srcdoc.html.ini new file mode 100644 index 00000000000..50454124488 --- /dev/null +++ b/tests/wpt/metadata/html/semantics/document-metadata/the-base-element/base_srcdoc.html.ini @@ -0,0 +1,5 @@ +[base_srcdoc.html] + type: testharness + [base element in srcdoc document should resolve against its fallback base URI] + expected: FAIL + diff --git a/tests/wpt/metadata/html/semantics/document-metadata/the-link-element/link-rellist.html.ini b/tests/wpt/metadata/html/semantics/document-metadata/the-link-element/link-rellist.html.ini new file mode 100644 index 00000000000..677f02231de --- /dev/null +++ b/tests/wpt/metadata/html/semantics/document-metadata/the-link-element/link-rellist.html.ini @@ -0,0 +1,5 @@ +[link-rellist.html] + type: testharness + [link.relList: non-string contains] + expected: FAIL + diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html.ini new file mode 100644 index 00000000000..d3ae34278df --- /dev/null +++ b/tests/wpt/metadata/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html.ini @@ -0,0 +1,8 @@ +[iframe-load-event.html] + type: testharness + [load event of blob URL] + expected: FAIL + + [load event of initial about:blank] + expected: FAIL + diff --git a/tests/wpt/metadata/html/semantics/forms/the-input-element/checkbox.html.ini b/tests/wpt/metadata/html/semantics/forms/the-input-element/checkbox.html.ini index 8c1a6388ba5..afdd08c6014 100644 --- a/tests/wpt/metadata/html/semantics/forms/the-input-element/checkbox.html.ini +++ b/tests/wpt/metadata/html/semantics/forms/the-input-element/checkbox.html.ini @@ -6,6 +6,3 @@ [canceled activation steps on unchecked checkbox (indeterminate=true in onclick)] expected: FAIL - [click on mutable checkbox fires a click event, then an input event, then a change event] - expected: FAIL - diff --git a/tests/wpt/metadata/html/syntax/serializing-html-fragments/serializing.html.ini b/tests/wpt/metadata/html/syntax/serializing-html-fragments/serializing.html.ini new file mode 100644 index 00000000000..9923051c748 --- /dev/null +++ b/tests/wpt/metadata/html/syntax/serializing-html-fragments/serializing.html.ini @@ -0,0 +1,518 @@ +[serializing.html] + type: testharness + [innerHTML Attribute in non-standard namespace] + expected: FAIL + + [outerHTML Attribute in non-standard namespace] + expected: FAIL + + [innerHTML <pre> non-context starting with U+000A] + expected: FAIL + + [innerHTML <textarea> non-context starting with U+000A] + expected: FAIL + + [innerHTML <listing> non-context starting with U+000A] + expected: FAIL + + [innerHTML <pre> non-context not starting with U+000A] + expected: FAIL + + [innerHTML <textarea> non-context not starting with U+000A] + expected: FAIL + + [innerHTML <listing> non-context not starting with U+000A] + expected: FAIL + + [outerHTML <pre> context starting with U+000A] + expected: FAIL + + [outerHTML <textarea> context starting with U+000A] + expected: FAIL + + [outerHTML <listing> context starting with U+000A] + expected: FAIL + + [outerHTML <pre> context not starting with U+000A] + expected: FAIL + + [outerHTML <textarea> context not starting with U+000A] + expected: FAIL + + [outerHTML <listing> context not starting with U+000A] + expected: FAIL + + [outerHTML <pre> non-context starting with U+000A] + expected: FAIL + + [outerHTML <textarea> non-context starting with U+000A] + expected: FAIL + + [outerHTML <listing> non-context starting with U+000A] + expected: FAIL + + [outerHTML <pre> non-context not starting with U+000A] + expected: FAIL + + [outerHTML <textarea> non-context not starting with U+000A] + expected: FAIL + + [outerHTML <listing> non-context not starting with U+000A] + expected: FAIL + + [innerHTML Void context node area] + expected: FAIL + + [innerHTML Void context node base] + expected: FAIL + + [innerHTML Void context node basefont] + expected: FAIL + + [innerHTML Void context node bgsound] + expected: FAIL + + [innerHTML Void context node br] + expected: FAIL + + [innerHTML Void context node col] + expected: FAIL + + [innerHTML Void context node embed] + expected: FAIL + + [innerHTML Void context node frame] + expected: FAIL + + [innerHTML Void context node hr] + expected: FAIL + + [innerHTML Void context node img] + expected: FAIL + + [innerHTML Void context node input] + expected: FAIL + + [innerHTML Void context node keygen] + expected: FAIL + + [innerHTML Void context node link] + expected: FAIL + + [innerHTML Void context node menuitem] + expected: FAIL + + [innerHTML Void context node meta] + expected: FAIL + + [innerHTML Void context node param] + expected: FAIL + + [innerHTML Void context node source] + expected: FAIL + + [innerHTML Void context node track] + expected: FAIL + + [innerHTML Void context node wbr] + expected: FAIL + + [innerHTML void as first child with following siblings area] + expected: FAIL + + [innerHTML void as first child with following siblings base] + expected: FAIL + + [innerHTML void as first child with following siblings basefont] + expected: FAIL + + [innerHTML void as first child with following siblings bgsound] + expected: FAIL + + [innerHTML void as first child with following siblings br] + expected: FAIL + + [innerHTML void as first child with following siblings col] + expected: FAIL + + [innerHTML void as first child with following siblings embed] + expected: FAIL + + [innerHTML void as first child with following siblings frame] + expected: FAIL + + [innerHTML void as first child with following siblings hr] + expected: FAIL + + [innerHTML void as first child with following siblings img] + expected: FAIL + + [innerHTML void as first child with following siblings input] + expected: FAIL + + [innerHTML void as first child with following siblings keygen] + expected: FAIL + + [innerHTML void as first child with following siblings link] + expected: FAIL + + [innerHTML void as first child with following siblings menuitem] + expected: FAIL + + [innerHTML void as first child with following siblings meta] + expected: FAIL + + [innerHTML void as first child with following siblings param] + expected: FAIL + + [innerHTML void as first child with following siblings source] + expected: FAIL + + [innerHTML void as first child with following siblings track] + expected: FAIL + + [innerHTML void as first child with following siblings wbr] + expected: FAIL + + [innerHTML void as second child with following siblings area] + expected: FAIL + + [innerHTML void as second child with following siblings base] + expected: FAIL + + [innerHTML void as second child with following siblings basefont] + expected: FAIL + + [innerHTML void as second child with following siblings bgsound] + expected: FAIL + + [innerHTML void as second child with following siblings br] + expected: FAIL + + [innerHTML void as second child with following siblings col] + expected: FAIL + + [innerHTML void as second child with following siblings embed] + expected: FAIL + + [innerHTML void as second child with following siblings frame] + expected: FAIL + + [innerHTML void as second child with following siblings hr] + expected: FAIL + + [innerHTML void as second child with following siblings img] + expected: FAIL + + [innerHTML void as second child with following siblings input] + expected: FAIL + + [innerHTML void as second child with following siblings keygen] + expected: FAIL + + [innerHTML void as second child with following siblings link] + expected: FAIL + + [innerHTML void as second child with following siblings menuitem] + expected: FAIL + + [innerHTML void as second child with following siblings meta] + expected: FAIL + + [innerHTML void as second child with following siblings param] + expected: FAIL + + [innerHTML void as second child with following siblings source] + expected: FAIL + + [innerHTML void as second child with following siblings track] + expected: FAIL + + [innerHTML void as second child with following siblings wbr] + expected: FAIL + + [innerHTML void as last child with preceding siblings area] + expected: FAIL + + [innerHTML void as last child with preceding siblings base] + expected: FAIL + + [innerHTML void as last child with preceding siblings basefont] + expected: FAIL + + [innerHTML void as last child with preceding siblings bgsound] + expected: FAIL + + [innerHTML void as last child with preceding siblings br] + expected: FAIL + + [innerHTML void as last child with preceding siblings col] + expected: FAIL + + [innerHTML void as last child with preceding siblings embed] + expected: FAIL + + [innerHTML void as last child with preceding siblings frame] + expected: FAIL + + [innerHTML void as last child with preceding siblings hr] + expected: FAIL + + [innerHTML void as last child with preceding siblings img] + expected: FAIL + + [innerHTML void as last child with preceding siblings input] + expected: FAIL + + [innerHTML void as last child with preceding siblings keygen] + expected: FAIL + + [innerHTML void as last child with preceding siblings link] + expected: FAIL + + [innerHTML void as last child with preceding siblings menuitem] + expected: FAIL + + [innerHTML void as last child with preceding siblings meta] + expected: FAIL + + [innerHTML void as last child with preceding siblings param] + expected: FAIL + + [innerHTML void as last child with preceding siblings source] + expected: FAIL + + [innerHTML void as last child with preceding siblings track] + expected: FAIL + + [innerHTML void as last child with preceding siblings wbr] + expected: FAIL + + [outerHTML Void context node area] + expected: FAIL + + [outerHTML Void context node base] + expected: FAIL + + [outerHTML Void context node basefont] + expected: FAIL + + [outerHTML Void context node bgsound] + expected: FAIL + + [outerHTML Void context node br] + expected: FAIL + + [outerHTML Void context node col] + expected: FAIL + + [outerHTML Void context node embed] + expected: FAIL + + [outerHTML Void context node frame] + expected: FAIL + + [outerHTML Void context node hr] + expected: FAIL + + [outerHTML Void context node img] + expected: FAIL + + [outerHTML Void context node input] + expected: FAIL + + [outerHTML Void context node keygen] + expected: FAIL + + [outerHTML Void context node link] + expected: FAIL + + [outerHTML Void context node menuitem] + expected: FAIL + + [outerHTML Void context node meta] + expected: FAIL + + [outerHTML Void context node param] + expected: FAIL + + [outerHTML Void context node source] + expected: FAIL + + [outerHTML Void context node track] + expected: FAIL + + [outerHTML Void context node wbr] + expected: FAIL + + [outerHTML void as first child with following siblings area] + expected: FAIL + + [outerHTML void as first child with following siblings base] + expected: FAIL + + [outerHTML void as first child with following siblings basefont] + expected: FAIL + + [outerHTML void as first child with following siblings bgsound] + expected: FAIL + + [outerHTML void as first child with following siblings br] + expected: FAIL + + [outerHTML void as first child with following siblings col] + expected: FAIL + + [outerHTML void as first child with following siblings embed] + expected: FAIL + + [outerHTML void as first child with following siblings frame] + expected: FAIL + + [outerHTML void as first child with following siblings hr] + expected: FAIL + + [outerHTML void as first child with following siblings img] + expected: FAIL + + [outerHTML void as first child with following siblings input] + expected: FAIL + + [outerHTML void as first child with following siblings keygen] + expected: FAIL + + [outerHTML void as first child with following siblings link] + expected: FAIL + + [outerHTML void as first child with following siblings menuitem] + expected: FAIL + + [outerHTML void as first child with following siblings meta] + expected: FAIL + + [outerHTML void as first child with following siblings param] + expected: FAIL + + [outerHTML void as first child with following siblings source] + expected: FAIL + + [outerHTML void as first child with following siblings track] + expected: FAIL + + [outerHTML void as first child with following siblings wbr] + expected: FAIL + + [outerHTML void as second child with following siblings area] + expected: FAIL + + [outerHTML void as second child with following siblings base] + expected: FAIL + + [outerHTML void as second child with following siblings basefont] + expected: FAIL + + [outerHTML void as second child with following siblings bgsound] + expected: FAIL + + [outerHTML void as second child with following siblings br] + expected: FAIL + + [outerHTML void as second child with following siblings col] + expected: FAIL + + [outerHTML void as second child with following siblings embed] + expected: FAIL + + [outerHTML void as second child with following siblings frame] + expected: FAIL + + [outerHTML void as second child with following siblings hr] + expected: FAIL + + [outerHTML void as second child with following siblings img] + expected: FAIL + + [outerHTML void as second child with following siblings input] + expected: FAIL + + [outerHTML void as second child with following siblings keygen] + expected: FAIL + + [outerHTML void as second child with following siblings link] + expected: FAIL + + [outerHTML void as second child with following siblings menuitem] + expected: FAIL + + [outerHTML void as second child with following siblings meta] + expected: FAIL + + [outerHTML void as second child with following siblings param] + expected: FAIL + + [outerHTML void as second child with following siblings source] + expected: FAIL + + [outerHTML void as second child with following siblings track] + expected: FAIL + + [outerHTML void as second child with following siblings wbr] + expected: FAIL + + [outerHTML void as last child with preceding siblings area] + expected: FAIL + + [outerHTML void as last child with preceding siblings base] + expected: FAIL + + [outerHTML void as last child with preceding siblings basefont] + expected: FAIL + + [outerHTML void as last child with preceding siblings bgsound] + expected: FAIL + + [outerHTML void as last child with preceding siblings br] + expected: FAIL + + [outerHTML void as last child with preceding siblings col] + expected: FAIL + + [outerHTML void as last child with preceding siblings embed] + expected: FAIL + + [outerHTML void as last child with preceding siblings frame] + expected: FAIL + + [outerHTML void as last child with preceding siblings hr] + expected: FAIL + + [outerHTML void as last child with preceding siblings img] + expected: FAIL + + [outerHTML void as last child with preceding siblings input] + expected: FAIL + + [outerHTML void as last child with preceding siblings keygen] + expected: FAIL + + [outerHTML void as last child with preceding siblings link] + expected: FAIL + + [outerHTML void as last child with preceding siblings menuitem] + expected: FAIL + + [outerHTML void as last child with preceding siblings meta] + expected: FAIL + + [outerHTML void as last child with preceding siblings param] + expected: FAIL + + [outerHTML void as last child with preceding siblings source] + expected: FAIL + + [outerHTML void as last child with preceding siblings track] + expected: FAIL + + [outerHTML void as last child with preceding siblings wbr] + expected: FAIL + diff --git a/tests/wpt/metadata/mozilla-sync b/tests/wpt/metadata/mozilla-sync index 97842ad5fe4..defa831cbdb 100644 --- a/tests/wpt/metadata/mozilla-sync +++ b/tests/wpt/metadata/mozilla-sync @@ -1 +1 @@ -0558687d71295023b27860436e7a5aa5da7f49d0
\ No newline at end of file +f60598909a8ffd69fe1d87ee92aa94f1a26ef12e
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/IndexedDB/idbcursor_update_index8.htm b/tests/wpt/web-platform-tests/IndexedDB/idbcursor_update_index8.htm new file mode 100644 index 00000000000..3b9266dbeda --- /dev/null +++ b/tests/wpt/web-platform-tests/IndexedDB/idbcursor_update_index8.htm @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<title>IDBCursor.update() - index - throw InvalidStateError when the cursor is being iterated</title> +<link rel="author" title="Mozilla" href="https://www.mozilla.org"> +<link rel="help" href="https://www.w3.org/TR/IndexedDB/#widl-IDBCursor-update-IDBRequest-any-value"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support.js"></script> +<div id="log"></div> +<script> + var db, + t = async_test(), + records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" }, + { pKey: "primaryKey_1", iKey: "indexKey_1" } ]; + + var open_rq = createdb(t); + open_rq.onupgradeneeded = function(e) { + db = e.target.result; + + var objStore = db.createObjectStore("store", { keyPath: "pKey" }); + objStore.createIndex("index", "iKey"); + + for (var i = 0; i < records.length; i++) + objStore.add(records[i]); + }; + + open_rq.onsuccess = function(e) { + var cursor_rq = db.transaction("store", "readwrite") + .objectStore("store") + .index("index") + .openCursor(); + + cursor_rq.onsuccess = t.step_func(function(e) { + var cursor = e.target.result; + assert_true(cursor instanceof IDBCursor, "cursor exists"); + + cursor.continue(); + assert_throws("InvalidStateError", function() { + cursor.update({ pKey: "primaryKey_0", iKey: "indexKey_0_updated" }); + }); + + t.done(); + }); + } +</script> + diff --git a/tests/wpt/web-platform-tests/IndexedDB/idbcursor_update_objectstore9.htm b/tests/wpt/web-platform-tests/IndexedDB/idbcursor_update_objectstore9.htm new file mode 100644 index 00000000000..34aa78e6be8 --- /dev/null +++ b/tests/wpt/web-platform-tests/IndexedDB/idbcursor_update_objectstore9.htm @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>IDBCursor.update() - object store - throw InvalidStateError when the cursor is being iterated</title> +<link rel="author" title="Mozilla" href="https://www.mozilla.org"> +<link rel="help" href="https://www.w3.org/TR/IndexedDB/#widl-IDBCursor-update-IDBRequest-any-value"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support.js"></script> +<div id="log"></div> +<script> + var db, + t = async_test(), + records = [{ pKey: "primaryKey_0", value: "value_0" }, + { pKey: "primaryKey_1", value: "value_1" }]; + + var open_rq = createdb(t); + open_rq.onupgradeneeded = function (event) { + db = event.target.result; + + var objStore = db.createObjectStore("store", {keyPath : "pKey"}); + + for (var i = 0; i < records.length; i++) { + objStore.add(records[i]); + } + } + + open_rq.onsuccess = function(e) { + var cursor_rq = db.transaction("store", "readwrite") + .objectStore("store") + .openCursor(); + + cursor_rq.onsuccess = t.step_func(function(event) { + var cursor = event.target.result; + assert_true(cursor instanceof IDBCursor, "cursor exists"); + + cursor.continue(); + assert_throws("InvalidStateError", function() { + cursor.update({ pKey: "primaryKey_0", value: "value_0_updated" }); + }); + + t.done(); + }); + } +</script> + diff --git a/tests/wpt/web-platform-tests/IndexedDB/interfaces.idl b/tests/wpt/web-platform-tests/IndexedDB/interfaces.idl index 055e62f46b3..6eee5f47a35 100644 --- a/tests/wpt/web-platform-tests/IndexedDB/interfaces.idl +++ b/tests/wpt/web-platform-tests/IndexedDB/interfaces.idl @@ -88,7 +88,7 @@ interface IDBDatabase : EventTarget { }; interface IDBObjectStore { - readonly attribute DOMString name; + attribute DOMString name; readonly attribute any keyPath; readonly attribute DOMStringList indexNames; readonly attribute IDBTransaction transaction; @@ -106,7 +106,7 @@ interface IDBObjectStore { }; interface IDBIndex { - readonly attribute DOMString name; + attribute DOMString name; readonly attribute IDBObjectStore objectStore; readonly attribute any keyPath; readonly attribute boolean multiEntry; diff --git a/tests/wpt/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm b/tests/wpt/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm new file mode 100644 index 00000000000..b6f15828afe --- /dev/null +++ b/tests/wpt/web-platform-tests/XMLHttpRequest/open-url-multi-window-6.htm @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<html> + <head> + <title>XMLHttpRequest: open() in document that is not fully active (but may be active) should throw</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method"> + </head> + <body> + <div id="log"></div> + <script> + var test = async_test(), + client, + count = 0, + win = window.open("resources/init.htm"); + test.add_cleanup(function() { win.close(); }); + function init() { + test.step(function() { + if(0 == count) { + var doc = win.document; + var ifr = document.createElement("iframe"); + ifr.onload = function() { + // Again, do things async so we're not doing loads from inside + // load events. + setTimeout(function() { + client = new ifr.contentWindow.XMLHttpRequest(); + count++; + // Important to do a normal navigation, not a reload. + win.location.href = "resources/init.htm"; + }, 100); + } + doc.body.appendChild(ifr); + } else if(1 == count) { + assert_throws("InvalidStateError", function() { client.open("GET", "...") }) + test.done() + } + }) + } + </script> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/XMLHttpRequest/resources/init.htm b/tests/wpt/web-platform-tests/XMLHttpRequest/resources/init.htm index 7c56d88800d..6f936c4fb28 100644 --- a/tests/wpt/web-platform-tests/XMLHttpRequest/resources/init.htm +++ b/tests/wpt/web-platform-tests/XMLHttpRequest/resources/init.htm @@ -4,6 +4,17 @@ <title>support init file</title> </head> <body> - <script> parent.init() </script> + <script> + onload = function() { + // Run async, because navigations from inside onload can be a bit weird. + setTimeout(function() { + if (parent != window) { + parent.init() + } else { + opener.init(); + } + }, 0); + } + </script> </body> </html> diff --git a/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005-ref.html b/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005-ref.html index f173137fabf..1391e38c1e1 100644 --- a/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005-ref.html +++ b/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005-ref.html @@ -5,9 +5,11 @@ <link rel="author" title="Mozilla" href="https://www.mozilla.org"> <style type="text/css"> p { - font-size: 50px; - text-decoration: underline; color: green; } +p.underline { + text-decoration: underline; +} </style> <div><p>Pass if text underline is green!!!</p></div> +<div><p class="underline"> </p></div> diff --git a/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005.html b/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005.html index b3549d68b17..88ac17a8152 100644 --- a/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005.html +++ b/tests/wpt/web-platform-tests/compat/webkit-text-fill-color-property-005.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <meta charset="utf-8"> -<title>webkit-text-fill-color should take effect while rendering text-decoration underline</title> +<title>webkit-text-fill-color should not take effect while rendering text-decoration underline</title> <link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com"> <link rel="author" title="Mozilla" href="https://www.mozilla.org"> <link rel="help" href="https://compat.spec.whatwg.org/#the-webkit-text-fill-color"> @@ -8,10 +8,12 @@ <link rel="match" href="webkit-text-fill-color-property-005-ref.html"> <style type="text/css"> p { - font-size: 50px; + color: green; +} +p.underline { text-decoration: underline; - color: red; - -webkit-text-fill-color: green; + -webkit-text-fill-color: red } </style> <div><p>Pass if text underline is green!!!</p></div> +<div><p class="underline"> </p></div> diff --git a/tests/wpt/web-platform-tests/cors/credentials-flag.htm b/tests/wpt/web-platform-tests/cors/credentials-flag.htm index 42b37953ca4..bacd43c4ed5 100644 --- a/tests/wpt/web-platform-tests/cors/credentials-flag.htm +++ b/tests/wpt/web-platform-tests/cors/credentials-flag.htm @@ -17,6 +17,13 @@ var url = CROSSDOMAIN + 'resources/cors-cookie.py?ident=' * widthCredentials */ // XXX Do some https tests here as well + +test(function () { + var client = new XMLHttpRequest() + client.open('GET', CROSSDOMAIN, false) + client.withCredentials = true; +}, 'Setting withCredentials on a sync XHR object should not throw') + async_test(function () { var id = new Date().getTime() + '_1', client = new XMLHttpRequest() diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars-first-char.html b/tests/wpt/web-platform-tests/custom-elements/v0/concepts/custom-elements-type-allowed-chars-first-char.html index b83b5fa7869..b83b5fa7869 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars-first-char.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/concepts/custom-elements-type-allowed-chars-first-char.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars.html b/tests/wpt/web-platform-tests/custom-elements/v0/concepts/custom-elements-type-allowed-chars.html index 64252ab49d8..64252ab49d8 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/concepts/custom-elements-type-allowed-chars.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/concepts/custom-elements-type-allowed-chars.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/concepts/custom-elements-type-naming.html b/tests/wpt/web-platform-tests/custom-elements/v0/concepts/custom-elements-type-naming.html index c05f1ccdeb4..c05f1ccdeb4 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/concepts/custom-elements-type-naming.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/concepts/custom-elements-type-naming.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/new-registry-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/new-registry-test.html index 597f15c2154..597f15c2154 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/new-registry-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/new-registry-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/no-registry-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/no-registry-test.html index d936fd34f7b..d936fd34f7b 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/no-registry-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/no-registry-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/share-registry-create-document.html b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/share-registry-create-document.html index 64244f169c8..64244f169c8 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/share-registry-create-document.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/share-registry-create-document.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/share-registry-import-document.html b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/share-registry-import-document.html index 251e4f123ee..251e4f123ee 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/creating-and-passing-registries/share-registry-import-document.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/creating-and-passing-registries/share-registry-import-document.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html index 97fb735607c..97fb735607c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/enqueuing-and-invoking-callbacks/invoke-callbacks.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html index df4df553525..df4df553525 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-move-element-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html index a4cc0b746cc..a4cc0b746cc 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attached-callback-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html index cd5f3a4b8c6..cd5f3a4b8c6 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-change-attribute-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html index fb451b074cc..fb451b074cc 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-remove-attribute-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html index 1c4ab8618a9..1c4ab8618a9 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/attribute-changed-callback-set-attribute-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html index 188957c1ac0..188957c1ac0 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-element-prototype-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html index b0f2d5ee8bf..b0f2d5ee8bf 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-order-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html index 63814a80f50..63814a80f50 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/created-callback-invocation-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html index d69eb54dbb4..d69eb54dbb4 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-move-element-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html index 2b420d11c2c..2b420d11c2c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-no-browsing-context-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html index 31b06a9079c..31b06a9079c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/custom-element-lifecycle/types-of-callbacks/detached-callback-with-browsing-context-test.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/changing-is-attribute.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/changing-is-attribute.html index fb4338840a8..fb4338840a8 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/changing-is-attribute.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/changing-is-attribute.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-is-attribute.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-is-attribute.html index 0e18bf65105..0e18bf65105 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-is-attribute.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-is-attribute.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-local-name.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-local-name.html index 28f6ca33ff2..28f6ca33ff2 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-local-name.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-local-name.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-namespace.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-namespace.html index 7278086ac87..7278086ac87 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-namespace.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-namespace.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-node-document.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-node-document.html index 3112b36da3e..3112b36da3e 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-node-document.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-node-document.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-prototype.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-prototype.html index 0158af511d1..0158af511d1 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-constructor-prototype.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-constructor-prototype.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-prototype.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-prototype.html index 2b298ea7439..2b298ea7439 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-prototype.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-prototype.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-is-attribute.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-type-is-attribute.html index c18290d0e14..c18290d0e14 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-is-attribute.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-type-is-attribute.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name-and-is-attribute.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-type-local-name-and-is-attribute.html index c55e2cc25f6..c55e2cc25f6 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name-and-is-attribute.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-type-local-name-and-is-attribute.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-type-local-name.html index 0f0d46f0a39..0f0d46f0a39 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/custom-element-type-local-name.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/custom-element-type-local-name.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html index f59d6dcb82f..f59d6dcb82f 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-local-name.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html index 3df04267627..3df04267627 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-interface-type-is-a-type-extension.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-is-attribute.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-is-attribute.html index 374ec5922a8..374ec5922a8 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-is-attribute.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-is-attribute.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-namespace.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-namespace.html index 60d50121923..60d50121923 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-namespace.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-namespace.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-is-a-type.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-is-a-type.html index ce7c933e21a..ce7c933e21a 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-is-a-type.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-is-a-type.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-unresolved.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-unresolved.html index 3eaadf31251..3eaadf31251 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-extension-unresolved.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-extension-unresolved.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-is-a-local-name.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-is-a-local-name.html index 487b14b9dcc..487b14b9dcc 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/create-element-type-is-a-local-name.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/create-element-type-is-a-local-name.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element-ns.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element-ns.html index 7bf09601cb8..7bf09601cb8 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element-ns.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element-ns.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element.html index dc05e01e17c..dc05e01e17c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/extensions-to-document-interface/created-callback-create-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/extensions-to-document-interface/created-callback-create-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/non-configurable-constructor-property.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/non-configurable-constructor-property.html index ddb1ff9de97..ddb1ff9de97 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/non-configurable-constructor-property.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/non-configurable-constructor-property.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/prototype-is-interface-prototype-object.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/prototype-is-interface-prototype-object.html index ad7f454f50c..ad7f454f50c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/prototype-is-interface-prototype-object.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/prototype-is-interface-prototype-object.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/unchanged-attribute.html b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/unchanged-attribute.html index 3baa174cb5f..3baa174cb5f 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/instantiating-custom-elements/unchanged-attribute.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/instantiating/unchanged-attribute.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-default-namespace.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-default-namespace.html index 6a1f532c785..6a1f532c785 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-default-namespace.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-default-namespace.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-duplicate-definition.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-duplicate-definition.html index b3f661c4fde..b3f661c4fde 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-duplicate-definition.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-duplicate-definition.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-invalid-type.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-invalid-type.html index 5f2c09b4bbd..5f2c09b4bbd 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-invalid-type.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-invalid-type.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-local-name-lowercased.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-local-name-lowercased.html index 7725e2efa54..7725e2efa54 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-local-name-lowercased.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-local-name-lowercased.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-name-is-null.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-name-is-null.html index 2b76818d6e6..2b76818d6e6 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-name-is-null.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-name-is-null.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-no-interface-for-name.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-no-interface-for-name.html index 6d72d60df9a..6d72d60df9a 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-no-interface-for-name.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-no-interface-for-name.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace-name-is-null.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-svg-namespace-name-is-null.html index dd6b61059b0..dd6b61059b0 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace-name-is-null.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-svg-namespace-name-is-null.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-svg-namespace.html index 497de2919fc..497de2919fc 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-svg-namespace.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-svg-namespace.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-type-name-lowercased.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-type-name-lowercased.html index 38dce801c00..38dce801c00 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/definition-construction-algorithm-type-name-lowercased.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/definition-construction-algorithm-type-name-lowercased.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/element-registration-algorithm-no-registry.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/element-registration-algorithm-no-registry.html index 6e9c20be30c..6e9c20be30c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/element-registration-algorithm-no-registry.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/element-registration-algorithm-no-registry.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-name.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-name.html index e276e834a4a..e276e834a4a 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-name.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-name.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-prototype.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html index de397aacd8d..de397aacd8d 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/extensions-to-document-interface/custom-element-prototype.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/extensions-to-document-interface/custom-element-prototype.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html index 33c36463ceb..33c36463ceb 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag-ref.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html index 290e5b15cfc..290e5b15cfc 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-custom-tag.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html index d49f3d768fd..d49f3d768fd 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag-ref.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html index 3cd7b41d6e7..3cd7b41d6e7 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-custom-tag.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html index 90baf95544c..90baf95544c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension-ref.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html index 65921bd4147..65921bd4147 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-registered-type-extension.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html index 9865f2e3926..9865f2e3926 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension-ref.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html index 60f39125a0b..60f39125a0b 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-css-test-type-extension.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html index 2ddc2afc291..2ddc2afc291 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector-all.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html index 47b7e5c4718..47b7e5c4718 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-element-pseudoclass/unresolved-element-pseudoclass-matching-query-selector.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-elements-interface-html-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-elements-interface-html-element.html index 492c75b7290..492c75b7290 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-elements-interface-html-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-elements-interface-html-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-elements-interface-html-unknown-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-elements-interface-html-unknown-element.html index 70c23d3c987..70c23d3c987 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-elements-interface-html-unknown-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-elements-interface-html-unknown-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-elements-interface-svg-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-elements-interface-svg-element.html index 4164b62dc9c..4164b62dc9c 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/registering/unresolved-elements-interface-svg-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/registering/unresolved-elements-interface-svg-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/blank.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/blank.html index 2e5697ba1fd..2e5697ba1fd 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/blank.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/blank.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/import-master-async.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/import-master-async.html index 0ecaafb29b7..0ecaafb29b7 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/import-master-async.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/import-master-async.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/import-master.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/import-master.html index d91bcb9cdb6..d91bcb9cdb6 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/import-master.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/import-master.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/import.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/import.html index dddc4670181..dddc4670181 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/import.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/import.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/register-and-create-custom-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/register-and-create-custom-element.html index 3aabff24485..3aabff24485 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/register-and-create-custom-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/register-and-create-custom-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/x-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/x-element.html index 0c0d2daad6a..0c0d2daad6a 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/x-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/x-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/x-mathml-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/x-mathml-element.html index 3efdc2d0088..3efdc2d0088 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/x-mathml-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/x-mathml-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/x-svg-element.html b/tests/wpt/web-platform-tests/custom-elements/v0/resources/x-svg-element.html index 6cea8575882..6cea8575882 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/resources/x-svg-element.html +++ b/tests/wpt/web-platform-tests/custom-elements/v0/resources/x-svg-element.html diff --git a/tests/wpt/web-platform-tests/custom-elements/pre-v1/testcommon.js b/tests/wpt/web-platform-tests/custom-elements/v0/testcommon.js index 5cddbe8bc72..5cddbe8bc72 100644 --- a/tests/wpt/web-platform-tests/custom-elements/pre-v1/testcommon.js +++ b/tests/wpt/web-platform-tests/custom-elements/v0/testcommon.js diff --git a/tests/wpt/web-platform-tests/dom/nodes/Element-classlist.html b/tests/wpt/web-platform-tests/dom/nodes/Element-classlist.html index d3d6deb040c..22b499e931f 100644 --- a/tests/wpt/web-platform-tests/dom/nodes/Element-classlist.html +++ b/tests/wpt/web-platform-tests/dom/nodes/Element-classlist.html @@ -377,6 +377,26 @@ test(function () { assert_equals(secondelem.classList[0],'foo'); assert_equals(secondelem.classList[1],'bar'); }, 'classList must have [PutForwards=value]'); +test(function () { + var foo = document.createElement('div'); + foo.className = 'a'; + foo.classList.replace('token1', 'token2'); + + assert_equals(foo.className, 'a'); + + foo.classList.replace('a', 'b'); + assert_equals(foo.className, 'b'); + + assert_throws('SYNTAX_ERR', function () { foo.classList.replace('t with space', '') }); + assert_throws('INVALID_CHARACTER_ERR', function () { foo.classList.replace('t with space', 'foo') }); + assert_throws('SYNTAX_ERR', function () { foo.classList.replace('', 'foo') }); +}, 'classList.replace should work'); + +test(function() { + var foo = document.createElement('div'); + assert_throws(new TypeError(), + function() { foo.classList.supports('hello') }); +}, 'classList.supports should throw'); </script> </head> <body> diff --git a/tests/wpt/web-platform-tests/domparsing/OWNERS b/tests/wpt/web-platform-tests/domparsing/OWNERS index 113c79d205d..8aeebafa5f5 100644 --- a/tests/wpt/web-platform-tests/domparsing/OWNERS +++ b/tests/wpt/web-platform-tests/domparsing/OWNERS @@ -2,4 +2,3 @@ @ChrisParis @deniak @jdm -@Ms2ger diff --git a/tests/wpt/web-platform-tests/domparsing/createContextualFragment.html b/tests/wpt/web-platform-tests/domparsing/createContextualFragment.html new file mode 100644 index 00000000000..ce7d813583c --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/createContextualFragment.html @@ -0,0 +1,131 @@ +<!doctype html> +<title>createContextualFragment() tests</title> +<div id=log></div> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<script> +// We are not testing XML documents here, because apparently it's not clear +// what we want to happen there. We also aren't testing the HTML parser in any +// depth, just some basic sanity checks. + +// Exception-throwing +test(function() { + var range = document.createRange(); + range.detach(); + range.createContextualFragment(""); +}, "Must not throw INVALID_STATE_ERR for a detached node."); + +test(function() { + var range = document.createRange(); + assert_throws(new TypeError(), function() { + range.createContextualFragment(); + }); +}, "Must throw TypeError when calling without arguments"); + +test(function() { + // Simple test + var range = document.createRange(); + range.selectNodeContents(document.body); + + var fragment = "<p CLaSs=testclass> Hi! <p>Hi!"; + var expected = document.createDocumentFragment(); + var tmpNode = document.createElement("p"); + tmpNode.setAttribute("class", "testclass"); + tmpNode.appendChild(document.createTextNode(" Hi! ")); + expected.appendChild(tmpNode); + + tmpNode = document.createElement("p"); + tmpNode.appendChild(document.createTextNode("Hi!")); + expected.appendChild(tmpNode); + + var result = range.createContextualFragment(fragment); + assert_true(expected.isEqualNode(result), + "Unexpected result (collapsed Range)"); + + // Token test that the end node makes no difference + range.setEnd(document.body.getElementsByTagName("script")[0], 0); + result = range.createContextualFragment(fragment); + assert_true(expected.isEqualNode(result), + "Unexpected result (Range ends in <script>)"); +}, "Simple test with paragraphs"); + +test(function() { + // This test based on https://bugzilla.mozilla.org/show_bug.cgi?id=585819, + // from a real-world compat bug + var range = document.createRange(); + range.selectNodeContents(document.documentElement); + var fragment = "<span>Hello world</span>"; + var expected = document.createDocumentFragment(); + var tmpNode = document.createElement("span"); + tmpNode.appendChild(document.createTextNode("Hello world")); + expected.appendChild(tmpNode); + + var result = range.createContextualFragment(fragment); + assert_true(expected.isEqualNode(result), + "Unexpected result (collapsed Range)"); + + // Another token test that the end node makes no difference + range.setEnd(document.head, 0); + result = range.createContextualFragment(fragment); + assert_true(expected.isEqualNode(result), + "Unexpected result (Range ends in <head>)"); +}, "Don't auto-create <body> when applied to <html>"); + +// Scripts should be run if inserted (that's what the "Unmark all scripts +// . . ." line means, I'm told) +var passed = false; +test(function() { + assert_false(passed, "Sanity check"); + var range = document.createRange(); + range.selectNodeContents(document.documentElement); + var fragment = range.createContextualFragment("<script>passed = true</s" + "cript>"); + assert_false(passed, "Fragment created but not yet added to document, should not have run"); + document.body.appendChild(fragment); + assert_true(passed, "Fragment created and added to document, should run"); +}, "<script>s should be run when appended to the document (but not before)"); + +// Now that we've established basic sanity, let's do equivalence tests. Those +// are easier to write anyway. +function testEquivalence(element1, fragment1, element2, fragment2) { + var range1 = element1.ownerDocument.createRange(); + range1.selectNodeContents(element1); + var range2 = element2.ownerDocument.createRange(); + range2.selectNodeContents(element2); + + var result1 = range1.createContextualFragment(fragment1); + var result2 = range2.createContextualFragment(fragment2); + + assert_true(result1.isEqualNode(result2), "Results are supposed to be equivalent"); + + // Throw in partial ownerDocument tests on the side, since the algorithm + // does specify that and we don't want to completely not test it. + if (result1.firstChild != null) { + assert_equals(result1.firstChild.ownerDocument, element1.ownerDocument, + "ownerDocument must be set to that of the reference node"); + } + if (result2.firstChild != null) { + assert_equals(result2.firstChild.ownerDocument, element2.ownerDocument, + "ownerDocument must be set to that of the reference node"); + } +} + +var tests = [ + ["<html> and <body> must work the same, 1", document.documentElement, "<span>Hello world</span>", document.body, "<span>Hello world</span>"], + ["<html> and <body> must work the same, 2", document.documentElement, "<body><p>Hello world", document.body, "<body><p>Hello world"], + ["Implicit <body> creation", document.documentElement, "<body><p>", document.documentElement, "<p>"], + ["Namespace generally shouldn't matter", + document.createElementNS("http://fake-namespace", "div"), "<body><p><span>Foo", + document.createElement("div"), "<body><p><span>Foo"], + ["<html> in a different namespace shouldn't be special", + document.createElementNS("http://fake-namespace", "html"), "<body><p>", + document.createElement("div"), "<body><p>"], + ["null should be stringified", document.createElement("span"), null, document.createElement("span"), "null"], + ["undefined should be stringified", document.createElement("span"), undefined, document.createElement("span"), "undefined"]/*, + // FIXME: Spec doesn't say what to do about non-Elements! + ["Text nodes?", + document.createTextNode("?"), "<span>", + document.createTextNode("?"), "<span>"]*/ +]; + +generate_tests(testEquivalence, tests); +</script> diff --git a/tests/wpt/web-platform-tests/domparsing/innerhtml-01.xhtml b/tests/wpt/web-platform-tests/domparsing/innerhtml-01.xhtml new file mode 100644 index 00000000000..432cfbf41f5 --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/innerhtml-01.xhtml @@ -0,0 +1,28 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>innerHTML in XHTML: getting while the document is in an invalid state</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/> +<link rel="help" href="https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML"/> +<link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/> +<link rel="help" href="http://www.whatwg.org/html5/#document.title"/> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="log"></div> +<script> +test(function() { + document.documentElement.appendChild(document.createElement("test:test")); + assert_throws("INVALID_STATE_ERR", function() { + document.documentElement.innerHTML; + }, "getting element with \":\" in its local name"); +}); +test(function() { + document.title = "\f"; + assert_throws("INVALID_STATE_ERR", function() { + document.getElementsByTagName("title")[0].innerHTML; + }, "Getting a Text node whose data contains characters that are not matched by the XML Char production"); +}); +</script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/domparsing/innerhtml-03.xhtml b/tests/wpt/web-platform-tests/domparsing/innerhtml-03.xhtml new file mode 100644 index 00000000000..313531e49cd --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/innerhtml-03.xhtml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>innerHTML in XHTML</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/> +<link rel="help" href="http://html5.org/specs/dom-parsing.html#dom-innerhtml"/> +<link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="log"></div> +<script><![CDATA[ +test(function() { + var el = document.createElement("div"); + el.appendChild(document.createElement("xmp")) + .appendChild(document.createElement("span")) + .appendChild(document.createTextNode("<")); + assert_equals(el.innerHTML, "<xmp xmlns=\"http://www.w3.org/1999/xhtml\"><span><<\/span><\/xmp>"); +}) +test(function() { + var el = document.createElement("xmp"); + el.appendChild(document.createElement("span")) + .appendChild(document.createTextNode("<")); + assert_equals(el.innerHTML, "<span xmlns=\"http://www.w3.org/1999/xhtml\"><<\/span>"); +}) +test(function() { + var el = document.createElement("xmp"); + el.appendChild(document.createTextNode("<")); + assert_equals(el.innerHTML, "<"); +}) +test(function() { + var el = document.createElement("div"); + el.appendChild(document.createElement("br")); + assert_equals(el.innerHTML, "<br xmlns=\"http://www.w3.org/1999/xhtml\" />"); +}) +test(function() { + var el = document.createElement("div"); + el.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "html:br")); + assert_equals(el.innerHTML, "<html:br xmlns:html=\"http://www.w3.org/1999/xhtml\" />"); +}) +test(function() { + var el = document.createElement("div"); + el.appendChild(document.createTextNode("<>\"'&")); + assert_equals(el.innerHTML, "<>\"'&"); +}) +test(function() { + var el = document.createElement("div"); + el.appendChild(document.createTextNode("<>"'&")); + assert_equals(el.innerHTML, "&lt;&gt;&quot;&apos;&amp;"); +}) +test(function() { + var el = document.createElement("div"); + el.appendChild(document.createTextNode("àו…\u00A0")); + assert_equals(el.innerHTML, "àו…\u00A0"); +}) +]]></script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/domparsing/innerhtml-04.html b/tests/wpt/web-platform-tests/domparsing/innerhtml-04.html new file mode 100644 index 00000000000..32c921d235d --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/innerhtml-04.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<title>innerHTML in HTML</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> +<link rel="help" href="https://w3c.github.io/DOM-Parsing/#widl-Element-innerHTML"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> +function testIsChild(p, c) { + assert_equals(p.firstChild, c); + assert_equals(c.parentNode, p); +} +test(function() { + var p = document.createElement('p'); + var b = p.appendChild(document.createElement('b')); + var t = b.appendChild(document.createTextNode("foo")); + testIsChild(p, b); + testIsChild(b, t); + assert_equals(t.data, "foo"); + p.innerHTML = ""; + testIsChild(b, t); + assert_equals(t.data, "foo"); +}, "innerHTML should leave the removed children alone.") +</script> diff --git a/tests/wpt/web-platform-tests/domparsing/innerhtml-05.xhtml b/tests/wpt/web-platform-tests/domparsing/innerhtml-05.xhtml new file mode 100644 index 00000000000..da2d8515952 --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/innerhtml-05.xhtml @@ -0,0 +1,26 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>innerHTML in XHTML</title> +<link rel="author" title="Simon Pieters" href="mailto:simonp@opera.com"/> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"/> +<link rel="help" href="http://html5.org/specs/dom-parsing.html#dom-innerhtml"/> +<link rel="help" href="http://www.whatwg.org/html5/#xml-fragment-serialization-algorithm"/> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="log"></div> +<iframe src="data:text/xml,<html xmlns='http://www.w3.org/1999/xhtml'><foo--/></html>"></iframe> +<script><![CDATA[ +var t = async_test(); +window.onload = t.step_func(function() { + var foo = window[0].document.documentElement.firstChild; + assert_throws('SyntaxError', function() { + foo.innerHTML = 'x<\/foo--><\!--y'; + // This is ridiculous. + }); + t.done(); +}); +]]></script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/domparsing/innerhtml-06.html b/tests/wpt/web-platform-tests/domparsing/innerhtml-06.html new file mode 100644 index 00000000000..81e9c57b5ce --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/innerhtml-06.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<html> +<head> +<title>math in html: innerHTML</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<h1>math in html: innerHTML</h1> +<div id="log"></div> +<div style="display:none"> +<div id="d1"><math><mi>x</mi></math></div> +</div> +<script> +test(function() { + var math = document.getElementById("d1").firstChild; + assert_equals(math.innerHTML, "<mi>x</mi>"); +},"innerHTML defined on math."); +</script> diff --git a/tests/wpt/web-platform-tests/domparsing/innerhtml-07.html b/tests/wpt/web-platform-tests/domparsing/innerhtml-07.html new file mode 100644 index 00000000000..9e313a2cb01 --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/innerhtml-07.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<title>innerHTML and string conversion</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> +<link rel="help" href="http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> +test(function() { + var p = document.createElement("p"); + p.innerHTML = null; + assert_equals(p.innerHTML, ""); + assert_equals(p.textContent, ""); +}, "innerHTML and string conversion: null.") + +test(function() { + var p = document.createElement("p"); + p.innerHTML = undefined; + assert_equals(p.innerHTML, "undefined"); + assert_equals(p.textContent, "undefined"); +}, "innerHTML and string conversion: undefined.") + +test(function() { + var p = document.createElement("p"); + p.innerHTML = 42; + assert_equals(p.innerHTML, "42"); + assert_equals(p.textContent, "42"); +}, "innerHTML and string conversion: number.") + +test(function() { + var p = document.createElement("p"); + p.innerHTML = { + toString: function() { return "pass"; }, + valueOf: function() { return "fail"; } + }; + assert_equals(p.innerHTML, "pass"); + assert_equals(p.textContent, "pass"); +}, "innerHTML and string conversion: toString.") + +test(function() { + var p = document.createElement("p"); + p.innerHTML = { + toString: undefined, + valueOf: function() { return "pass"; } + }; + assert_equals(p.innerHTML, "pass"); + assert_equals(p.textContent, "pass"); +}, "innerHTML and string conversion: valueOf.") +</script> diff --git a/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.html b/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.html new file mode 100644 index 00000000000..dfe624f03ad --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.html @@ -0,0 +1,94 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>insertAdjacentHTML in HTML</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="insert_adjacent_html.js"></script> +</head> +<body> +<p id="display"></p><div id="content" style="display: none"></div><div id="content2" style="display: none"></div> +<script> +var script_ran = false; + +function testPositions(node, testDesc) { + test(function() { + script_ran = false; + node.insertAdjacentHTML("beforeBegin", "\u003Cscript>script_ran = true;\u003C/script><i></i>"); + assert_equals(node.previousSibling.localName, "i", "Should have had <i> as previous sibling"); + assert_equals(node.previousSibling.previousSibling.localName, "script", "Should have had <script> as second previous child"); + assert_false(script_ran, "script should not have run"); + }, "beforeBegin " + node.id + " " + testDesc) + + test(function() { + script_ran = false; + node.insertAdjacentHTML("Afterbegin", "<b></b>\u003Cscript>script_ran = true;\u003C/script>"); + assert_equals(node.firstChild.localName, "b", "Should have had <b> as first child"); + assert_equals(node.firstChild.nextSibling.localName, "script", "Should have had <script> as second child"); + assert_false(script_ran, "script should not have run"); + }, "Afterbegin " + node.id + " " + testDesc); + + test(function() { + script_ran = false; + node.insertAdjacentHTML("BeforeEnd", "\u003Cscript>script_ran = true;\u003C/script><u></u>"); + assert_equals(node.lastChild.localName, "u", "Should have had <u> as last child"); + assert_equals(node.lastChild.previousSibling.localName, "script", "Should have had <script> as penultimate child"); + assert_false(script_ran, "script should not have run"); + }, "BeforeEnd " + node.id + " " + testDesc) + + test(function() { + script_ran = false; + node.insertAdjacentHTML("afterend", "<a></a>\u003Cscript>script_ran = true;\u003C/script>"); + assert_equals(node.nextSibling.localName, "a", "Should have had <a> as next sibling"); + assert_equals(node.nextSibling.nextSibling.localName, "script", "Should have had <script> as second next sibling"); + assert_false(script_ran, "script should not have run"); + }, "afterend " + node.id + " " + testDesc) +} + +var content = document.getElementById("content"); +testPositions(content, "without next sibling"); +testPositions(content, "again, with next sibling"); + +test(function() { + assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("bar", "foo")}); + assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegİn", "foo")}); + assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegın", "foo")}); +}, "Should throw when inserting with invalid position string"); + +var parentElement = document.createElement("div"); +var child = document.createElement("div"); +child.id = "child"; + +testThrowingNoParent(child, "null"); +testThrowingNoParent(document.documentElement, "a document"); + +test(function() { + child.insertAdjacentHTML("afterBegin", "foo"); + child.insertAdjacentHTML("beforeend", "bar"); + assert_equals(child.textContent, "foobar"); + parentElement.appendChild(child); +}, "Inserting after being and before end should order things correctly"); + +testPositions(child, "node not in tree but has parent"); + +test(function() { + script_ran = false; + content.appendChild(parentElement); // must not run scripts + assert_false(script_ran, "script should not have run"); +}, "Should not run script when appending things which have descendant <script> inserted via insertAdjacentHTML"); + +var content2 = document.getElementById("content2"); +testPositions(content2, "without next sibling"); +testPositions(content2, "test again, now that there's a next sibling"); + +// HTML only +test(function() { + document.body.insertAdjacentHTML("afterend", "<p>"); + document.head.insertAdjacentHTML("beforebegin", "<p>"); + assert_equals(document.getElementsByTagName("head").length, 1, "Should still have one head"); + assert_equals(document.getElementsByTagName("body").length, 1, "Should still have one body"); +}, "Inserting kids of the <html> element should not do weird things with implied <body>/<head> tags") +</script> +<div id="log"></div> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.js b/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.js new file mode 100644 index 00000000000..2451228d193 --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.js @@ -0,0 +1,33 @@ +function testThrowingNoParent(element, desc) { + test(function() { + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("afterend", "") } + ); + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("beforebegin", "") } + ); + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("afterend", "foo") } + ); + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("beforebegin", "foo") } + ); + }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (text)"); + test(function() { + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("afterend", "<!-- fail -->") } + ); + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("beforebegin", "<!-- fail -->") } + ); + }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (comments)"); + test(function() { + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("afterend", "<div></div>") } + ); + assert_throws("NO_MODIFICATION_ALLOWED_ERR", + function() { element.insertAdjacentHTML("beforebegin", "<div></div>") } + ); + }, "When the parent node is " + desc + ", insertAdjacentHTML should throw for beforebegin and afterend (elements)"); +} + diff --git a/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.xhtml b/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.xhtml new file mode 100644 index 00000000000..eadf10e2c1f --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/insert_adjacent_html.xhtml @@ -0,0 +1,91 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>insertAdjacentHTML in HTML</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="insert_adjacent_html.js"></script> +</head> +<body> +<p id="display"></p><div id="content" style="display: none"></div><div id="content2" style="display: none"></div> +<script><![CDATA[ +var script_ran = false; + +function testPositions(node, testDesc) { + test(function() { + script_ran = false; + node.insertAdjacentHTML("beforeBegin", "\u003Cscript>script_ran = true;\u003C/script><i></i>"); + assert_equals(node.previousSibling.localName, "i", "Should have had <i> as previous sibling"); + assert_equals(node.previousSibling.previousSibling.localName, "script", "Should have had <script> as second previous child"); + assert_false(script_ran, "script should not have run"); + }, "beforeBegin " + node.id + " " + testDesc) + + test(function() { + script_ran = false; + node.insertAdjacentHTML("Afterbegin", "<b></b>\u003Cscript>script_ran = true;\u003C/script>"); + assert_equals(node.firstChild.localName, "b", "Should have had <b> as first child"); + assert_equals(node.firstChild.nextSibling.localName, "script", "Should have had <script> as second child"); + assert_false(script_ran, "script should not have run"); + }, "Afterbegin " + node.id + " " + testDesc); + + test(function() { + script_ran = false; + node.insertAdjacentHTML("BeforeEnd", "\u003Cscript>script_ran = true;\u003C/script><u></u>"); + assert_equals(node.lastChild.localName, "u", "Should have had <u> as last child"); + assert_equals(node.lastChild.previousSibling.localName, "script", "Should have had <script> as penultimate child"); + assert_false(script_ran, "script should not have run"); + }, "BeforeEnd " + node.id + " " + testDesc) + + test(function() { + script_ran = false; + node.insertAdjacentHTML("afterend", "<a></a>\u003Cscript>script_ran = true;\u003C/script>"); + assert_equals(node.nextSibling.localName, "a", "Should have had <a> as next sibling"); + assert_equals(node.nextSibling.nextSibling.localName, "script", "Should have had <script> as second next sibling"); + assert_false(script_ran, "script should not have run"); + }, "afterend " + node.id + " " + testDesc) +} + +var content = document.getElementById("content"); +testPositions(content, "without next sibling"); +testPositions(content, "again, with next sibling"); + +test(function() { + assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("bar", "foo")}); + assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegİn", "foo")}); + assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforebegın", "foo")}); +}, "Should throw when inserting with invalid position string"); + +var parentElement = document.createElement("div"); +var child = document.createElement("div"); +child.id = "child"; + +testThrowingNoParent(child, "null"); +testThrowingNoParent(document.documentElement, "a document"); + +test(function() { + child.insertAdjacentHTML("afterBegin", "foo"); + child.insertAdjacentHTML("beforeend", "bar"); + assert_equals(child.textContent, "foobar"); + parentElement.appendChild(child); +}, "Inserting after being and before end should order things correctly"); + +testPositions(child, "node not in tree but has parent"); + +test(function() { + script_ran = false; + content.appendChild(parentElement); // must not run scripts + assert_false(script_ran, "script should not have run"); +}, "Should not run script when appending things which have descendant <script> inserted via insertAdjacentHTML"); + +var content2 = document.getElementById("content2"); +testPositions(content2, "without next sibling"); +testPositions(content2, "test again, now that there's a next sibling"); + +// XML-only: +test(function() { + assert_throws("SYNTAX_ERR", function() {content.insertAdjacentHTML("beforeend", "<p>")}); +}); + +]]></script> +<div id="log"></div> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/domparsing/outerhtml-01.html b/tests/wpt/web-platform-tests/domparsing/outerhtml-01.html new file mode 100644 index 00000000000..2e8072e49f9 --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/outerhtml-01.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>outerHTML: child of #document</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> +<link rel="help" href="http://html5.org/specs/dom-parsing.html#outerhtml"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> +test(function() { + assert_throws("NO_MODIFICATION_ALLOWED_ERR", function() { + document.documentElement.outerHTML = "<html><p>FAIL: Should have thrown an error<\/p><\/html>"; + }) +}); +</script> + diff --git a/tests/wpt/web-platform-tests/domparsing/outerhtml-02.html b/tests/wpt/web-platform-tests/domparsing/outerhtml-02.html new file mode 100644 index 00000000000..7b69fbf6724 --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/outerhtml-02.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<title>outerHTML and string conversion</title> +<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> +<link rel="help" href="http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<script> +test(function() { + var div = document.createElement("div"); + var p = div.appendChild(document.createElement("p")); + p.outerHTML = null; + assert_equals(div.innerHTML, ""); + assert_equals(div.textContent, ""); +}, "outerHTML and string conversion: null.") + +test(function() { + var div = document.createElement("div"); + var p = div.appendChild(document.createElement("p")); + p.outerHTML = undefined; + assert_equals(div.innerHTML, "undefined"); + assert_equals(div.textContent, "undefined"); +}, "outerHTML and string conversion: undefined.") + +test(function() { + var div = document.createElement("div"); + var p = div.appendChild(document.createElement("p")); + p.outerHTML = 42; + assert_equals(div.innerHTML, "42"); + assert_equals(div.textContent, "42"); +}, "outerHTML and string conversion: number.") + +test(function() { + var div = document.createElement("div"); + var p = div.appendChild(document.createElement("p")); + p.outerHTML = { + toString: function() { return "pass"; }, + valueOf: function() { return "fail"; } + }; + assert_equals(div.innerHTML, "pass"); + assert_equals(div.textContent, "pass"); +}, "outerHTML and string conversion: toString.") + +test(function() { + var div = document.createElement("div"); + var p = div.appendChild(document.createElement("p")); + p.outerHTML = { + toString: undefined, + valueOf: function() { return "pass"; } + }; + assert_equals(div.innerHTML, "pass"); + assert_equals(div.textContent, "pass"); +}, "outerHTML and string conversion: valueOf.") +</script> diff --git a/tests/wpt/web-platform-tests/domparsing/xml-serialization.xhtml b/tests/wpt/web-platform-tests/domparsing/xml-serialization.xhtml new file mode 100644 index 00000000000..678523d1e9d --- /dev/null +++ b/tests/wpt/web-platform-tests/domparsing/xml-serialization.xhtml @@ -0,0 +1,91 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>XML serialization</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="log"></div> +<script><![CDATA[ +function serialize(node) { + var serializer = new XMLSerializer(); + return serializer.serializeToString(node); +} + +test(function() { + var dt = document.createComment("--"); + assert_equals(serialize(dt), '<!------>'); +}, "Comment: containing --"); + +test(function() { + var dt = document.createComment("- x"); + assert_equals(serialize(dt), '<!--- x-->'); +}, "Comment: starting with -"); + +test(function() { + var dt = document.createComment("x -"); + assert_equals(serialize(dt), '<!--x --->'); +}, "Comment: ending with -"); + +test(function() { + var dt = document.createComment("-->"); + assert_equals(serialize(dt), '<!---->-->'); +}, "Comment: containing -->"); + +test(function() { + var dt = document.implementation.createDocumentType("html", "", ""); + assert_equals(serialize(dt), '<!DOCTYPE html>'); +}, "DocumentType: empty public and system id"); + +test(function() { + var dt = document.implementation.createDocumentType("html", "a", ""); + assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC "a">'); +}, "DocumentType: empty system id"); + +test(function() { + var dt = document.implementation.createDocumentType("html", "", "a"); + assert_equals(serialize(dt), '<!DOCTYPE html SYSTEM "a">'); +}, "DocumentType: empty public id"); + +test(function() { + var dt = document.implementation.createDocumentType("html", "a", "b"); + assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC "a" "b">'); +}, "DocumentType: non-empty public and system id"); + +test(function() { + var dt = document.implementation.createDocumentType("html", "'", "'"); + assert_equals(serialize(dt), "<!DOCTYPE html PUBLIC \"'\" \"'\">"); +}, "DocumentType: 'APOSTROPHE' (U+0027)"); + +test(function() { + var dt = document.implementation.createDocumentType("html", '"', '"'); + assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC """ """>'); +}, "DocumentType: 'QUOTATION MARK' (U+0022)"); + +test(function() { + var dt = document.implementation.createDocumentType("html", '"\'', '\'"'); + assert_equals(serialize(dt), '<!DOCTYPE html PUBLIC ""\'" "\'"">'); +}, "DocumentType: 'APOSTROPHE' (U+0027) and 'QUOTATION MARK' (U+0022)"); + +test(function() { + var pi = document.createProcessingInstruction("a", ""); + assert_equals(serialize(pi), "<?a ?>"); +}, "ProcessingInstruction: empty data"); + +test(function() { + var pi = document.createProcessingInstruction("a", "b"); + assert_equals(serialize(pi), "<?a b?>"); +}, "ProcessingInstruction: non-empty data"); + +test(function() { + var pi = document.createProcessingInstruction("xml", "b"); + assert_equals(serialize(pi), "<?xml b?>"); +}, "ProcessingInstruction: target contains xml"); + +test(function() { + var pi = document.createProcessingInstruction("x:y", "b"); + assert_equals(serialize(pi), "<?x:y b?>"); +}, "ProcessingInstruction: target contains a 'COLON' (U+003A)"); +]]></script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/fetch/api/request/request-init-001.sub.html b/tests/wpt/web-platform-tests/fetch/api/request/request-init-001.sub.html index 92206b45128..b41f6f0fe71 100644 --- a/tests/wpt/web-platform-tests/fetch/api/request/request-init-001.sub.html +++ b/tests/wpt/web-platform-tests/fetch/api/request/request-init-001.sub.html @@ -29,14 +29,14 @@ var referrerPolicies = {"givenValues" : [ "", "no-referrer", "no-referrer-when-downgrade", - "origin-only", + "origin", "origin-when-cross-origin", "unsafe-url" ], "expectedValues" : ["", "no-referrer", "no-referrer-when-downgrade", - "origin-only", + "origin", "origin-when-cross-origin", "unsafe-url" ] diff --git a/tests/wpt/web-platform-tests/fetch/api/request/request-init-003.sub.html b/tests/wpt/web-platform-tests/fetch/api/request/request-init-003.sub.html index 41bafebb18d..12181a21970 100644 --- a/tests/wpt/web-platform-tests/fetch/api/request/request-init-003.sub.html +++ b/tests/wpt/web-platform-tests/fetch/api/request/request-init-003.sub.html @@ -17,7 +17,7 @@ var initValuesDict = {"method" : "POST", "referrer" : "http://{{host}}:{{ports[http][0]}}/", - "referrerPolicy" : "origin-only", + "referrerPolicy" : "origin", "mode" : "same-origin", "credentials" : "include", "cache" : "no-cache", @@ -29,7 +29,7 @@ var expectedInitialized = {"method" : "POST", "referrer" : "http://{{host}}:{{ports[http][0]}}/", - "referrerPolicy" : "origin-only", + "referrerPolicy" : "origin", "mode" : "same-origin", "credentials" : "include", "cache" : "no-cache", diff --git a/tests/wpt/web-platform-tests/hr-time/basic.html b/tests/wpt/web-platform-tests/hr-time/basic.html index a10548fc94a..cc26d242f96 100644 --- a/tests/wpt/web-platform-tests/hr-time/basic.html +++ b/tests/wpt/web-platform-tests/hr-time/basic.html @@ -28,12 +28,12 @@ async_test(function() { // Check whether the performance.now() method is close to Date() within 30ms (due to inaccuracies) var initial_hrt = performance.now(); var initial_date = Date.now(); - setTimeout(this.step_func(function() { + this.step_timeout(function() { var final_hrt = performance.now(); var final_date = Date.now(); assert_approx_equals(final_hrt - initial_hrt, final_date - initial_date, 30, 'High resolution time value increased by approximately the same amount as time from date object'); this.done(); - }), 2000); + }, 2000); }, 'High resolution time has approximately the right relative magnitude'); </script> </head> diff --git a/tests/wpt/web-platform-tests/hr-time/test_cross_frame_start.html b/tests/wpt/web-platform-tests/hr-time/test_cross_frame_start.html index 4633a73843e..30e804bd735 100644 --- a/tests/wpt/web-platform-tests/hr-time/test_cross_frame_start.html +++ b/tests/wpt/web-platform-tests/hr-time/test_cross_frame_start.html @@ -12,13 +12,16 @@ <script type="text/javascript"> setup({explicit_done: true}); + var setup_frame = async_test("Setup the frame"); + function start_test() { - setTimeout(function() { + setup_frame.step_timeout(function () { var iframe = document.createElement('iframe'); iframe.id = 'frameContext'; iframe.onload = finish_test; iframe.src = "resources/now_frame.html"; document.body.appendChild(iframe); + setup_frame.done(); }, 1000); } diff --git a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html index fcb7288c8f8..ace09e57454 100644 --- a/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html +++ b/tests/wpt/web-platform-tests/html/browsers/browsing-the-web/history-traversal/PopStateEvent.html @@ -6,9 +6,9 @@ <div id="log"></div> <script> test(function () { - assert_throws('NotSupportedError', function() { - document.createEvent('PopStateEvent'); - }, 'document.createEvent("PopStateEvent") should not be supported'); + var e = document.createEvent('PopStateEvent'); + var eProto = Object.getPrototypeOf(e); + assert_equals(eProto, PopStateEvent.prototype); }, 'document.createEvent'); test(function () { diff --git a/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html new file mode 100644 index 00000000000..f72ed1eaf26 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html @@ -0,0 +1,197 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + + <title>Location objects' custom [[GetPrototypeOf]] trap permit [[Prototype]] chain cycles to be created through them</title> + + <link rel="author" title="Jeff Walden" href="http://whereswalden.com/" /> + <link rel="help" href="https://tc39.github.io/ecma262/#sec-ordinarysetprototypeof" /> + <link rel="help" href="https://html.spec.whatwg.org/multipage/browsers.html#location-getprototypeof" /> + + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="log"></div> + +<hr /> + +<iframe id="same-origin-different-window"></iframe> +<iframe id="cross-origin-joined-via-document-domain"></iframe> + +<script> +"use strict"; + +// Handle same-origin, same-window testing first, before any async-requiring +// testing. +test(function() { + var LocationPrototype = Location.prototype; + var ObjectPrototype = Object.prototype; + + var loc = window.location; + + var locProto = Object.getPrototypeOf(loc); + assert_equals(locProto, LocationPrototype, + "loc's initial [[Prototype]]"); + + var originalLocProtoProto = Object.getPrototypeOf(locProto); + assert_equals(originalLocProtoProto, ObjectPrototype, + "Location.prototype's initial [[Prototype]]"); + + Object.setPrototypeOf(locProto, loc); + + assert_equals(Object.getPrototypeOf(locProto), loc, + "LocationPrototype's new [[Prototype]]"); + assert_equals(Object.getPrototypeOf(loc), locProto, + "loc's new [[Prototype]]"); + + // Reset so as not to muck with testharness.js expectations. + Object.setPrototypeOf(locProto, originalLocProtoProto); +}, "same-origin, same-window location cycle"); + +var pathdir = + location.pathname.substring(0, location.pathname.lastIndexOf('/') + 1); + +var triggerCrossOriginTest = (function() { + var crossOrigin = + document.getElementById("cross-origin-joined-via-document-domain"); + + var t = async_test("cross-origin location has null prototype"); + + return new Promise(function(resolve, reject) { + crossOrigin.onload = t.step_func_done(function(e) { + try { + var win = crossOrigin.contentWindow; + + var loc = win.location; + + // Between un-opted-in windows, location objects appear to have null + // [[Prototype]]. + assert_equals(Object.getPrototypeOf(loc), null, + "cross-origin unjoined location's [[Prototype]"); + + resolve(); + } catch (e) { + reject(e); + throw e; + } + }); + + crossOrigin.src = + "//{{domains[www]}}:" + location.port + pathdir + "cross_origin_joined_frame.sub.html"; + }) + .catch(t.unreached_func("crossOrigin onload/src setting")); +})(); + +var triggerSameOriginTest = (function() { + var sameOriginDifferentWindow = + document.getElementById("same-origin-different-window"); + + var t = async_test("same-origin, different-window location cycle"); + + return new Promise(function(resolve, reject) { + sameOriginDifferentWindow.onload = t.step_func_done(function() { + try { + var win = sameOriginDifferentWindow.contentWindow; + + var loc = win.location; + var LocationPrototype = win.Location.prototype; + var ObjectPrototype = win.Object.prototype; + + var locProto = Object.getPrototypeOf(loc); + assert_equals(locProto, LocationPrototype, + "loc's initial [[Prototype]]"); + + var originalLocProtoProto = Object.getPrototypeOf(locProto); + assert_equals(originalLocProtoProto, ObjectPrototype, + "Location.prototype's initial [[Prototype]]"); + + Object.setPrototypeOf(locProto, loc); + + assert_equals(Object.getPrototypeOf(locProto), loc, + "LocationPrototype's new [[Prototype]]"); + assert_equals(Object.getPrototypeOf(loc), locProto, + "loc's new [[Prototype]]"); + + // Reset so as not to muck with testharness.js expectations. + Object.setPrototypeOf(locProto, originalLocProtoProto); + + resolve(); + } catch (e) { + reject(e); + throw e; + } + }); + + sameOriginDifferentWindow.src = "same_origin_frame.html"; + }) + .catch(t.unreached_func("sameOriginDifferentWindow onload/src setting")); +})(); + +function crossOriginJoinTest() { + var win = + document.getElementById("cross-origin-joined-via-document-domain") + .contentWindow; + + assert_equals(document.domain, "{{host}}"); + + var loc = win.location; + + var threw = false; + try { + // Still cross-origin until the document.domain set below. + win.Location; + } catch (e) { + threw = true; + } + + assert_equals(threw, true, + "accessing win.Location before joining win's origin"); + + // Join with other frames that have set |document.domain| to this same + // value -- namely, this cross-origin frame. Now access between the two + // windows should be permitted. + assert_equals(document.domain, "{{host}}", + "initial document.domain sanity check"); + document.domain = "{{host}}"; + + var LocationPrototype = win.Location.prototype; + var ObjectPrototype = win.Object.prototype; + + var locProto = Object.getPrototypeOf(loc); + assert_equals(locProto, LocationPrototype, + "loc's initial [[Prototype]]"); + + var originalLocProtoProto = Object.getPrototypeOf(locProto); + assert_equals(originalLocProtoProto, ObjectPrototype, + "Location.prototype's initial [[Prototype]]"); + + Object.setPrototypeOf(locProto, loc); + + assert_equals(Object.getPrototypeOf(locProto), loc, + "LocationPrototype's new [[Prototype]]"); + assert_equals(Object.getPrototypeOf(loc), locProto, + "loc's new [[Prototype]]"); + + // Reset so as not to muck with testharness.js expectations. + Object.setPrototypeOf(locProto, originalLocProtoProto); +} + +function run() { + var t = + async_test("cross-origin, but joined via document.domain, location cycle"); + + // The cross-origin/joined case must be tested after both unjoined same-origin + // and unjoined cross-origin tests: by mucking with document.domain, the + // cross-origin/joined case makes it impossible to perform those tests. + t.step(function() { + Promise.all([triggerCrossOriginTest, triggerSameOriginTest]) + .then(t.step_func_done(crossOriginJoinTest), + t.unreached_func("cross-origin joined error case")); + }); +} +run(); +</script> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html new file mode 100644 index 00000000000..a3ffdd005af --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/cross_origin_joined_frame.sub.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + <title>Cross-origin subframe for Location cyclic [[Prototype]] test</title> + <link rel="author" title="Jeff Walden" href="http://whereswalden.com/" /> +</head> +<body> +<script> +document.domain = "{{host}}"; +</script> +<!-- this should be accessible to the parent once it sets document.domain --> +<p>Cross-origin iframe with joined <code>document.domain</code></p> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/same_origin_frame.html b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/same_origin_frame.html new file mode 100644 index 00000000000..953e696b2ab --- /dev/null +++ b/tests/wpt/web-platform-tests/html/browsers/history/the-location-interface/same_origin_frame.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + <title>Same-origin subframe for Location cyclic [[Prototype]] test</title> + <link rel="author" title="Jeff Walden" href="http://whereswalden.com/" /> +</head> +<body> +<!-- nothing to do, this window should be accessible to the parent frame --> +<p>Same-origin iframe</p> +</body> +</html> diff --git a/tests/wpt/web-platform-tests/html/dom/interfaces.html b/tests/wpt/web-platform-tests/html/dom/interfaces.html index b0120c05634..9886e7538f4 100644 --- a/tests/wpt/web-platform-tests/html/dom/interfaces.html +++ b/tests/wpt/web-platform-tests/html/dom/interfaces.html @@ -3215,7 +3215,11 @@ window.onload = function() { HTMLHeadingElement: ['document.createElement("h1")'], HTMLParagraphElement: ['document.createElement("p")'], HTMLHRElement: ['document.createElement("hr")'], - HTMLPreElement: ['document.createElement("pre")'], + HTMLPreElement: [ + 'document.createElement("pre")', + 'document.createElement("listing")', + 'document.createElement("xmp")', + ], HTMLQuoteElement: [ 'document.createElement("blockquote")', 'document.createElement("q")', diff --git a/tests/wpt/web-platform-tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html b/tests/wpt/web-platform-tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html index 8e2fbe7b002..38364cd3e65 100644 --- a/tests/wpt/web-platform-tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html +++ b/tests/wpt/web-platform-tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-color-01.html @@ -8,11 +8,46 @@ <div id="log"></div> <script> test(function() { - document.documentElement.removeChild(document.body); + document.fgColor = "green"; + document.bgColor = "green"; + document.linkColor = "green"; + document.vlinkColor = "green"; + document.alinkColor = "green"; + + var body = document.documentElement.removeChild(document.body); + + // When there is no body element, the color attributes return an + // empty string upon getting. assert_equals(document.fgColor, ""); assert_equals(document.bgColor, ""); assert_equals(document.linkColor, ""); assert_equals(document.vlinkColor, ""); assert_equals(document.alinkColor, ""); -}) + + // Re-add body and reset color attributes. + document.body = body; + document.fgColor = ""; + document.bgColor = ""; + document.linkColor = ""; + document.vlinkColor = ""; + document.alinkColor = ""; +}, "getting document color attributes with no body"); + +test(function() { + var body = document.documentElement.removeChild(document.body); + + // When there is no body element, setting the color attributes has no effect. + document.fgColor = "red"; + document.bgColor = "red"; + document.linkColor = "red"; + document.vlinkColor = "red"; + document.alinkColor = "red"; + assert_equals(document.fgColor, ""); + assert_equals(document.bgColor, ""); + assert_equals(document.linkColor, ""); + assert_equals(document.vlinkColor, ""); + assert_equals(document.alinkColor, ""); + + document.body = body; +}, "setting document color attributes with no body"); </script> diff --git a/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html new file mode 100644 index 00000000000..54c4794549a --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_about_blank.html @@ -0,0 +1,19 @@ +<!doctype html> +<meta charset=utf-8> +<title>base element in about:blank document should resolve against its fallback base URI</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<iframe></iframe> +<script> +var t = async_test(); +addEventListener("load", t.step_func_done(function() { + var doc = frames[0].document; + var b = doc.createElement("base"); + b.setAttribute("href", "test"); + var newBaseValue = location.href.replace(/\/[^/]*$/, "/") + "test"; + assert_equals(b.href, newBaseValue); + assert_equals(doc.baseURI, location.href); + doc.head.appendChild(b); + assert_equals(doc.baseURI, newBaseValue); +})); +</script> diff --git a/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html new file mode 100644 index 00000000000..6d12d29e8a9 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_href_invalid.html @@ -0,0 +1,12 @@ +<!doctype html> +<meta charset=utf-8> +<title>base element with unparseable href should have .href getter return attr value</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<script> +test(function() { + var b = document.createElement("base"); + b.setAttribute("href", "//test:test"); + assert_equals(b.href, "//test:test"); +}); +</script> diff --git a/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html new file mode 100644 index 00000000000..eea1efe51d3 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-base-element/base_srcdoc.html @@ -0,0 +1,19 @@ +<!doctype html> +<meta charset=utf-8> +<title>base element in srcdoc document should resolve against its fallback base URI</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<iframe srcdoc=""></iframe> +<script> +var t = async_test(); +addEventListener("load", t.step_func_done(function() { + var doc = frames[0].document; + var b = doc.createElement("base"); + b.setAttribute("href", "test"); + var newBaseValue = location.href.replace(/\/[^/]*$/, "/") + "test"; + assert_equals(b.href, newBaseValue); + assert_equals(doc.baseURI, location.href); + doc.head.appendChild(b); + assert_equals(doc.baseURI, newBaseValue); +})); +</script> diff --git a/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-link-element/link-rellist.html b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-link-element/link-rellist.html index 8d11f1e5ccc..41496519514 100644 --- a/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-link-element/link-rellist.html +++ b/tests/wpt/web-platform-tests/html/semantics/document-metadata/the-link-element/link-rellist.html @@ -19,5 +19,7 @@ test(function() { assert_equals(list.contains(NaN), true); //"NaN" assert_equals(list.contains(+Infinity), true); //"Infinity" assert_equals(list.contains(-Infinity), false); //"-Infinity" + assert_equals(list.supports("stylesheet"), true); + assert_equals(list.supports("nosuchrelvalueever"), false); }); </script> diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html index 4f1ba31e160..78c3bff51a2 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLTrackElement/kind.html @@ -13,7 +13,7 @@ test(function(){ test(function(){ var track = document.createElement('track'); track.setAttribute('kind', 'invalid'); - assert_equals(track.kind, 'subtitles'); + assert_equals(track.kind, 'metadata'); assert_equals(track.getAttribute('kind'), 'invalid'); }, document.title + ' invalid value in content attribute'); @@ -27,14 +27,14 @@ test(function(){ test(function(){ var track = document.createElement('track'); track.setAttribute('kind', 'CAPT\u0130ONS'); - assert_equals(track.kind, 'subtitles'); + assert_equals(track.kind, 'metadata'); assert_equals(track.getAttribute('kind'), 'CAPT\u0130ONS'); }, document.title + ' content attribute with uppercase turkish I (with dot)'); test(function(){ var track = document.createElement('track'); track.setAttribute('kind', 'capt\u0131ons'); - assert_equals(track.kind, 'subtitles'); + assert_equals(track.kind, 'metadata'); assert_equals(track.getAttribute('kind'), 'capt\u0131ons'); }, document.title + ' content attribute with lowercase turkish i (dotless)'); @@ -76,7 +76,7 @@ test(function(){ test(function(){ var track = document.createElement('track'); track.setAttribute('kind', 'captions\u0000'); - assert_equals(track.kind, 'subtitles'); + assert_equals(track.kind, 'metadata'); assert_equals(track.getAttribute('kind'), 'captions\u0000'); }, document.title + ' content attribute "captions\\u0000"'); @@ -126,21 +126,21 @@ test(function(){ var track = document.createElement('track'); track.kind = 'CAPT\u0130ONS'; assert_equals(track.getAttribute('kind'), 'CAPT\u0130ONS'); - assert_equals(track.kind, 'subtitles'); + assert_equals(track.kind, 'metadata'); }, document.title + ' setting IDL attribute with uppercase turkish I (with dot)'); test(function(){ var track = document.createElement('track'); track.kind = 'capt\u0131ons'; assert_equals(track.getAttribute('kind'), 'capt\u0131ons'); - assert_equals(track.kind, 'subtitles'); + assert_equals(track.kind, 'metadata'); }, document.title + ' setting IDL attribute with lowercase turkish I (dotless)'); test(function(){ var track = document.createElement('track'); track.kind = 'captions\u0000'; assert_equals(track.getAttribute('kind'), 'captions\u0000'); - assert_equals(track.kind, 'subtitles'); + assert_equals(track.kind, 'metadata'); }, document.title + ' setting IDL attribute with \\u0000'); </script> diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html index d91373d860b..d5dbc8342c0 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/kind.html @@ -26,6 +26,6 @@ test(function(){ test(function(){ var track = document.createElement('track'); track.kind = 'captions\u0000'; - assert_equals(track.track.kind, 'subtitles'); + assert_equals(track.track.kind, 'metadata'); }, document.title+', \\u0000'); </script> diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html new file mode 100644 index 00000000000..d245bf0b964 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html @@ -0,0 +1,48 @@ +<!doctype html> +<meta charset=utf-8> +<title>Test some sanity behavior around iframe load/error events</title> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<body> +<script> +async_test(function(t) { + var obj = document.createElement("iframe"); + obj.onload = t.step_func_done(function(e){ + assert_true(obj.contentWindow instanceof Window, "The iframe element should represent a nested browsing context.") + assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface."); + assert_true(e.isTrusted, "The load event should be a trusted event."); + assert_false(e.cancelable, "The load event should not be a cancelable event."); + assert_false(e.bubbles, "The load event should not be a bubble event."); + assert_equals(e.target, obj, "The load event target should be the corresponding object element."); + }); + + obj.onerror = t.step_func_done(function(e){ + assert_unreached("The error event should not be fired."); + }); + + var url = URL.createObjectURL(new Blob([""], { type: "text/html" })); + + obj.src = url; + document.body.appendChild(obj); +}, "load event of blob URL"); + +async_test(function(t) { + var obj = document.createElement("iframe"); + obj.onload = t.step_func_done(function(e){ + assert_true(obj.contentWindow instanceof Window, "The object element should represent a nested browsing context.") + assert_equals(Object.getPrototypeOf(e).constructor, Event, "The load event should use the Event interface."); + assert_true(e.isTrusted, "The load event should be a trusted event."); + assert_false(e.cancelable, "The load event should not be a cancelable event."); + assert_false(e.bubbles, "The load event should not be a bubble event."); + assert_equals(e.target, obj, "The load event target should be the corresponding object element."); + }); + + obj.onerror = t.step_func_done(function(e){ + assert_unreached("The error event should not be fired."); + }); + + document.body.appendChild(obj); +}, "load event of initial about:blank"); + +</script> +</body> diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html index a30ae6e89ad..c8e09e8d0b8 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html @@ -89,8 +89,15 @@ <img src="/images/green-2x2.png" data-desc="inserted/removed children of img"> -<picture><img src="/images/green-2x2.png" data-desc="picture is inserted"></picture><span></span> -<picture><img src="/images/green-2x2.png" data-desc="picture is removed"></picture> +<picture><img src="/images/green-2x2.png" data-desc="picture is inserted; img has src"></picture><span></span> +<picture><img srcset="/images/green-2x2.png" data-desc="picture is inserted; img has srcset"></picture><span></span> +<picture><source srcset="/images/green-2x2.png"><img src="/images/green-2x2.png" data-desc="picture is inserted; img has previous sibling source"></picture><span></span> +<picture><img src="/images/green-2x2.png" data-desc="picture is inserted; img has following sibling source"><source srcset="/images/green-2x2.png"></picture><span></span> + +<picture><img src="/images/green-2x2.png" data-desc="picture is removed; img has src"></picture> +<picture><img srcset="/images/green-2x2.png" data-desc="picture is removed; img has srcset"></picture> +<picture><source srcset="/images/green-2x2.png"><img src="/images/green-2x2.png" data-desc="picture is removed; img has previous sibling source"></picture> +<picture><img src="/images/green-2x2.png" data-desc="picture is removed; img has following sibling source"><source srcset="/images/green-2x2.png"></picture> <picture><img src="/images/green-2x2.png" data-desc="parent is picture, following img inserted"></picture> <picture><img src="/images/green-2x2.png" data-desc="parent is picture, following img removed"><img></picture> @@ -352,11 +359,35 @@ onload = function() { }), 0); }, 'timeout'); - t('picture is inserted', function(img) { + t('picture is inserted; img has src', function(img) { + img.parentNode.nextSibling.appendChild(img.parentNode); + }, 'timeout'); + + t('picture is inserted; img has srcset', function(img) { + img.parentNode.nextSibling.appendChild(img.parentNode); + }, 'timeout'); + + t('picture is inserted; img has previous sibling source', function(img) { + img.parentNode.nextSibling.appendChild(img.parentNode); + }, 'timeout'); + + t('picture is inserted; img has following sibling source', function(img) { img.parentNode.nextSibling.appendChild(img.parentNode); }, 'timeout'); - t('picture is removed', function(img) { + t('picture is removed; img has src', function(img) { + img.parentNode.parentNode.removeChild(img.parentNode); + }, 'timeout'); + + t('picture is removed; img has srcset', function(img) { + img.parentNode.parentNode.removeChild(img.parentNode); + }, 'timeout'); + + t('picture is removed; img has previous sibling source', function(img) { + img.parentNode.parentNode.removeChild(img.parentNode); + }, 'timeout'); + + t('picture is removed; img has following sibling source', function(img) { img.parentNode.parentNode.removeChild(img.parentNode); }, 'timeout'); diff --git a/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/checkbox.html b/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/checkbox.html index 0c07fdd4a40..4efe83b52a5 100644 --- a/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/checkbox.html +++ b/tests/wpt/web-platform-tests/html/semantics/forms/the-input-element/checkbox.html @@ -40,7 +40,7 @@ assert_true(c1_click_fired, "input event should fire after click event"); assert_false(c1_change_fired, "input event should fire before change event"); assert_true(e.bubbles, "event should bubble"); - assert_false(e.isTrusted, "click()-initiated event should not be trusted"); + assert_true(e.isTrusted, "click()-initiated event should be trusted"); assert_false(e.cancelable, "event should not be cancelable"); assert_true(checkbox1.checked, "checkbox is checked"); assert_false(checkbox1.indeterminate, "checkbox is not indeterminate"); @@ -51,7 +51,7 @@ assert_true(c1_click_fired, "change event should fire after click event"); assert_true(c1_input_fired, "change event should fire after input event"); assert_true(e.bubbles, "event should bubble") - assert_false(e.isTrusted, "click()-initiated event should not be trusted"); + assert_true(e.isTrusted, "click()-initiated event should be trusted"); assert_false(e.cancelable, "event should not be cancelable"); assert_true(checkbox1.checked, "checkbox is checked"); assert_false(checkbox1.indeterminate, "checkbox is not indeterminate"); diff --git a/tests/wpt/web-platform-tests/html/syntax/serializing-html-fragments/serializing.html b/tests/wpt/web-platform-tests/html/syntax/serializing-html-fragments/serializing.html new file mode 100644 index 00000000000..8303901f652 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/syntax/serializing-html-fragments/serializing.html @@ -0,0 +1,332 @@ +<!DOCTYPE html> +<title>innerHTML in HTML</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> + +<!-- test elments. Each has an expected innerHTML and outerHTML in an array in the <script>--> +<div id="test" style="display:none"> +<span></span> +<span><a></a></span> +<span><a b=c></a></span> +<span><a b='c'></a></span> +<span><a b='&'></a></span> +<span><a b=' '></a></span> +<span><a b='"'></a></span> +<span><a b="<"></a></span> +<span><a b=">"></a></span> +<span><svg xlink:href="a"></svg></span> +<span><svg xmlns:svg="test"></svg></span> +<span>a</span> +<span>&</span> +<span> </span> +<span><</span> +<span>></span> +<span>"</span> +<span><style><&></style></span> +<span><script type="test"><&></script></span> +<span><xmp><&></xmp></span> +<span><iframe><&></iframe></span> +<span><noembed><&></noembed></span> +<span><noframes><&></noframes></span> +<span><noscript><&></noscript></span> +<span><!--data--></span> +<span><a><b><c></c></b><d>e</d><f><g>h</g></f></a></span> +<span b=c></span> +</div> +<!-- TODO: template element --> +<script> + +var test_data = document.getElementById("test").getElementsByTagName("span"); +var expected = [ +["", "<span></span>"], +["<a></a>", "<span><a></a></span>"], +["<a b=\"c\"></a>", "<span><a b=\"c\"></a></span>"], +["<a b=\"c\"></a>", "<span><a b=\"c\"></a></span>"], +["<a b=\"&\"></a>", "<span><a b=\"&\"></a></span>"], +["<a b=\" \"></a>", "<span><a b=\" \"></a></span>"], +["<a b=\""\"></a>", "<span><a b=\""\"></a></span>"], +["<a b=\"<\"></a>", "<span><a b=\"<\"></a></span>"], +["<a b=\">\"></a>", "<span><a b=\">\"></a></span>"], +["<svg xlink:href=\"a\"></svg>", "<span><svg xlink:href=\"a\"></svg></span>"], +["<svg xmlns:svg=\"test\"></svg>", "<span><svg xmlns:svg=\"test\"></svg></span>"], +["a", "<span>a</span>"], +["&", "<span>&</span>"], +[" ", "<span> </span>"], +["<", "<span><</span>"], +[">", "<span>></span>"], +["\"", "<span>\"</span>"], +["<style><&></style>", "<span><style><&></style></span>"], +["<script type=\"test\"><&><\/script>", "<span><script type=\"test\"><&><\/script></span>"], +["<xmp><&></xmp>", "<span><xmp><&></xmp></span>"], +["<iframe><&></iframe>", "<span><iframe><&></iframe></span>"], +["<noembed><&></noembed>", "<span><noembed><&></noembed></span>"], +["<noframes><&></noframes>", "<span><noframes><&></noframes></span>"], +["<noscript><&></noscript>", "<span><noscript><&></noscript></span>"], +["<!--data-->", "<span><!--data--></span>"], +["<a><b><c></c></b><d>e</d><f><g>h</g></f></a>", "<span><a><b><c></c></b><d>e</d><f><g>h</g></f></a></span>"], +["", "<span b=\"c\"></span>"] +]; + +var dom_tests = [ + ["Attribute in the XML namespace", + function() { + var span = document.createElement("span"); + var svg = document.createElement("svg"); + svg.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:foo", "test"); + span.appendChild(svg); + return span; + }, + '<svg xml:foo="test"></svg>', + '<span><svg xml:foo="test"></svg></span>'], + + ["Attribute in the XML namespace with the prefix not set to xml:", + function() { + var span = document.createElement("span"); + var svg = document.createElement("svg"); + svg.setAttributeNS("http://www.w3.org/XML/1998/namespace", "abc:foo", "test"); + span.appendChild(svg); + return span; + }, + '<svg xml:foo="test"></svg>', + '<span><svg xml:foo="test"></svg></span>'], + + ["Non-'xmlns' attribute in the xmlns namespace", + function() { + var span = document.createElement("span"); + var svg = document.createElement("svg"); + svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:foo", "test") + span.appendChild(svg); + return span; + }, + '<svg xmlns:foo="test"></svg>', + '<span><svg xmlns:foo="test"></svg></span>'], + + ["'xmlns' attribute in the xmlns namespace", + function() { + var span = document.createElement("span"); + var svg = document.createElement("svg"); + svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "test") + span.appendChild(svg); + return span; + }, + '<svg xmlns="test"></svg>', + '<span><svg xmlns="test"></svg></span>'], + + ["Attribute in non-standard namespace", + function() { + var span = document.createElement("span"); + var svg = document.createElement("svg"); + svg.setAttributeNS("fake_ns", "abc:def", "test") + span.appendChild(svg); + return span; + }, + '<svg abc:def="test"></svg>', + '<span><svg abc:def="test"></svg></span>'], + + ["<span> starting with U+000A", + function() { + var elem = document.createElement("span"); + elem.appendChild(document.createTextNode("\x0A")); + return elem; + }, + "\x0A", + "<span>\x0A</span>"], + + //TODO: Processing instructions +] + +var text_elements = ["pre", "textarea", "listing"]; + +var text_tests = [ + ["<%text> context starting with U+000A", + function(elem) { + elem.appendChild(document.createTextNode("\x0A")); + return elem; + }, + "\x0A", + "<%text>\x0A\x0A</%text>"], + + ["<%text> context not starting with U+000A", + function(elem) { + elem.appendChild(document.createTextNode("a\x0A")); + return elem; + }, + "a\x0A", + "<%text>a\x0A</%text>"], + + ["<%text> non-context starting with U+000A", + function(elem) { + var span = document.createElement("span"); + elem.appendChild(document.createTextNode("\x0A")); + span.appendChild(elem); + return span; + }, + "<%text>\x0A\x0A</%text>", + "<span><%text>\x0A\x0A</%text></span>"], + + ["<%text> non-context not starting with U+000A", + function(elem) { + var span = document.createElement("span"); + elem.appendChild(document.createTextNode("a\x0A")); + span.appendChild(elem); + return span; + }, + "<%text>a\x0A</%text>", + "<span><%text>a\x0A</%text></span>"], +] + +var void_elements = [ + "area", "base", "basefont", "bgsound", "br", "col", "embed", + "frame", "hr", "img", "input", "keygen", "link", "menuitem", + "meta", "param", "source", "track", "wbr" +]; + +var void_tests = [ + ["Void context node", + function (void_elem) { + return void_elem; + }, + "", + "<%void>" + ], + ["void as first child with following siblings", + function (void_elem) { + var span = document.createElement("span"); + span.appendChild(void_elem); + span.appendChild(document.createElement("a")).appendChild(document.createTextNode("test")); + span.appendChild(document.createElement("b")) + return span + }, + "<%void><a>test</a><b></b>", + "<span><%void><a>test</a><b></b></span>" + ], + ["void as second child with following siblings", + function (void_elem) { + var span = document.createElement("span"); + span.appendChild(document.createElement("a")).appendChild(document.createTextNode("test")); + span.appendChild(void_elem); + span.appendChild(document.createElement("b")) + return span; + }, + "<a>test</a><%void><b></b>", + "<span><a>test</a><%void><b></b></span>" + ], + ["void as last child with preceding siblings", + function (void_elem) { + var span = document.createElement("span"); + span.appendChild(document.createElement("a")).appendChild(document.createTextNode("test")); + span.appendChild(document.createElement("b")) + span.appendChild(void_elem); + return span; + }, + "<a>test</a><b></b><%void>", + "<span><a>test</a><b></b><%void></span>" + ], +] + +function cross_map(a1, a2, f) { + var rv = []; + a1.forEach(function(a1_elem) { + a2.forEach(function(a2_elem) { + rv.push(f(a1_elem, a2_elem)); + }) + }); + return rv; +} + +function innerHTML_test(func, elem, expected) { + assert_equals(func(elem).innerHTML, expected); +} + +function outerHTML_test(func, elem, expected) { + assert_equals(func(elem).outerHTML, expected); +} + + +function make_void(name) { + var rv = document.createElement(name); + rv.appendChild(document.createElement("a")).appendChild(document.createComment("abc")) + rv.appendChild(document.createElement("b")). + appendChild(document.createElement("c")). + appendChild(document.createTextNode("abc")) + return rv; +} + +function make_text(name) { + return document.createElement(name); +} + +generate_tests(innerHTML_test, + expected.map(function(item, i) { + return ["innerHTML " + i + " " + expected[i][0], + function() {return test_data[i]}, + null, + item[0]]; + })) + +generate_tests(outerHTML_test, + expected.map(function(item, i) { + return ["outerHTML " + i + " " + expected[i][1], + function() {return test_data[i]}, + null, + item[1]]; + })) + +generate_tests(innerHTML_test, + dom_tests.map(function(item) { + return ["innerHTML " + item[0], + item[1], + null, + item[2]]; + })) + +generate_tests(outerHTML_test, + dom_tests.map(function(item) { + return ["outerHTML " + item[0], + item[1], + null, + item[3]]; + })) + +generate_tests(innerHTML_test, + cross_map(text_tests, text_elements, + function(test_data, elem_name) { + var rv = ["innerHTML " + test_data[0].replace("%text", elem_name, "g"), + test_data[1], + document.createElement(elem_name), + test_data[2].replace("%text", elem_name, "g")]; + return rv; + })) + +generate_tests(outerHTML_test, + cross_map(text_tests, text_elements, + function(test_data, elem_name) { + var rv = ["outerHTML " + test_data[0].replace("%text", elem_name, "g"), + test_data[1], + document.createElement(elem_name), + test_data[3].replace("%text", elem_name, "g")]; + return rv; + })) + +generate_tests(innerHTML_test, + cross_map(void_tests, void_elements, + function(test_data, elem_name) { + var rv = ["innerHTML " + test_data[0] + " " + elem_name, + test_data[1], + make_void(elem_name), + test_data[2].replace("%void", elem_name, "g")]; + return rv; + })) + +generate_tests(outerHTML_test, + cross_map(void_tests, void_elements, + function(test_data, elem_name) { + var rv = ["outerHTML " + test_data[0] + " " + elem_name, + test_data[1], + make_void(elem_name), + test_data[3].replace("%void", elem_name, "g")]; + return rv; + })) + +</script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/audio-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/audio-tag/top-level/no-redirect/allowed.https.html index 721e31d399a..a29157047a6 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/audio-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/audio-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: audio-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/fetch-request/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/fetch-request/top-level/no-redirect/allowed.https.html index e78f5493f91..825fb2441b4 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/fetch-request/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/fetch-request/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: fetch-request expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/form-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/form-tag/top-level/no-redirect/allowed.https.html index 7b8652238ff..8452988259b 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/form-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/form-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: form-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/iframe-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/iframe-tag/top-level/no-redirect/allowed.https.html index a3430f19368..148a6ec880d 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/iframe-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/iframe-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: iframe-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/img-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/img-tag/top-level/no-redirect/allowed.https.html index 46ece8f0caa..e4ac20f4f08 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/img-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/img-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: img-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-css-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-css-tag/top-level/no-redirect/allowed.https.html index 51d06274602..869c05abeca 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-css-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-css-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: link-css-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-prefetch-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-prefetch-tag/top-level/no-redirect/allowed.https.html index 3763052b387..71ef6d359d1 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-prefetch-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/link-prefetch-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: link-prefetch-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/object-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/object-tag/top-level/no-redirect/allowed.https.html index 7a5e5dfa350..662ac192a88 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/object-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/object-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: object-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/picture-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/picture-tag/top-level/no-redirect/allowed.https.html index c9885eb8577..0d846777fab 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/picture-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/picture-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: picture-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/script-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/script-tag/top-level/no-redirect/allowed.https.html index c0e7eb86796..0d0eec01c36 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/script-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/script-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: script-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/video-tag/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/video-tag/top-level/no-redirect/allowed.https.html index 2799f5af02f..cf84396315e 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/video-tag/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/video-tag/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: video-tag expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/worker-request/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/worker-request/top-level/no-redirect/allowed.https.html index 091bc03c161..e5bf5ce95a8 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/worker-request/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/worker-request/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: worker-request expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/xhr-request/top-level/no-redirect/allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/xhr-request/top-level/no-redirect/allowed.https.html index 4044ccec1fc..ebbc9ec0c67 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/xhr-request/top-level/no-redirect/allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-https/xhr-request/top-level/no-redirect/allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: xhr-request expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-wss/websocket-request/top-level/no-redirect/websocket-allowed.https.html b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-wss/websocket-request/top-level/no-redirect/websocket-allowed.https.html index 1967e45115c..f1cfed1984c 100644 --- a/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-wss/websocket-request/top-level/no-redirect/websocket-allowed.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/allowed/meta-csp/same-host-wss/websocket-request/top-level/no-redirect/websocket-allowed.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: websocket-request expectation: allowed"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html index ccc8e9b0b86..a1b37ef1ee7 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: fetch-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html index 147bd58578d..2ea8aadcaa3 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: form-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html index 84af99aca91..2aa9e013bb1 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: iframe-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html index bf9b606aed9..191b4a9ea66 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: link-css-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html index 128c08dcd6e..ee5cfea7192 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: object-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html index debd088dbb9..abe50087f63 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: picture-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html index 4872269168d..7e9a2395a3c 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: script-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html index b4bfdb8781c..63ba9045403 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: worker-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html index 39a44b4524f..cf95677c7f6 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: xhr-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html index 04a462d1302..1bc4b11d9a7 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/cross-origin-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: websocket-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html index 85be9eb2b7d..0fb506de19f 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/fetch-request/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: fetch-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html index f5a0bf5dc92..b5dcde734a4 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/form-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: form-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html index 6a70032ecdf..1fb7a9385a6 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/iframe-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: iframe-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html index 68b5ac7066c..5e71b99d4c6 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/link-css-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: link-css-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html index a71d608c404..28fdc6f0887 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/object-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: object-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html index b1cf804b339..9c484e398a2 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/picture-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: picture-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html index 05201512b34..44b4795c91e 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/script-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: script-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html index 599a5280f19..22e7c6eac28 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/worker-request/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: worker-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html index fd22ba37e55..80a633ab22f 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-http/xhr-request/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: xhr-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html index 1f887fb5870..a3cb304e034 100644 --- a/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/blockable/meta-csp/same-host-ws/websocket-request/top-level/no-redirect/ws-downgrade-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: websocket-request expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/generic/common.js b/tests/wpt/web-platform-tests/mixed-content/generic/common.js index 3881513b2f2..36427a4669f 100644 --- a/tests/wpt/web-platform-tests/mixed-content/generic/common.js +++ b/tests/wpt/web-platform-tests/mixed-content/generic/common.js @@ -107,11 +107,22 @@ function createElement(tagName, attrs, parent, doBindEvents) { // We set the attributes after binding to events to catch any // event-triggering attribute changes. E.g. form submission. - setAttributes(element, attrs); + // + // But be careful with images: unlike other elements they will start the load + // as soon as the attr is set, even if not in the document yet, and sometimes + // complete it synchronously, so the append doesn't have the effect we want. + // So for images, we want to set the attrs after appending, whereas for other + // elements we want to do it before appending. + var isImg = (tagName == "img"); + if (!isImg) + setAttributes(element, attrs); if (parent) parent.appendChild(element); + if (isImg) + setAttributes(element, attrs); + return element; } diff --git a/tests/wpt/web-platform-tests/mixed-content/generic/expect.py b/tests/wpt/web-platform-tests/mixed-content/generic/expect.py index e25f2f9f470..a3ea61b2139 100644 --- a/tests/wpt/web-platform-tests/mixed-content/generic/expect.py +++ b/tests/wpt/web-platform-tests/mixed-content/generic/expect.py @@ -70,20 +70,20 @@ def main(request, response): if content_type == "image/png": response_data = open(os.path.join(request.doc_root, "images", - "smiley.png")).read() + "smiley.png"), "rb").read() elif content_type == "audio/mpeg": response_data = open(os.path.join(request.doc_root, "media", - "sound_5.oga")).read() + "sound_5.oga"), "rb").read() elif content_type == "video/mp4": response_data = open(os.path.join(request.doc_root, "media", - "movie_5.mp4")).read() + "movie_5.mp4"), "rb").read() elif content_type == "application/javascript": response_data = open(os.path.join(request.doc_root, "mixed-content", "generic", - "worker.js")).read() + "worker.js"), "rb").read() else: response_data = "/* purged */" elif action == "take": diff --git a/tests/wpt/web-platform-tests/mixed-content/generic/template/test.release.html.template b/tests/wpt/web-platform-tests/mixed-content/generic/template/test.release.html.template index 45473ad5ff1..ca77389cc68 100644 --- a/tests/wpt/web-platform-tests/mixed-content/generic/template/test.release.html.template +++ b/tests/wpt/web-platform-tests/mixed-content/generic/template/test.release.html.template @@ -7,7 +7,7 @@ <meta name="description" content="%(spec_description)s"> <link rel="author" title="Kristijan Burnik" href="burnik@chromium.org"> <link rel="help" href="%(spec_specification_url)s"> - <meta name="assert" content="%(test_description)s"> + <meta name="assert" content="%(test_description)s">%(meta_opt_in)s <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/generic/tools/generate.py b/tests/wpt/web-platform-tests/mixed-content/generic/tools/generate.py index e27988b5734..6dcaebdc30d 100755 --- a/tests/wpt/web-platform-tests/mixed-content/generic/tools/generate.py +++ b/tests/wpt/web-platform-tests/mixed-content/generic/tools/generate.py @@ -89,7 +89,7 @@ def generate_selection(selection, spec, test_html_template_basename): opt_in_method = selection['opt_in_method'] selection['meta_opt_in'] = '' if opt_in_method == 'meta-csp': - selection['meta_opt_in'] = '<meta http-equiv="Content-Security-Policy" ' + \ + selection['meta_opt_in'] = '\n <meta http-equiv="Content-Security-Policy" ' + \ 'content="block-all-mixed-content">' elif opt_in_method == 'http-csp': opt_in_headers = "Content-Security-Policy: block-all-mixed-content\n" diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html index ddc860ba2fc..283c34207bf 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: audio-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html index 44fdb8b7aa1..684d2449a4e 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: img-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html index b5de46754dd..7f5cc295598 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: link-prefetch-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html index 2aebedc7857..a181ecd388a 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/cross-origin-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: video-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html index e066dd1e3e7..1c65507b4ce 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/audio-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: audio-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html index 0572c8079bc..b05dff3b33d 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/img-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: img-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html index 3b1d36af291..28003d9a1bd 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/link-prefetch-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: link-prefetch-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html index c78aa6b9942..05f1890c98d 100644 --- a/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html +++ b/tests/wpt/web-platform-tests/mixed-content/optionally-blockable/meta-csp/same-host-http/video-tag/top-level/no-redirect/opt-in-blocks.https.html @@ -14,6 +14,7 @@ redirection: no-redirect subresource: video-tag expectation: blocked"> + <meta http-equiv="Content-Security-Policy" content="block-all-mixed-content"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/mixed-content/generic/common.js"></script> diff --git a/tests/wpt/web-platform-tests/mixed-content/spec_json.js b/tests/wpt/web-platform-tests/mixed-content/spec_json.js index 11d3ac1c254..5de1b17e303 100644 --- a/tests/wpt/web-platform-tests/mixed-content/spec_json.js +++ b/tests/wpt/web-platform-tests/mixed-content/spec_json.js @@ -1 +1 @@ -var SPEC_JSON = {"test_expansion_schema": {"origin": ["same-host-https", "same-host-http", "cross-origin-https", "cross-origin-http"], "subresource": {"blockable": ["iframe-tag", "script-tag", "link-css-tag", "form-tag", "xhr-request", "worker-request", "fetch-request", "a-tag", "object-tag", "picture-tag", "websocket-request"], "optionally-blockable": ["img-tag", "audio-tag", "video-tag", "link-prefetch-tag"]}, "context_nesting": ["top-level", "sub-level"], "expectation": ["allowed", "blocked"], "expansion": ["default", "override"], "redirection": ["no-redirect", "keep-scheme-redirect", "swap-scheme-redirect"], "opt_in_method": ["no-opt-in", "http-csp", "meta-csp", "img-crossorigin"], "source_scheme": ["http", "https"]}, "specification": [{"test_expansion": [{"origin": ["cross-origin-http", "same-host-http"], "name": "opt-in-blocks", "redirection": "*", "expectation": "blocked", "expansion": "default", "context_nesting": "top-level", "opt_in_method": ["http-csp", "meta-csp"], "source_scheme": "https", "subresource": {"blockable": [], "optionally-blockable": "*"}}, {"origin": ["cross-origin-http", "same-host-http"], "name": "no-opt-in-allows", "redirection": "*", "expectation": "allowed", "expansion": "default", "context_nesting": "top-level", "opt_in_method": "no-opt-in", "source_scheme": "https", "subresource": {"blockable": [], "optionally-blockable": "*"}}], "description": "Test behavior of optionally-blockable content", "specification_url": "http://www.w3.org/TR/mixed-content/#category-optionally-blockable", "name": "optionally-blockable", "title": "Optionally-blockable content"}, {"test_expansion": [{"origin": ["cross-origin-http", "same-host-http"], "name": "opt-in-blocks", "redirection": "*", "expectation": "blocked", "expansion": "default", "context_nesting": "top-level", "opt_in_method": ["http-csp", "meta-csp"], "source_scheme": "https", "subresource": {"blockable": "*", "optionally-blockable": []}}, {"origin": ["cross-origin-http", "same-host-http"], "name": "no-opt-in-blocks", "redirection": "*", "expectation": "blocked", "expansion": "default", "context_nesting": "top-level", "opt_in_method": "no-opt-in", "source_scheme": "https", "subresource": {"blockable": "*", "optionally-blockable": []}}], "description": "Test behavior of blockable content.", "specification_url": "http://www.w3.org/TR/mixed-content/#category-blockable", "name": "blockable", "title": "Blockable content"}, {"test_expansion": [{"origin": ["same-host-https"], "name": "allowed", "redirection": ["no-redirect", "keep-scheme-redirect"], "expectation": "allowed", "expansion": "default", "context_nesting": "top-level", "opt_in_method": "*", "source_scheme": "https", "subresource": {"blockable": "*", "optionally-blockable": "*"}}], "description": "Test behavior of allowed content.", "specification_url": "http://www.w3.org/TR/mixed-content/", "name": "allowed", "title": "Allowed content"}], "excluded_tests": [{"origin": "*", "name": "TODO-subresources-not-supported", "redirection": "*", "expectation": "*", "expansion": "*", "context_nesting": "*", "opt_in_method": "*", "source_scheme": "*", "subresource": {"blockable": ["a-tag", "websocket-request"], "optionally-blockable": []}}, {"origin": "*", "name": "TODO-opt-in-method-img-cross-origin", "redirection": "*", "expectation": "*", "expansion": "*", "context_nesting": "*", "opt_in_method": "img-crossorigin", "source_scheme": "*", "subresource": {"blockable": "*", "optionally-blockable": "*"}}, {"origin": "*", "name": "Skip-redundant-for-opt-in-method", "redirection": ["keep-scheme-redirect", "swap-scheme-redirect"], "expectation": "*", "expansion": "*", "context_nesting": "*", "opt_in_method": ["meta-csp", "img-crossorigin"], "source_scheme": "*", "subresource": {"blockable": "*", "optionally-blockable": "*"}}]}; +var SPEC_JSON = {"test_expansion_schema": {"origin": ["same-host-https", "same-host-http", "cross-origin-https", "cross-origin-http", "same-host-wss", "same-host-ws", "cross-origin-wss", "cross-origin-ws"], "subresource": {"blockable": ["iframe-tag", "script-tag", "link-css-tag", "form-tag", "xhr-request", "worker-request", "fetch-request", "a-tag", "object-tag", "picture-tag", "websocket-request"], "optionally-blockable": ["img-tag", "audio-tag", "video-tag", "link-prefetch-tag"]}, "context_nesting": ["top-level", "sub-level"], "expectation": ["allowed", "blocked"], "expansion": ["default", "override"], "redirection": ["no-redirect", "keep-scheme-redirect", "swap-scheme-redirect"], "opt_in_method": ["no-opt-in", "http-csp", "meta-csp", "img-crossorigin"], "source_scheme": ["http", "https"]}, "specification": [{"test_expansion": [{"origin": ["cross-origin-http", "same-host-http"], "name": "opt-in-blocks", "redirection": "*", "expectation": "blocked", "expansion": "default", "context_nesting": "top-level", "opt_in_method": ["http-csp", "meta-csp"], "source_scheme": "https", "subresource": {"blockable": [], "optionally-blockable": "*"}}, {"origin": ["cross-origin-http", "same-host-http"], "name": "no-opt-in-allows", "redirection": "*", "expectation": "allowed", "expansion": "default", "context_nesting": "top-level", "opt_in_method": "no-opt-in", "source_scheme": "https", "subresource": {"blockable": [], "optionally-blockable": "*"}}], "description": "Test behavior of optionally-blockable content", "specification_url": "http://www.w3.org/TR/mixed-content/#category-optionally-blockable", "name": "optionally-blockable", "title": "Optionally-blockable content"}, {"test_expansion": [{"origin": ["cross-origin-http", "same-host-http"], "name": "opt-in-blocks", "redirection": "*", "expectation": "blocked", "expansion": "default", "context_nesting": "top-level", "opt_in_method": ["http-csp", "meta-csp"], "source_scheme": "https", "subresource": {"blockable": "*", "optionally-blockable": []}}, {"origin": ["cross-origin-http", "same-host-http"], "name": "no-opt-in-blocks", "redirection": "*", "expectation": "blocked", "expansion": "default", "context_nesting": "top-level", "opt_in_method": "no-opt-in", "source_scheme": "https", "subresource": {"blockable": "*", "optionally-blockable": []}}, {"origin": ["cross-origin-ws", "same-host-ws"], "name": "ws-downgrade-blocks", "redirection": "*", "expectation": "blocked", "expansion": "default", "context_nesting": "top-level", "opt_in_method": ["no-opt-in", "http-csp", "meta-csp"], "source_scheme": "https", "subresource": {"blockable": "websocket-request", "optionally-blockable": []}}], "description": "Test behavior of blockable content.", "specification_url": "http://www.w3.org/TR/mixed-content/#category-blockable", "name": "blockable", "title": "Blockable content"}, {"test_expansion": [{"origin": ["same-host-https"], "name": "allowed", "redirection": ["no-redirect", "keep-scheme-redirect"], "expectation": "allowed", "expansion": "default", "context_nesting": "top-level", "opt_in_method": "*", "source_scheme": "https", "subresource": {"blockable": "*", "optionally-blockable": "*"}}, {"origin": ["same-host-wss"], "name": "websocket-allowed", "redirection": ["no-redirect", "keep-scheme-redirect"], "expectation": "allowed", "expansion": "default", "context_nesting": "top-level", "opt_in_method": "*", "source_scheme": "https", "subresource": {"blockable": "websocket-request", "optionally-blockable": []}}], "description": "Test behavior of allowed content.", "specification_url": "http://www.w3.org/TR/mixed-content/", "name": "allowed", "title": "Allowed content"}], "excluded_tests": [{"origin": "*", "name": "Redundant-subresources", "redirection": "*", "expectation": "*", "expansion": "*", "context_nesting": "*", "opt_in_method": "*", "source_scheme": "*", "subresource": {"blockable": ["a-tag"], "optionally-blockable": []}}, {"origin": ["same-host-https", "same-host-http", "cross-origin-https", "cross-origin-http"], "name": "Skip-origins-not-applicable-to-websockets", "redirection": "*", "expectation": "*", "expansion": "*", "context_nesting": "*", "opt_in_method": "*", "source_scheme": "*", "subresource": {"blockable": ["websocket-request"], "optionally-blockable": []}}, {"origin": "*", "name": "TODO-opt-in-method-img-cross-origin", "redirection": "*", "expectation": "*", "expansion": "*", "context_nesting": "*", "opt_in_method": "img-crossorigin", "source_scheme": "*", "subresource": {"blockable": "*", "optionally-blockable": "*"}}, {"origin": "*", "name": "Skip-redundant-for-opt-in-method", "redirection": ["keep-scheme-redirect", "swap-scheme-redirect"], "expectation": "*", "expansion": "*", "context_nesting": "*", "opt_in_method": ["meta-csp", "img-crossorigin"], "source_scheme": "*", "subresource": {"blockable": "*", "optionally-blockable": "*"}}]}; diff --git a/tests/wpt/web-platform-tests/performance-timeline/po-disconnect.html b/tests/wpt/web-platform-tests/performance-timeline/po-disconnect.html index e347c1d31bc..dff39cfaaaa 100644 --- a/tests/wpt/web-platform-tests/performance-timeline/po-disconnect.html +++ b/tests/wpt/web-platform-tests/performance-timeline/po-disconnect.html @@ -3,6 +3,7 @@ <title>PerformanceObservers: disconnect</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="performanceobservers.js"></script> <h1>PerformanceObservers: disconnect</h1> <div id="log"></div> <script> diff --git a/tests/wpt/web-platform-tests/quirks-mode/hashless-hex-color.html b/tests/wpt/web-platform-tests/quirks-mode/hashless-hex-color.html index da90911ec4f..cbda90c0af7 100644 --- a/tests/wpt/web-platform-tests/quirks-mode/hashless-hex-color.html +++ b/tests/wpt/web-platform-tests/quirks-mode/hashless-hex-color.html @@ -322,16 +322,13 @@ {input:"url('aaaaaa')", svg:'url(aaaaaa)'}, {input:"#a"}, {input:"#aa"}, - {input:"#aaaa"}, {input:"#aaaaa"}, {input:"#aaaaaaa"}, {input:"#1"}, {input:"#11"}, - {input:"#1111"}, {input:"#11111"}, {input:"#1111111"}, {input:"#1a"}, - {input:"#111a"}, {input:"#1111a"}, {input:"#111111a"}, {input:"1%"}, diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/common.js b/tests/wpt/web-platform-tests/referrer-policy/generic/common.js index ab211f8d2a4..492031859c8 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/common.js +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/common.js @@ -22,7 +22,7 @@ function parseUrlQueryString(queryString) { function appendIframeToBody(url, attributes) { var iframe = document.createElement("iframe"); iframe.src = url; - // Extend element with attributes. (E.g. "referrer_policy" or "rel") + // Extend element with attributes. (E.g. "referrerPolicy" or "rel") if (attributes) { for (var attr in attributes) { iframe[attr] = attributes[attr]; @@ -40,7 +40,7 @@ function loadImage(src, callback, attributes) { callback(image); } image.src = src; - // Extend element with attributes. (E.g. "referrer_policy" or "rel") + // Extend element with attributes. (E.g. "referrerPolicy" or "rel") if (attributes) { for (var attr in attributes) { image[attr] = attributes[attr]; diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js b/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js index a2e1887530a..c4cf96fb04b 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/referrer-policy-test-case.js @@ -76,7 +76,7 @@ function ReferrerPolicyTestCase(scenario, testDescription, sanityChecker) { // Depending on the delivery method, extend the subresource element with // these attributes. var elementAttributesForDeliveryMethod = { - "attr-referrer": {referrerpolicy: t._scenario.referrer_policy}, + "attr-referrer": {referrerPolicy: t._scenario.referrer_policy}, "rel-noreferrer": {rel: "noreferrer"} }; diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html b/tests/wpt/web-platform-tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html index a90db9b2068..e35f7e734c3 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/subresource-test/attr-referrer-invalid-value.html @@ -1,12 +1,12 @@ <!DOCTYPE html> <html> <head> - <title>Invalid referrerpolicy attribute value</title> + <title>Invalid referrerPolicy attribute value</title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> </head> <body> - <h1>Invalid referrerpolicy attribute value</h1> + <h1>Invalid referrerPolicy attribute value</h1> <pre>Running...</pre> <script> @@ -14,10 +14,10 @@ var elements = ["iframe", "img", "a", "area"]; for (var i = 0; i < elements.length; i++) { var elem = document.createElement(elements[i]); - elem.referrerpolicy = "unsafe-url"; - assert_equals(elem.referrerpolicy, "unsafe-url"); - elem.referrerpolicy = "not-valid-value"; - assert_equals(elem.referrerpolicy, ""); + elem.referrerPolicy = "unsafe-url"; + assert_equals(elem.referrerPolicy, "unsafe-url"); + elem.referrerPolicy = "not-valid-value"; + assert_equals(elem.referrerPolicy, ""); } }, "Invalid referrerpolicy values not reflected"); </script> diff --git a/tests/wpt/web-platform-tests/resources/docs/api.md b/tests/wpt/web-platform-tests/resources/docs/api.md index 1405cfdfecf..1f50c73a6ee 100644 --- a/tests/wpt/web-platform-tests/resources/docs/api.md +++ b/tests/wpt/web-platform-tests/resources/docs/api.md @@ -160,7 +160,7 @@ previous Promise Test finishes. `promise_rejects` can be used to test Promises that need to reject: ```js -promise_rejects(test_object, code, promise) +promise_rejects(test_object, code, promise, description) ``` The `code` argument is equivalent to the same argument to the `assert_throws` diff --git a/tests/wpt/web-platform-tests/resources/testharness.js b/tests/wpt/web-platform-tests/resources/testharness.js index b2198b0f1b2..52b65ddf19c 100644 --- a/tests/wpt/web-platform-tests/resources/testharness.js +++ b/tests/wpt/web-platform-tests/resources/testharness.js @@ -540,9 +540,9 @@ policies and contribution forms [3]. }); } - function promise_rejects(test, expected, promise) { - return promise.then(test.unreached_func("Should have rejected.")).catch(function(e) { - assert_throws(expected, function() { throw e }); + function promise_rejects(test, expected, promise, description) { + return promise.then(test.unreached_func("Should have rejected: " + description)).catch(function(e) { + assert_throws(expected, function() { throw e }, description); }); } diff --git a/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.html b/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.html new file mode 100644 index 00000000000..ab3c4436787 --- /dev/null +++ b/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.html @@ -0,0 +1,25 @@ +<!doctype html> +<html> + <head> + <meta charset=utf-8> + <title>Test Window.isSecureContext for HTTP creator</title> + <meta name="help" href="https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object"> + <meta name="author" title="Jonathan Watt" href="https://jwatt.org/"> + <script src=/resources/testharness.js></script> + <script src=/resources/testharnessreport.js></script> + <script src="server-locations.sub.js"></script> + <script> + +// This file is the equivasent of the https version, but rather than +// having a copy of its script file we figure out the URI of the script on the +// https server and load it here. +let script = document.createElement("script"); +script.setAttribute("src", https_dir + "basic-popup-and-iframe-tests.https.js"); +document.head.appendChild(script); + + </script> + </head> + <body onload="begin();"> + </body> +</html> + diff --git a/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.https.html b/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.https.html new file mode 100644 index 00000000000..a9c7f3c883d --- /dev/null +++ b/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.https.html @@ -0,0 +1,16 @@ +<!doctype html> +<html> + <head> + <meta charset=utf-8> + <title>Test Window.isSecureContext for HTTPS creator</title> + <meta name="help" href="https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object"> + <meta name="author" title="Jonathan Watt" href="https://jwatt.org/"> + <script src=/resources/testharness.js></script> + <script src=/resources/testharnessreport.js></script> + <script src="server-locations.sub.js"></script> + <script src="basic-popup-and-iframe-tests.https.js"></script> + </head> + <body onload="begin();"> + </body> +</html> + diff --git a/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.https.js b/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.https.js new file mode 100644 index 00000000000..93b5e2b3187 --- /dev/null +++ b/tests/wpt/web-platform-tests/secure-contexts/basic-popup-and-iframe-tests.https.js @@ -0,0 +1,279 @@ + +/** + * This test checks the Secure Context state of documents for various + * permutations of document URI types and loading methods. + * + * The hierarchy that is tested is: + * + * creator-doc > createe-doc + * + * The creator-doc is one of: + * + * http: + * https: + * + * The createe-doc is loaded as either a: + * + * popup + * iframe + * sandboxed-iframe + * + * into which we load and test: + * + * http: + * https: + * blob: + * javascript: + * about:blank + * initial about:blank + * srcdoc + * + * TODO once web-platform-tests supports it: + * - test http://localhost + * - test file: + * + * TODO once https://github.com/w3c/webappsec-secure-contexts/issues/26 is resolved + * - test data: + */ + + +setup({explicit_done:true}); + + +const host_and_dirname = location.host + + location.pathname.substr(0, location.pathname.lastIndexOf("/") + 1); + + +// Flags to indicate where document types should be loaded for testing: +const eLoadInPopup = (1 << 0); +const eLoadInUnsandboxedIframe = (1 << 1); +const eLoadInSandboxedIframe = (1 << 2); +const eLoadInEverything = eLoadInPopup | eLoadInUnsandboxedIframe | eLoadInSandboxedIframe; + +// Flags indicating if a document type is expected to be a Secure Context: +const eSecureNo = 1; +const eSecureIfCreatorSecure = 2; + +// Flags indicating how the result of a test is obtained: +const eResultFromPostMessage = 1; +const eResultFromExaminationOnLoad = 2; +const eResultFromExaminationSync = 3; + + +const loadTypes = [ + new LoadType("an http: URI", + eLoadInEverything, + http_dir + "postMessage-helper.html", + eSecureNo, + eResultFromPostMessage), + new LoadType("an https: URI", + eLoadInEverything, + https_dir + "postMessage-helper.https.html", + eSecureIfCreatorSecure, + eResultFromPostMessage), + new LoadType("a blob: URI", + eLoadInEverything, + URL.createObjectURL(new Blob(["<script>(opener||parent).postMessage(isSecureContext, '*')</script>"])), + eSecureIfCreatorSecure, + eResultFromPostMessage), + new LoadType("a srcdoc", + // popup not relevant: + eLoadInUnsandboxedIframe | eLoadInSandboxedIframe, + "<script>(opener||parent).postMessage(isSecureContext, '*')</script>", + eSecureIfCreatorSecure, + eResultFromPostMessage), + new LoadType("a javascript: URI", + // can't load in sandbox: + eLoadInUnsandboxedIframe | eLoadInPopup, + "javascript:(opener||parent).postMessage(isSecureContext, '*')", + eSecureIfCreatorSecure, + eResultFromPostMessage), + new LoadType("about:blank", + // can't obtain state if sandboxed: + eLoadInUnsandboxedIframe | eLoadInPopup, + "about:blank", + eSecureIfCreatorSecure, + eResultFromExaminationOnLoad), + new LoadType("initial about:blank", + // can't obtain state if sandboxed: + eLoadInUnsandboxedIframe | eLoadInPopup, + "about:blank", // we don't wait for this to load, so whatever + eSecureIfCreatorSecure, + eResultFromExaminationSync), +]; + +const loadTargets = [ + new LoadTarget("an iframe", eLoadInUnsandboxedIframe), + new LoadTarget("a sandboxed iframe", eLoadInSandboxedIframe), + new LoadTarget("a popup", eLoadInPopup), +]; + + +function LoadType(description, loadInFlags, uri, expectedSecureFlag, resultFrom) { + this.desc = description; + this.loadInFlags = loadInFlags; + this.uri = uri; + this.expectedSecureFlag = expectedSecureFlag; + this.resultFrom = resultFrom; +} + + +function LoadTarget(description, loadInFlag) { + this.desc = description; + this.loadInFlag = loadInFlag; +} + +LoadTarget.prototype.open = function(loadType) { + let loadTarget = this; + this.currentTest.step(function() { + assert_true((loadTarget.loadInFlag & loadType.loadInFlags) != 0, + loadType.desc + " cannot be tested in " + loadTarget.desc); + }); + if (this.loadInFlag == eLoadInUnsandboxedIframe) { + let iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + iframe[loadType.desc == "a srcdoc" ? "srcdoc" : "src"] = loadType.uri; + return iframe; + } + if (this.loadInFlag == eLoadInSandboxedIframe) { + let iframe = document.body.appendChild(document.createElement("iframe")); + iframe.setAttribute("sandbox", "allow-scripts"); + iframe[loadType.desc == "a srcdoc" ? "srcdoc" : "src"] = loadType.uri; + return iframe; + } + if (this.loadInFlag == eLoadInPopup) { + return window.open(loadType.uri); + } + this.currentTest.step(function() { + assert_unreached("Unknown load type flag: " + loadInFlags); + }); + return null; +} + +LoadTarget.prototype.close = function(domTarget) { + if (this.loadInFlag == eLoadInUnsandboxedIframe || + this.loadInFlag == eLoadInSandboxedIframe) { + domTarget.remove(); + return; + } + if (this.loadInFlag == eLoadInPopup) { + domTarget.close(); + return; + } + this.currentTest.step(function() { + assert_unreached("Unknown load type flag: " + loadInFlags); + }); +} + +LoadTarget.prototype.load_and_get_result_for = function(loadType) { + if (!(loadType.loadInFlags & this.loadInFlag)) { + return Promise.reject("not applicable"); + } + if (!(this.loadInFlag & eLoadInPopup) && + location.protocol == "https:" && + loadType.uri.substr(0,5) == "http:") { + // Mixed content blocker will prevent this load + return Promise.reject("not applicable"); + } + this.currentTest = async_test("Test Window.isSecureContext in " + this.desc + + " loading " + loadType.desc) + if (loadType.resultFrom == eResultFromExaminationSync) { + let domTarget = this.open(loadType); + let result = domTarget instanceof Window ? + domTarget.isSecureContext : domTarget.contentWindow.isSecureContext; + this.close(domTarget); + return Promise.resolve(result); + } + let target = this; + if (loadType.resultFrom == eResultFromExaminationOnLoad) { + return new Promise(function(resolve, reject) { + function handleLoad(event) { + let result = domTarget instanceof Window ? + domTarget.isSecureContext : domTarget.contentWindow.isSecureContext; + domTarget.removeEventListener("load", handleLoad); + target.close(domTarget); + resolve(result); + } + let domTarget = target.open(loadType); + domTarget.addEventListener("load", handleLoad, false); + }); + } + if (loadType.resultFrom == eResultFromPostMessage) { + return new Promise(function(resolve, reject) { + function handleMessage(event) { + window.removeEventListener("message", handleMessage); + target.close(domTarget); + resolve(event.data); + } + window.addEventListener("message", handleMessage, false); + let domTarget = target.open(loadType); + }); + } + return Promise.reject("unexpected 'result from' type"); +} + + +let current_type_index = -1; +let current_target_index = 0; + +function run_next_test() { + current_type_index++; + if (current_type_index >= loadTypes.length) { + current_type_index = 0; + current_target_index++; + if (current_target_index >= loadTargets.length) { + done(); + return; // all test permutations complete + } + } + let loadTarget = loadTargets[current_target_index]; + let loadType = loadTypes[current_type_index]; + loadTarget.load_and_get_result_for(loadType).then( + function(value) { + run_next_test_soon(); + loadTarget.currentTest.step(function() { + if (loadType.expectedSecureFlag == eSecureNo) { + assert_false(value, loadType.desc + " in " + loadTarget.desc + " should not create a Secure Context"); + } else if (loadType.expectedSecureFlag == eSecureIfCreatorSecure) { + if (!window.isSecureContext) { + assert_false(value, loadType.desc + " in " + loadTarget.desc + " should not create a Secure Context when its creator is not a Secure Context."); + } else { + assert_true(value, loadType.desc + " in " + loadTarget.desc + " should create a Secure Context when its creator is a Secure Context"); + } + } else { + assert_unreached(loadType.desc + " - unknown expected secure flag: " + expectedSecureFlag); + } + loadTarget.currentTest.done(); + }); + }, + function(failReason) { + run_next_test_soon(); + if (failReason == "not applicable") { + return; + } + loadTarget.currentTest.step(function() { + assert_unreached(loadType.desc + " - got unexpected rejected promise"); + }); + } + ); +} + +function run_next_test_soon() { + setTimeout(run_next_test, 0); +} + +function begin() { + test(function() { + if (location.protocol == "http:") { + assert_false(isSecureContext, + "http: creator should not be a Secure Context"); + } else if (location.protocol == "https:") { + assert_true(isSecureContext, + "https: creator should be a Secure Context"); + } else { + assert_unreached("Unknown location.protocol"); + } + }); + run_next_test(); +} + diff --git a/tests/wpt/web-platform-tests/secure-contexts/postMessage-helper.html b/tests/wpt/web-platform-tests/secure-contexts/postMessage-helper.html new file mode 100644 index 00000000000..8971c86b279 --- /dev/null +++ b/tests/wpt/web-platform-tests/secure-contexts/postMessage-helper.html @@ -0,0 +1 @@ +<script>(opener||parent).postMessage(isSecureContext, '*')</script> diff --git a/tests/wpt/web-platform-tests/secure-contexts/postMessage-helper.https.html b/tests/wpt/web-platform-tests/secure-contexts/postMessage-helper.https.html new file mode 100644 index 00000000000..8971c86b279 --- /dev/null +++ b/tests/wpt/web-platform-tests/secure-contexts/postMessage-helper.https.html @@ -0,0 +1 @@ +<script>(opener||parent).postMessage(isSecureContext, '*')</script> diff --git a/tests/wpt/web-platform-tests/secure-contexts/server-locations.sub.js b/tests/wpt/web-platform-tests/secure-contexts/server-locations.sub.js new file mode 100644 index 00000000000..46754b631e6 --- /dev/null +++ b/tests/wpt/web-platform-tests/secure-contexts/server-locations.sub.js @@ -0,0 +1,6 @@ +var https_dir = "https://{{location[hostname]}}:{{ports[https][0]}}{{location[path]}}"; +https_dir = https_dir.substr(0, https_dir.lastIndexOf("/") + 1); + +var http_dir = "http://{{location[hostname]}}:{{ports[http][0]}}{{location[path]}}"; +http_dir = http_dir.substr(0, http_dir.lastIndexOf("/") + 1); + diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https.html index 556d04413fa..23bb85612c9 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event-redirect.https.html @@ -65,6 +65,7 @@ function redirect_fetch_test(t, test) { url: url, request_init: test.request_init, redirect_dest: test.redirect_dest, + expected_type: test.expected_type, }, '*', [channel.port2]); }); @@ -225,12 +226,10 @@ async_test(function(t) { redirect: 'manual', mode: 'no-cors' }, - // should reject because only navigations can be intercepted with - // opaqueredirect responses - should_reject: true + should_reject: false }); }, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' + - 'no-cors without credentials should fail opaqueredirect interception'); + 'no-cors without credentials should succeed interception'); async_test(function(t) { redirect_fetch_test(t, { @@ -242,12 +241,10 @@ async_test(function(t) { redirect: 'manual', mode: 'no-cors' }, - // should reject because only navigations can be intercepted with - // opaqueredirect responses - should_reject: true + should_reject: false }); }, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' + - 'cors without credentials should fail opaqueredirect interception'); + 'cors without credentials should succeed interception'); async_test(function(t) { redirect_fetch_test(t, { @@ -378,12 +375,10 @@ async_test(function(t) { redirect: 'manual', mode: 'no-cors' }, - // should reject because only navigations can be intercepted with - // opaqueredirect responses - should_reject: true + should_reject: false }); }, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' + - 'no-cors with credentials should fail opaqueredirect interception'); + 'no-cors with credentials should succeed interception'); async_test(function(t) { redirect_fetch_test(t, { @@ -395,12 +390,10 @@ async_test(function(t) { redirect: 'manual', mode: 'no-cors' }, - // should reject because only navigations can be intercepted with - // opaqueredirect responses - should_reject: true + should_reject: false }); }, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' + - 'cors with credentials should fail opaqueredirect interception'); + 'cors with credentials should succeed interception'); async_test(function(t) { redirect_fetch_test(t, { diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event.https.html index 4d7e9a4da1b..cbb842d2c76 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event.https.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-event.https.html @@ -114,27 +114,27 @@ function run_referrer_policy_tests(frame, referrer, href, origin) { 'ReferrerPolicy: no-referrer-when-downgrade', 'Service Worker should respond to fetch with no referrer with ""'); return frame.contentWindow.fetch('resources/simple.html?referrerFull', - {referrerPolicy: "origin-only", referrer: referrer}); + {referrerPolicy: "origin", referrer: referrer}); }) .then(function(response) { return response.text(); }) .then(function(response_text) { assert_equals( response_text, 'Referrer: ' + origin + '/' + '\n' + - 'ReferrerPolicy: origin-only', - 'Service Worker should respond to fetch with the referrer origin with "origin-only" and a same origin request'); + 'ReferrerPolicy: origin', + 'Service Worker should respond to fetch with the referrer origin with "origin" and a same origin request'); var http_url = get_host_info()['HTTP_ORIGIN'] + base_path() + '/resources/simple.html?referrerFull'; return frame.contentWindow.fetch(http_url, - {referrerPolicy: "origin-only", referrer: referrer}); + {referrerPolicy: "origin", referrer: referrer}); }) .then(function(response) { return response.text(); }) .then(function(response_text) { assert_equals( response_text, 'Referrer: ' + origin + '/' + '\n' + - 'ReferrerPolicy: origin-only', - 'Service Worker should respond to fetch with the referrer origin with "origin-only" and a cross origin request'); + 'ReferrerPolicy: origin', + 'Service Worker should respond to fetch with the referrer origin with "origin" and a cross origin request'); return frame.contentWindow.fetch('resources/simple.html?referrerFull', {referrerPolicy: "origin-when-cross-origin", referrer: referrer}); }) diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html index cbce7f19d71..777308241e4 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https.html @@ -5,95 +5,172 @@ <script src="resources/get-host-info.sub.js"></script> <script src="resources/test-helpers.sub.js?pipe=sub"></script> <script> -var url_count = 0; -var expected_results = {}; +var SCOPE = 'resources/fetch-request-resources-iframe.https.html'; +var SCRIPT = 'resources/fetch-request-resources-worker.js'; +var host_info = get_host_info(); +var LOCAL_URL = + host_info['HTTPS_ORIGIN'] + base_path() + 'resources/dummy?test'; +var REMOTE_URL = + host_info['HTTPS_REMOTE_ORIGIN'] + base_path() + 'resources/dummy?test'; -function css_image_test(frame, url, type, expexted_mode, - expected_credentials) { - var actual_url = url + (++url_count); - expected_results[actual_url] = { - url: actual_url, - mode: expexted_mode, +function css_image_test(expected_results, frame, url, type, + expected_mode, expected_credentials) { + expected_results[url] = { + url: url, + mode: expected_mode, credentials: expected_credentials, - message: 'CSSImage load (url:' + actual_url + ' type:' + type + ')' + message: 'CSSImage load (url:' + url + ' type:' + type + ')' }; - return frame.contentWindow.load_css_image(actual_url, type); + return frame.contentWindow.load_css_image(url, type); } -function css_image_set_test(frame, url, type, expexted_mode, - expected_credentials) { - var actual_url = url + (++url_count); - expected_results[actual_url] = { - url: actual_url, - mode: expexted_mode, +function css_image_set_test(expected_results, frame, url, type, + expected_mode, expected_credentials) { + expected_results[url] = { + url: url, + mode: expected_mode, credentials: expected_credentials, - message: 'CSSImageSet load (url:' + actual_url + ' type:' + type + ')' + message: 'CSSImageSet load (url:' + url + ' type:' + type + ')' }; - return frame.contentWindow.load_css_image_set(actual_url, type); + return frame.contentWindow.load_css_image_set(url, type); +} + +function create_message_promise(t, expected_results, frame, + worker, test_count, scope) { + return new Promise(function(resolve) { + var channel = new MessageChannel(); + channel.port1.onmessage = t.step_func(function(msg) { + if (msg.data.ready) { + resolve(); + return; + } + var result = msg.data; + var expected = expected_results[result.url]; + if (!expected) { + return; + } + assert_equals( + result.mode, expected.mode, + 'mode of ' + expected.message + ' must be ' + + expected.mode + '.'); + assert_equals( + result.credentials, expected.credentials, + 'credentials of ' + expected.message + ' must be ' + + expected.credentials + '.'); + --test_count; + delete expected_results[result.url]; + if (test_count == 0) { + frame.remove(); + service_worker_unregister_and_done(t, scope); + } + }); + worker.postMessage( + {port: channel.port2}, [channel.port2]); + }); } async_test(function(t) { - var SCOPE = 'resources/fetch-request-resources-iframe.https.html'; - var SCRIPT = 'resources/fetch-request-resources-worker.js'; - var host_info = get_host_info(); - var LOCAL_URL = - host_info['HTTPS_ORIGIN'] + base_path() + 'resources/dummy?test'; - var REMOTE_URL = - host_info['HTTPS_REMOTE_ORIGIN'] + base_path() + 'resources/dummy?test'; + var scope = SCOPE + "?img=backgroundImage"; + var test_count = 2; + var expected_results = {}; var worker; var frame; - service_worker_unregister_and_register(t, SCRIPT, SCOPE) + service_worker_unregister_and_register(t, SCRIPT, scope) .then(function(registration) { worker = registration.installing; return wait_for_state(t, worker, 'activated'); }) + .then(function() { return with_iframe(scope); }) + .then(function(f) { + frame = f; + return create_message_promise(t, expected_results, frame, + worker, test_count, scope); + }) .then(function() { - return new Promise(function(resolve) { - var channel = new MessageChannel(); - channel.port1.onmessage = t.step_func(function(msg) { - if (msg.data.ready) { - resolve(); - return; - } - var result = msg.data; - var expected = expected_results[result.url]; - if (!expected) { - return; - } - assert_equals( - result.mode, expected.mode, - 'mode of ' + expected.message + ' must be ' + - expected.mode + '.'); - assert_equals( - result.credentials, expected.credentials, - 'credentials of ' + expected.message + ' must be ' + - expected.credentials + '.'); - --url_count; - delete expected_results[result.url]; - if (url_count == 0) { - frame.remove(); - service_worker_unregister_and_done(t, SCOPE); - } - }); - worker.postMessage( - {port: channel.port2}, [channel.port2]); - }); + css_image_test(expected_results, frame, LOCAL_URL + Date.now(), + 'backgroundImage', 'no-cors', 'include'); + css_image_test(expected_results, frame, REMOTE_URL + Date.now(), + 'backgroundImage', 'no-cors', 'include'); + }) + .catch(unreached_rejection(t)); + }, 'Verify FetchEvent for css image (backgroundImage).'); + +async_test(function(t) { + var scope = SCOPE + "?img=shapeOutside"; + var test_count = 2; + var expected_results = {}; + var worker; + var frame; + service_worker_unregister_and_register(t, SCRIPT, scope) + .then(function(registration) { + worker = registration.installing; + return wait_for_state(t, worker, 'activated'); }) - .then(function() { return with_iframe(SCOPE); }) + .then(function() { return with_iframe(scope); }) .then(function(f) { - frame = f; - - css_image_test(f, LOCAL_URL, 'backgroundImage', 'no-cors', 'include'); - css_image_test(f, REMOTE_URL, 'backgroundImage', 'no-cors', 'include'); + frame = f; + return create_message_promise(t, expected_results, frame, + worker, test_count, scope); + }) + .then(function() { + css_image_test(expected_results, frame, LOCAL_URL + Date.now(), + 'shapeOutside', 'cors', 'same-origin'); + css_image_test(expected_results, frame, REMOTE_URL + Date.now(), + 'shapeOutside', 'cors', 'same-origin'); + }) + .catch(unreached_rejection(t)); + }, 'Verify FetchEvent for css image (shapeOutside).'); - css_image_test(f, LOCAL_URL, 'shapeOutside', 'cors', 'same-origin'); - css_image_test(f, REMOTE_URL, 'shapeOutside', 'cors', 'same-origin'); +async_test(function(t) { + var scope = SCOPE + "?img_set=backgroundImage"; + var test_count = 2; + var expected_results = {}; + var worker; + var frame; + service_worker_unregister_and_register(t, SCRIPT, scope) + .then(function(registration) { + worker = registration.installing; + return wait_for_state(t, worker, 'activated'); + }) + .then(function() { return with_iframe(scope); }) + .then(function(f) { + frame = f; + return create_message_promise(t, expected_results, frame, + worker, test_count, scope); + }) + .then(function() { + css_image_set_test(expected_results, frame, LOCAL_URL + Date.now(), + 'backgroundImage', 'no-cors', 'include'); + css_image_set_test(expected_results, frame, REMOTE_URL + Date.now(), + 'backgroundImage', 'no-cors', 'include'); + }) + .catch(unreached_rejection(t)); + }, 'Verify FetchEvent for css image-set (backgroundImage).'); - css_image_set_test(f, LOCAL_URL, 'backgroundImage', 'no-cors', 'include'); - css_image_set_test(f, REMOTE_URL, 'backgroundImage', 'no-cors', 'include'); - css_image_set_test(f, LOCAL_URL, 'shapeOutside', 'cors', 'same-origin'); - css_image_set_test(f, REMOTE_URL, 'shapeOutside', 'cors', 'same-origin'); +async_test(function(t) { + var scope = SCOPE + "?img_set=shapeOutside"; + var test_count = 2; + var expected_results = {}; + var worker; + var frame; + service_worker_unregister_and_register(t, SCRIPT, scope) + .then(function(registration) { + worker = registration.installing; + return wait_for_state(t, worker, 'activated'); + }) + .then(function() { return with_iframe(scope); }) + .then(function(f) { + frame = f; + return create_message_promise(t, expected_results, frame, + worker, test_count, scope); + }) + .then(function() { + css_image_set_test(expected_results, frame, LOCAL_URL + Date.now(), + 'shapeOutside', 'cors', 'same-origin'); + css_image_set_test(expected_results, frame, REMOTE_URL + Date.now(), + 'shapeOutside', 'cors', 'same-origin'); }) .catch(unreached_rejection(t)); - }, 'Verify FetchEvent for css images.'); + }, 'Verify FetchEvent for css image-set (shapeOutside).'); + </script> diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html index 061add6f167..0584cafb075 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/fetch-request-resources.https.html @@ -109,16 +109,14 @@ async_test(function(t) { .then(function(f) { frame = f; - // TODO: Disable 'no-cors' tests for image until - // AsyncOpen2 and cookie policy is supported. - // image_test(f, LOCAL_URL, '', 'no-cors', 'include'); - // image_test(f, REMOTE_URL, '', 'no-cors', 'include'); + image_test(f, LOCAL_URL, '', 'no-cors', 'include'); + image_test(f, REMOTE_URL, '', 'no-cors', 'include'); css_test(f, LOCAL_URL, '', 'no-cors', 'include'); css_test(f, REMOTE_URL, '', 'no-cors', 'include'); image_test(f, LOCAL_URL, 'anonymous', 'cors', 'same-origin'); image_test(f, LOCAL_URL, 'use-credentials', 'cors', 'include'); - image_test(f, REMOTE_URL, 'anonymous', 'cors', 'omit'); + image_test(f, REMOTE_URL, 'anonymous', 'cors', 'same-origin'); image_test(f, REMOTE_URL, 'use-credentials', 'cors', 'include'); script_test(f, LOCAL_URL, '', 'no-cors', 'include'); diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/navigate-window.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/navigate-window.https.html new file mode 100644 index 00000000000..e3aaf4c5cd4 --- /dev/null +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/navigate-window.https.html @@ -0,0 +1,141 @@ +<!DOCTYPE html> +<title>Service Worker: Navigate a Window</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/get-host-info.sub.js"></script> +<script src="resources/test-helpers.sub.js"></script> +<body> +<script> +var host_info = get_host_info(); +var BASE_URL = host_info['HTTPS_ORIGIN'] + base_path(); + +function wait_for_message(msg) { + return new Promise(function(resolve, reject) { + window.addEventListener('message', function onMsg(evt) { + if (evt.data.type === msg) { + resolve(); + } + }); + }); +} + +function with_window(url) { + var win = window.open(url); + return wait_for_message('LOADED').then(_ => win); +} + +function navigate_window(win, url) { + win.location = url; + return wait_for_message('LOADED').then(_ => win); +} + +function reload_window(win) { + win.location.reload(); + return wait_for_message('LOADED').then(_ => win); +} + +function go_back(win) { + win.history.back(); + return wait_for_message('PAGESHOW').then(_ => win); +} + +function go_forward(win) { + win.history.forward(); + return wait_for_message('PAGESHOW').then(_ => win); +} + +function get_clients(win, sw, opts) { + return new Promise((resolve, reject) => { + win.navigator.serviceWorker.addEventListener('message', function onMsg(evt) { + win.navigator.serviceWorker.removeEventListener('message', onMsg); + if (evt.data.type === 'success') { + resolve(evt.data.detail); + } else { + reject(evt.data.detail); + } + }); + sw.postMessage({ type: 'GET_CLIENTS', opts: (opts || {}) }); + }); +} + +function validate_window(win, url, opts) { + return win.navigator.serviceWorker.getRegistration(url) + .then(reg => { + // In order to compare service worker instances we need to + // make sure the DOM object is owned by the same global; the + // opened window in this case. + assert_equals(win.navigator.serviceWorker.controller, reg.active, + 'window should be controlled by service worker'); + return get_clients(win, reg.active, opts); + }) + .then(resultList => { + // We should always see our controlled window. + var expected = [ + { url: url, frameType: 'auxiliary' } + ]; + // If we are including uncontrolled windows, then we might see the + // test window itself and the test harness. + if (opts.includeUncontrolled) { + expected.push({ url: BASE_URL + 'navigate-window.https.html', + frameType: 'auxiliary' }); + expected.push({ url: host_info['HTTPS_ORIGIN'] + '/testharness_runner.html', + frameType: 'top-level' }); + } + assert_equals(resultList.length, expected.length, + 'expected number of clients'); + for (var i = 0; i < resultList.length; ++i) { + assert_equals(resultList[i].url, expected[i].url, + 'client should have expected url'); + assert_equals(resultList[i].frameType, expected[i].frameType, + ' client should have expected frame type'); + } + return win; + }) +} + +promise_test(function(t) { + var worker = BASE_URL + 'resources/navigate-window-worker.js'; + var scope = BASE_URL + 'resources/loaded.html?navigate-window-controlled'; + var url1 = scope + '&q=1'; + var url2 = scope + '&q=2'; + return service_worker_unregister_and_register(t, worker, scope) + .then(reg => wait_for_state(t, reg.installing, 'activated') ) + .then(___ => with_window(url1)) + .then(win => validate_window(win, url1, { includeUncontrolled: false })) + .then(win => navigate_window(win, url2)) + .then(win => validate_window(win, url2, { includeUncontrolled: false })) + .then(win => go_back(win)) + .then(win => validate_window(win, url1, { includeUncontrolled: false })) + .then(win => go_forward(win)) + .then(win => validate_window(win, url2, { includeUncontrolled: false })) + .then(win => reload_window(win)) + .then(win => validate_window(win, url2, { includeUncontrolled: false })) + .then(win => win.close()) + .catch(unreached_rejection(t)) + .then(___ => service_worker_unregister(t, scope)) + }, 'Clients.matchAll() should not show an old window as controlled after ' + + 'it navigates.'); + +promise_test(function(t) { + var worker = BASE_URL + 'resources/navigate-window-worker.js'; + var scope = BASE_URL + 'resources/loaded.html?navigate-window-uncontrolled'; + var url1 = scope + '&q=1'; + var url2 = scope + '&q=2'; + return service_worker_unregister_and_register(t, worker, scope) + .then(reg => wait_for_state(t, reg.installing, 'activated') ) + .then(___ => with_window(url1)) + .then(win => validate_window(win, url1, { includeUncontrolled: true })) + .then(win => navigate_window(win, url2)) + .then(win => validate_window(win, url2, { includeUncontrolled: true })) + .then(win => go_back(win)) + .then(win => validate_window(win, url1, { includeUncontrolled: true })) + .then(win => go_forward(win)) + .then(win => validate_window(win, url2, { includeUncontrolled: true })) + .then(win => reload_window(win)) + .then(win => validate_window(win, url2, { includeUncontrolled: true })) + .then(win => win.close()) + .catch(unreached_rejection(t)) + .then(___ => service_worker_unregister(t, scope)) + }, 'Clients.matchAll() should not show an old window after it navigates.'); +</script> +</body> diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-canvas-tainting-iframe.html b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-canvas-tainting-iframe.html index 0bd6b6f07c3..3822971e80a 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-canvas-tainting-iframe.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-canvas-tainting-iframe.html @@ -210,6 +210,14 @@ window.addEventListener('message', function(evt) { encodeURIComponent(remote_image_url + '&ACAOrigin=' + host_info['HTTPS_ORIGIN']), '', + LOAD_ERROR), // We expect LOAD_ERROR since the server doesn't respond + // with an Access-Control-Allow-Credentials header. + create_test_promise( + image_url + + '&mode=cors&credentials=same-origin&url=' + + encodeURIComponent(remote_image_url + + '&ACAOrigin=' + host_info['HTTPS_ORIGIN']), + '', NOT_TAINTED), create_test_promise( image_url + @@ -240,9 +248,18 @@ window.addEventListener('message', function(evt) { encodeURIComponent(remote_image_url + '&ACAOrigin=' + host_info['HTTPS_ORIGIN']), '', - TAINTED), // We expect TAINTED since the default origin behavior here - // is taint, and it doesn't matter what kind of fetch the - // SW performs. + LOAD_ERROR), // We expect LOAD_ERROR since the server doesn't respond + // with an Access-Control-Allow-Credentials header. + create_test_promise( + remote_image_url + + '&mode=cors&credentials=same-origin&url=' + + encodeURIComponent(remote_image_url + + '&ACAOrigin=' + host_info['HTTPS_ORIGIN']), + '', + TAINTED), // The cross-origin no-cors request is immediately tainted. + // Since this happens before the service worker interception, + // it does not matter what kind of response it returns. + // The result will always be tainted. create_test_promise( remote_image_url + '&mode=cors&url=' + diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-event-redirect-iframe.html b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-event-redirect-iframe.html index 499e9677569..fbe3bda8471 100644 --- a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-event-redirect-iframe.html +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/fetch-event-redirect-iframe.html @@ -4,10 +4,11 @@ window.addEventListener('message', function(evt) { var data = evt.data; fetch(new Request(data.url, data.request_init)).then(function(response) { if (data.request_init.mode === 'no-cors' && data.redirect_dest != 'same-origin') { - if (response.type === 'opaque') { + if (response.type === data.expected_type && + (response.type === 'opaque' || response.type === 'opaqueredirect')) { return {result: 'success', detail: ''}; } else { - return {result: 'failure', detail: 'expected opaque response'}; + return {result: 'failure', detail: 'expected ' + data.expected_type + ' response'}; } } return response.json(); diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/loaded.html b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/loaded.html new file mode 100644 index 00000000000..0cabce69f8e --- /dev/null +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/loaded.html @@ -0,0 +1,9 @@ +<script> +addEventListener('load', function() { + opener.postMessage({ type: 'LOADED' }, '*'); +}); + +addEventListener('pageshow', function() { + opener.postMessage({ type: 'PAGESHOW' }, '*'); +}); +</script> diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigate-window-worker.js b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigate-window-worker.js new file mode 100644 index 00000000000..f9617439fc6 --- /dev/null +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/navigate-window-worker.js @@ -0,0 +1,21 @@ +addEventListener('message', function(evt) { + if (evt.data.type === 'GET_CLIENTS') { + clients.matchAll(evt.data.opts).then(function(clientList) { + var resultList = clientList.map(function(c) { + return { url: c.url, frameType: c.frameType, id: c.id }; + }); + evt.source.postMessage({ type: 'success', detail: resultList }); + }).catch(function(err) { + evt.source.postMessage({ + type: 'failure', + detail: 'matchAll() rejected with "' + err + '"' + }); + }); + return; + } + + evt.source.postMessage({ + type: 'failure', + detail: 'Unexpected message type "' + evt.data.type + '"' + }); +}); diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-recovery-worker.py b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-recovery-worker.py new file mode 100644 index 00000000000..8aaa5ca9344 --- /dev/null +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-recovery-worker.py @@ -0,0 +1,25 @@ +def main(request, response): + # Set mode to 'init' for initial fetch. + mode = 'init' + if 'update-recovery-mode' in request.cookies: + mode = request.cookies['update-recovery-mode'].value + + # no-cache itself to ensure the user agent finds a new version for each update. + headers = [('Cache-Control', 'no-cache, must-revalidate'), + ('Pragma', 'no-cache')] + + extra_body = '' + + if mode == 'init': + # Install a bad service worker that will break the controlled + # document navigation. + response.set_cookie('update-recovery-mode', 'bad') + extra_body = "addEventListener('fetch', function(e) { e.respondWith(Promise.reject()); });" + elif mode == 'bad': + # When the update tries to pull the script again, update to + # a worker service worker that does not break document + # navigation. Serve the same script from then on. + response.delete_cookie('update-recovery-mode') + + headers.append(('Content-Type', 'application/javascript')) + return headers, '%s' % (extra_body) diff --git a/tests/wpt/web-platform-tests/service-workers/service-worker/update-recovery.https.html b/tests/wpt/web-platform-tests/service-workers/service-worker/update-recovery.https.html new file mode 100644 index 00000000000..3b3d955b142 --- /dev/null +++ b/tests/wpt/web-platform-tests/service-workers/service-worker/update-recovery.https.html @@ -0,0 +1,71 @@ +<!DOCTYPE html> +<title>Service Worker: recovery by navigation update</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/testharness-helpers.js"></script> +<script src="resources/test-helpers.sub.js"></script> +<script> +async_test(function(t) { + var scope = 'resources/simple.txt'; + var worker_url = 'resources/update-recovery-worker.py'; + var expected_url = normalizeURL(worker_url); + var registration; + + function with_bad_iframe(url) { + return new Promise(function(resolve, reject) { + var frame = document.createElement('iframe'); + + // There is no cross-browser event to listen for to detect an + // iframe that fails to load due to a bad interception. Unfortunately + // we have to use a timeout. + var timeout = setTimeout(function() { + frame.remove(); + resolve(); + }, 5000); + + // If we do get a load event, though, we know something went wrong. + frame.addEventListener('load', function() { + clearTimeout(timeout); + frame.remove(); + reject('expected bad iframe should not fire a load event!'); + }); + + frame.src = url; + document.body.appendChild(frame); + }); + } + + function with_update(t) { + return new Promise(function(resolve, reject) { + registration.addEventListener('updatefound', function onUpdate() { + registration.removeEventListener('updatefound', onUpdate); + wait_for_state(t, registration.installing, 'activated').then(function() { + resolve(); + }); + }); + }); + } + + service_worker_unregister_and_register(t, worker_url, scope) + .then(function(r) { + registration = r; + return wait_for_state(t, registration.installing, 'activated'); + }) + .then(function() { + return Promise.all([ + with_update(t), + with_bad_iframe(scope) + ]); + }) + .then(function() { + return with_iframe(scope); + }) + .then(function(frame) { + assert_equals(frame.contentWindow.navigator.serviceWorker.controller.scriptURL, + expected_url); + frame.remove(); + return service_worker_unregister_and_done(t, scope); + }) + .catch(unreached_rejection(t)); + }, 'Recover from a bad service worker by updating after a failed navigation.'); +</script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/bad-strategies.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/bad-strategies.https.html index 4fab9313239..6613ab7fbb9 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/bad-strategies.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/bad-strategies.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="bad-strategies.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/bad-underlying-sources.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/bad-underlying-sources.https.html index ecb11feab12..2b779761aa8 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/bad-underlying-sources.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/bad-underlying-sources.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="bad-underlying-sources.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/brand-checks.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/brand-checks.https.html index 9dfed123d76..ef5f326e3fb 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/brand-checks.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/brand-checks.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="../resources/test-utils.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/cancel.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/cancel.https.html index f767429f170..e43c6200adc 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/cancel.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/cancel.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="../resources/test-utils.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.https.html index bc38166c303..a281f047368 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/count-queuing-strategy-integration.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="count-queuing-strategy-integration.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/garbage-collection.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/garbage-collection.https.html index a38ed20534c..9215eb7dae8 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/garbage-collection.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/garbage-collection.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="../resources/test-utils.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/general.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/general.https.html index f5241ffe8f0..465271a9bd6 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/general.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/general.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="../resources/test-utils.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/pipe-through.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/pipe-through.https.html index 62d98d45af4..fbac05a1b5b 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/pipe-through.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/pipe-through.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="../resources/test-utils.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/readable-stream-reader.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/readable-stream-reader.https.html index df0db11d1bc..cc561351800 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/readable-stream-reader.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/readable-stream-reader.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="readable-stream-reader.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/tee.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/tee.https.html index 02c847b8117..37c3e8d82d7 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/tee.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/tee.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="../resources/rs-utils.js"></script> diff --git a/tests/wpt/web-platform-tests/streams/readable-streams/templated.https.html b/tests/wpt/web-platform-tests/streams/readable-streams/templated.https.html index 95c6a6acaef..7719eee164f 100644 --- a/tests/wpt/web-platform-tests/streams/readable-streams/templated.https.html +++ b/tests/wpt/web-platform-tests/streams/readable-streams/templated.https.html @@ -2,7 +2,7 @@ <meta charset="utf-8"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/service-workers/service-workers/resources/test-helpers.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> <script src="../resources/test-initializer.js"></script> <script src="../resources/test-utils.js"></script> diff --git a/tests/wpt/web-platform-tests/web-animations/animatable/animate.html b/tests/wpt/web-platform-tests/web-animations/animatable/animate.html index e3838eb0cb6..71aa6e16d2f 100644 --- a/tests/wpt/web-platform-tests/web-animations/animatable/animate.html +++ b/tests/wpt/web-platform-tests/web-animations/animatable/animate.html @@ -1,62 +1,55 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animatable.animate tests</title> -<link rel="help" href="http://w3c.github.io/web-animations/#dom-animatable-animate"> -<link rel="author" title="Brian Birtles" href="mailto:bbirtles@mozilla.com"> +<link rel="help" href="https://w3c.github.io/web-animations/#dom-animatable-animate"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../testcommon.js"></script> +<script src="../resources/keyframe-utils.js"></script> <body> <div id="log"></div> <script> 'use strict'; +// Tests on Element + test(function(t) { var div = createDiv(t); - var anim = div.animate({ opacity: [ 0, 1 ] }, 2000); + var anim = div.animate(null); assert_class_string(anim, 'Animation', 'Returned object is an Animation'); }, 'Element.animate() creates an Animation object'); test(function(t) { var div = createDiv(t); - var anim = div.animate({ opacity: [ 0, 1 ] }, 2000); + var anim = div.animate(null); assert_class_string(anim.effect, 'KeyframeEffect', 'Returned Animation has a KeyframeEffect'); }, 'Element.animate() creates an Animation object with a KeyframeEffect'); -// Animatable.animate() passes its |frames| argument to the KeyframeEffect -// constructor. As a result, detailed tests of the handling of that argument -// are found in the tests for that constructor. Here we just check that the -// different types of arguments are correctly passed along. - -test(function(t) { - var div = createDiv(t); - var anim = div.animate({ opacity: [ 0, 1 ] }, 2000); - assert_equals(anim.effect.getFrames().length, 2); - assert_equals(anim.effect.getFrames()[0].opacity, '0'); - assert_equals(anim.effect.getFrames()[1].opacity, '1'); -}, 'Element.animate() accepts a property-indexed keyframe specification'); - -test(function(t) { - var div = createDiv(t); - var anim = div.animate([ { opacity: 0 }, { opacity: 1 } ], 2000); - assert_equals(anim.effect.getFrames().length, 2); - assert_equals(anim.effect.getFrames()[0].opacity, '0'); - assert_equals(anim.effect.getFrames()[1].opacity, '1'); -}, 'Element.animate() accepts a frame-indexed keyframe specification'); - -test(function(t) { - var div = createDiv(t); - var anim = div.animate({ opacity: 0 }, 2000); - assert_equals(anim.effect.getFrames().length, 1); - assert_equals(anim.effect.getFrames()[0].opacity, '0'); -}, 'Element.animate() accepts a single-valued keyframe specification'); - -// As with the |frames| argument, Animatable.animate() passes its |options| -// argument to the KeyframeEffect constructor as well. As a result, detailed -// tests of the handling of that argument are found in the tests for that -// constructor. Here we just check that the different types of arguments are -// correctly passed along. +gPropertyIndexedKeyframesTests.forEach(function(subtest) { + test(function(t) { + var div = createDiv(t); + var anim = div.animate(subtest.input, 2000); + assert_frame_lists_equal(anim.effect.getFrames(), subtest.output); + }, 'Element.animate() accepts ' + subtest.desc); +}); + +gKeyframeSequenceTests.forEach(function(subtest) { + test(function(t) { + var div = createDiv(t); + var anim = div.animate(subtest.input, 2000); + assert_frame_lists_equal(anim.effect.getFrames(), subtest.output); + }, 'Element.animate() accepts ' + subtest.desc); +}); + +gInvalidKeyframesTests.forEach(function(subtest) { + test(function(t) { + var div = createDiv(t); + assert_throws(subtest.expected, function() { + div.animate(subtest.input, 2000); + }); + }, 'Element.animate() does not accept ' + subtest.desc); +}); test(function(t) { var div = createDiv(t); @@ -127,13 +120,13 @@ test(function(t) { test(function(t) { var pseudoTarget = createPseudo(t, 'before'); - var anim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, 2000); + var anim = pseudoTarget.animate(null); assert_class_string(anim, 'Animation', 'The returned object is an Animation'); }, 'CSSPseudoElement.animate() creates an Animation object'); test(function(t) { var pseudoTarget = createPseudo(t, 'before'); - var anim = pseudoTarget.animate({ opacity: [ 0, 1 ] }, 2000); + var anim = pseudoTarget.animate(null); assert_equals(anim.effect.target, pseudoTarget, 'The returned Animation targets to the correct object'); }, 'CSSPseudoElement.animate() creates an Animation object targeting ' + diff --git a/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/duration.html b/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/duration.html index 5b64e1f0a55..930cc9f74af 100644 --- a/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/duration.html +++ b/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/duration.html @@ -15,11 +15,10 @@ test(function(t) { var div = createDiv(t); var anim = div.animate({ opacity: [ 0, 1 ] }, 2000); anim.effect.timing.duration = 123.45; - assert_approx_equals(anim.effect.timing.duration, 123.45, 0.000001, - 'set duration 123.45'); - assert_approx_equals(anim.effect.getComputedTiming().duration, 123.45, - 0.000001, - 'getComputedTiming() after set duration 123.45'); + assert_times_equal(anim.effect.timing.duration, 123.45, + 'set duration 123.45'); + assert_times_equal(anim.effect.getComputedTiming().duration, 123.45, + 'getComputedTiming() after set duration 123.45'); }, 'set duration 123.45'); test(function(t) { diff --git a/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/endDelay.html b/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/endDelay.html index 3af0e7fd1da..0953a4f8217 100644 --- a/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/endDelay.html +++ b/tests/wpt/web-platform-tests/web-animations/animation-effect-timing/endDelay.html @@ -15,11 +15,10 @@ test(function(t) { var div = createDiv(t); var anim = div.animate({ opacity: [ 0, 1 ] }, 2000); anim.effect.timing.endDelay = 123.45; - assert_approx_equals(anim.effect.timing.endDelay, 123.45, 0.000001, - 'set endDelay 123.45'); - assert_approx_equals(anim.effect.getComputedTiming().endDelay, 123.45, - 0.000001, - 'getComputedTiming() after set endDelay 123.45'); + assert_times_equal(anim.effect.timing.endDelay, 123.45, + 'set endDelay 123.45'); + assert_times_equal(anim.effect.getComputedTiming().endDelay, 123.45, + 'getComputedTiming() after set endDelay 123.45'); }, 'set endDelay 123.45'); test(function(t) { diff --git a/tests/wpt/web-platform-tests/web-animations/animation/constructor.html b/tests/wpt/web-platform-tests/web-animations/animation/constructor.html index 38946a04a0b..12f2a01fde2 100644 --- a/tests/wpt/web-platform-tests/web-animations/animation/constructor.html +++ b/tests/wpt/web-platform-tests/web-animations/animation/constructor.html @@ -55,5 +55,19 @@ gTestArguments.forEach(function(args) { }, "Animation can be constructed " + args.description); }); +test(function(t) { + var effect = new KeyframeEffectReadOnly(null, + { left: ["10px", "20px"] }, + { duration: 10000, + fill: "forwards" }); + var anim = new Animation(effect, document.timeline); + anim.pause(); + assert_equals(effect.getComputedTiming().progress, 0.0); + anim.currentTime += 5000; + assert_equals(effect.getComputedTiming().progress, 0.5); + anim.finish(); + assert_equals(effect.getComputedTiming().progress, 1.0); +}, "Animation constructed by an effect with null target runs normally"); + </script> </body> diff --git a/tests/wpt/web-platform-tests/web-animations/animation/finish.html b/tests/wpt/web-platform-tests/web-animations/animation/finish.html index 35bd7b0d0b0..811923c6798 100644 --- a/tests/wpt/web-platform-tests/web-animations/animation/finish.html +++ b/tests/wpt/web-platform-tests/web-animations/animation/finish.html @@ -96,11 +96,10 @@ promise_test(function(t) { assert_equals(animation.playState, 'finished', 'The play state of a paused animation should become ' + '"finished" after finish() is called'); - assert_approx_equals(animation.startTime, - animation.timeline.currentTime - 100 * MS_PER_SEC, - 0.0001, - 'The start time of a paused animation should be set ' + - 'after calling finish()'); + assert_times_equal(animation.startTime, + animation.timeline.currentTime - 100 * MS_PER_SEC, + 'The start time of a paused animation should be set ' + + 'after calling finish()'); }); }, 'Test finish() while paused'); @@ -117,11 +116,10 @@ test(function(t) { assert_equals(animation.playState, 'finished', 'The play state of a pause-pending animation should become ' + '"finished" after finish() is called'); - assert_approx_equals(animation.startTime, - animation.timeline.currentTime - 100 * MS_PER_SEC / 2, - 0.0001, - 'The start time of a pause-pending animation should ' + - 'be set after calling finish()'); + assert_times_equal(animation.startTime, + animation.timeline.currentTime - 100 * MS_PER_SEC / 2, + 'The start time of a pause-pending animation should ' + + 'be set after calling finish()'); }, 'Test finish() while pause-pending with positive playbackRate'); test(function(t) { @@ -148,11 +146,10 @@ test(function(t) { assert_equals(animation.playState, 'finished', 'The play state of a play-pending animation should become ' + '"finished" after finish() is called'); - assert_approx_equals(animation.startTime, - animation.timeline.currentTime - 100 * MS_PER_SEC / 0.5, - 0.0001, - 'The start time of a play-pending animation should ' + - 'be set after calling finish()'); + assert_times_equal(animation.startTime, + animation.timeline.currentTime - 100 * MS_PER_SEC / 0.5, + 'The start time of a play-pending animation should ' + + 'be set after calling finish()'); }, 'Test finish() while play-pending'); // FIXME: Add a test for when we are play-pending without an active timeline. @@ -206,5 +203,45 @@ promise_test(function(t) { 'Animation.finish()'); }); }, 'Test finish() resolves finished promise synchronously'); + +promise_test(function(t) { + var effect = new KeyframeEffectReadOnly(null, gKeyFrames, 100 * MS_PER_SEC); + var animation = new Animation(effect, document.timeline); + var resolvedFinished = false; + animation.finished.then(function() { + resolvedFinished = true; + }); + + return animation.ready.then(function() { + animation.finish(); + }).then(function() { + assert_true(resolvedFinished, + 'Animation.finished should be resolved soon after ' + + 'Animation.finish()'); + }); +}, 'Test finish() resolves finished promise synchronously with an animation ' + + 'without a target'); + +promise_test(function(t) { + var effect = new KeyframeEffectReadOnly(null, gKeyFrames, 100 * MS_PER_SEC); + var animation = new Animation(effect, document.timeline); + animation.play(); + + var resolvedFinished = false; + animation.finished.then(function() { + resolvedFinished = true; + }); + + return animation.ready.then(function() { + animation.currentTime = animation.effect.getComputedTiming().endTime - 1; + return waitForAnimationFrames(2); + }).then(function() { + assert_true(resolvedFinished, + 'Animation.finished should be resolved soon after ' + + 'Animation finishes normally'); + }); +}, 'Test normally finished animation resolves finished promise synchronously ' + + 'with an animation without a target'); + </script> </body> diff --git a/tests/wpt/web-platform-tests/web-animations/animation/startTime.html b/tests/wpt/web-platform-tests/web-animations/animation/startTime.html new file mode 100644 index 00000000000..642f8e10508 --- /dev/null +++ b/tests/wpt/web-platform-tests/web-animations/animation/startTime.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Animation.startTime tests</title> +<link rel="help" +href="https://w3c.github.io/web-animations/#dom-animation-starttime"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../testcommon.js"></script> +<link rel="stylesheet" href="/resources/testharness.css"> +<body> +<div id="log"></div> +<script> +'use strict'; + +test(function(t) { + var animation = new Animation(new KeyframeEffect(createDiv(t), null), + document.timeline); + assert_equals(animation.startTime, null, 'startTime is unresolved'); +}, 'startTime of a newly created (idle) animation is unresolved'); + +test(function(t) { + var animation = new Animation(new KeyframeEffect(createDiv(t), null), + document.timeline); + animation.play(); + assert_equals(animation.startTime, null, 'startTime is unresolved'); +}, 'startTime of a play-pending animation is unresolved'); + +test(function(t) { + var animation = new Animation(new KeyframeEffect(createDiv(t), null), + document.timeline); + animation.pause(); + assert_equals(animation.startTime, null, 'startTime is unresolved'); +}, 'startTime of a pause-pending animation is unresolved'); + +test(function(t) { + var animation = createDiv(t).animate(null); + assert_equals(animation.startTime, null, 'startTime is unresolved'); +}, 'startTime of a play-pending animation created using Element.animate' + + ' shortcut is unresolved'); + +promise_test(function(t) { + var animation = createDiv(t).animate(null, 100 * MS_PER_SEC); + return animation.ready.then(function() { + assert_greater_than(animation.startTime, 0, 'startTime when running'); + }); +}, 'startTime is resolved when running'); + +</script> +</body> diff --git a/tests/wpt/web-platform-tests/web-animations/document/getAnimations.html b/tests/wpt/web-platform-tests/web-animations/document/getAnimations.html new file mode 100644 index 00000000000..a2a3352cbcd --- /dev/null +++ b/tests/wpt/web-platform-tests/web-animations/document/getAnimations.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>document.getAnimations tests</title> +<link rel="help" href="https://w3c.github.io/web-animations/#dom-document-getanimations"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../testcommon.js"></script> +<body> +<div id="log"></div> +<div id="target"></div> +<script> +"use strict"; + +var gKeyFrames = { 'marginLeft': ['100px', '200px'] }; + +test(function(t) { + assert_equals(document.getAnimations().length, 0, + 'getAnimations returns an empty sequence for a document ' + + 'with no animations'); +}, 'Test document.getAnimations for non-animated content'); + +test(function(t) { + var div = createDiv(t); + var anim1 = div.animate(gKeyFrames, 100 * MS_PER_SEC); + var anim2 = div.animate(gKeyFrames, 100 * MS_PER_SEC); + assert_equals(document.getAnimations().length, 2, + 'getAnimation returns running animations'); + + anim1.finish(); + anim2.finish(); + assert_equals(document.getAnimations().length, 0, + 'getAnimation only returns running animations'); +}, 'Test document.getAnimations for script-generated animations') + +test(function(t) { + var div = createDiv(t); + var anim1 = div.animate(gKeyFrames, 100 * MS_PER_SEC); + var anim2 = div.animate(gKeyFrames, 100 * MS_PER_SEC); + assert_array_equals(document.getAnimations(), + [ anim1, anim2 ], + 'getAnimations() returns running animations'); +}, 'Test the order of document.getAnimations with script generated animations') + +test(function(t) { + var effect = new KeyframeEffectReadOnly(null, gKeyFrames, 100 * MS_PER_SEC); + var anim = new Animation(effect, document.timeline); + anim.play(); + + assert_equals(document.getAnimations().length, 0, + 'document.getAnimations() only returns animations targeting ' + + 'elements in this document'); +}, 'Test document.getAnimations with null target'); + +</script> +</body> diff --git a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/constructor.html b/tests/wpt/web-platform-tests/web-animations/keyframe-effect/constructor.html index c14d74fa994..4acffcbf296 100644 --- a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/constructor.html +++ b/tests/wpt/web-platform-tests/web-animations/keyframe-effect/constructor.html @@ -1,11 +1,11 @@ <!DOCTYPE html> <meta charset=utf-8> <title>KeyframeEffectReadOnly constructor tests</title> -<link rel="help" href="http://w3c.github.io/web-animations/#the-keyframeeffect-interfaces"> -<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au"> +<link rel="help" href="https://w3c.github.io/web-animations/#the-keyframeeffect-interfaces"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../testcommon.js"></script> +<script src="../resources/keyframe-utils.js"></script> <body> <div id="log"></div> <div id="target"></div> @@ -19,28 +19,6 @@ var target = document.getElementById("target"); -function assert_frames_equal(a, b, name) { - assert_equals(Object.keys(a).sort().toString(), - Object.keys(b).sort().toString(), - "properties on " + name); - for (var p in a) { - assert_equals(a[p], b[p], "value for '" + p + "' on " + name); - } -} - -function assert_frame_lists_equal(a, b) { - assert_equals(a.length, b.length, "number of frames"); - for (var i = 0; i < Math.min(a.length, b.length); i++) { - assert_frames_equal(a[i], b[i], "ComputedKeyframe #" + i); - } -} - -var gEmptyKeyframeListTests = [ - [], - null, - undefined, -]; - test(function(t) { gEmptyKeyframeListTests.forEach(function(frames) { assert_equals(new KeyframeEffectReadOnly(target, frames).getFrames().length, @@ -48,14 +26,6 @@ test(function(t) { }); }, "a KeyframeEffectReadOnly can be constructed with no frames"); -// [specified easing value, expected easing value] -var gEasingValueTests = [ - ["linear", "linear"], - ["ease-in-out", "ease-in-out"], - ["Ease\\2d in-out", "ease-in-out"], - ["ease /**/", "ease"], -]; - test(function(t) { gEasingValueTests.forEach(function(subtest) { var easing = subtest[0]; @@ -97,18 +67,6 @@ test(function(t) { }, "easing values are parsed correctly when passed to the " + "KeyframeEffectReadOnly constructor in KeyframeTimingOptions"); -var gGoodKeyframeCompositeValueTests = [ - "replace", "add", "accumulate", undefined -]; - -var gGoodOptionsCompositeValueTests = [ - "replace", "add", "accumulate" -]; - -var gBadCompositeValueTests = [ - "unrecognised", "replace ", "Replace", null -]; - test(function(t) { var getFrame = function(composite) { return { left: [ "10px", "20px" ], composite: composite }; @@ -120,8 +78,8 @@ test(function(t) { }); gBadCompositeValueTests.forEach(function(composite) { assert_throws(new TypeError, function() { - new KeyframeEffectReadOnly(target, getFrame(composite)); - }); + new KeyframeEffectReadOnly(target, getFrame(composite)); + }); }); }, "composite values are parsed correctly when passed to the " + "KeyframeEffectReadOnly constructor in property-indexed keyframes"); @@ -140,8 +98,8 @@ test(function(t) { }); gBadCompositeValueTests.forEach(function(composite) { assert_throws(new TypeError, function() { - new KeyframeEffectReadOnly(target, getFrames(composite)); - }); + new KeyframeEffectReadOnly(target, getFrames(composite)); + }); }); }, "composite values are parsed correctly when passed to the " + "KeyframeEffectReadOnly constructor in regular keyframes"); @@ -156,130 +114,14 @@ test(function(t) { }); gBadCompositeValueTests.forEach(function(composite) { assert_throws(new TypeError, function() { - new KeyframeEffectReadOnly(target, { - left: ["10px", "20px"] - }, { composite: composite }); - }); + new KeyframeEffectReadOnly(target, { + left: ["10px", "20px"] + }, { composite: composite }); + }); }); }, "composite values are parsed correctly when passed to the " + "KeyframeEffectReadOnly constructor in KeyframeTimingOptions"); -var gPropertyIndexedKeyframesTests = [ - { desc: "a one property two value property-indexed keyframes specification", - input: { left: ["10px", "20px"] }, - output: [{ offset: null, computedOffset: 0, easing: "linear", - left: "10px" }, - { offset: null, computedOffset: 1, easing: "linear", - left: "20px" }] }, - { desc: "a one shorthand property two value property-indexed keyframes" - + " specification", - input: { margin: ["10px", "10px 20px 30px 40px"] }, - output: [{ offset: null, computedOffset: 0, easing: "linear", - margin: "10px" }, - { offset: null, computedOffset: 1, easing: "linear", - margin: "10px 20px 30px 40px" }] }, - { desc: "a two property (one shorthand and one of its longhand components)" - + " two value property-indexed keyframes specification", - input: { marginTop: ["50px", "60px"], - margin: ["10px", "10px 20px 30px 40px"] }, - output: [{ offset: null, computedOffset: 0, easing: "linear", - marginTop: "50px", margin: "10px" }, - { offset: null, computedOffset: 1, easing: "linear", - marginTop: "60px", margin: "10px 20px 30px 40px" }] }, - { desc: "a two property two value property-indexed keyframes specification", - input: { left: ["10px", "20px"], - top: ["30px", "40px"] }, - output: [{ offset: null, computedOffset: 0, easing: "linear", - left: "10px", top: "30px" }, - { offset: null, computedOffset: 1, easing: "linear", - left: "20px", top: "40px" }] }, - { desc: "a two property property-indexed keyframes specification with" - + " different numbers of values", - input: { left: ["10px", "20px", "30px"], - top: ["40px", "50px"] }, - output: [{ offset: null, computedOffset: 0.0, easing: "linear", - left: "10px", top: "40px" }, - { offset: null, computedOffset: 0.5, easing: "linear", - left: "20px" }, - { offset: null, computedOffset: 1.0, easing: "linear", - left: "30px", top: "50px" }] }, - { desc: "a property-indexed keyframes specification with an invalid value", - input: { left: ["10px", "20px", "30px", "40px", "50px"], - top: ["15px", "25px", "invalid", "45px", "55px"] }, - output: [{ offset: null, computedOffset: 0.00, easing: "linear", - left: "10px", top: "15px" }, - { offset: null, computedOffset: 0.25, easing: "linear", - left: "20px", top: "25px" }, - { offset: null, computedOffset: 0.50, easing: "linear", - left: "30px", top: "invalid" }, - { offset: null, computedOffset: 0.75, easing: "linear", - left: "40px", top: "45px" }, - { offset: null, computedOffset: 1.00, easing: "linear", - left: "50px", top: "55px" }] }, - { desc: "a one property two value property-indexed keyframes specification" - + " that needs to stringify its values", - input: { opacity: [0, 1] }, - output: [{ offset: null, computedOffset: 0, easing: "linear", - opacity: "0" }, - { offset: null, computedOffset: 1, easing: "linear", - opacity: "1" }] }, - { desc: "a one property one value property-indexed keyframes specification", - input: { left: ["10px"] }, - output: [{ offset: null, computedOffset: 1, easing: "linear", - left: "10px" }] }, - { desc: "a one property one non-array value property-indexed keyframes" - + " specification", - input: { left: "10px" }, - output: [{ offset: null, computedOffset: 1, easing: "linear", - left: "10px" }] }, - { desc: "a one property two value property-indexed keyframes specification" - + " where the first value is invalid", - input: { left: ["invalid", "10px"] }, - output: [{ offset: null, computedOffset: 0, easing: "linear", - left: "invalid" }, - { offset: null, computedOffset: 1, easing: "linear", - left: "10px" }] }, - { desc: "a one property two value property-indexed keyframes specification" - + " where the second value is invalid", - input: { left: ["10px", "invalid"] }, - output: [{ offset: null, computedOffset: 0, easing: "linear", - left: "10px" }, - { offset: null, computedOffset: 1, easing: "linear", - left: "invalid" }] }, - { desc: "a two property property-indexed keyframes specification where one" - + " property is missing from the first keyframe", - input: [{ offset: 0, left: "10px" }, - { offset: 1, left: "20px", top: "30px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, - { offset: 1, computedOffset: 1, easing: "linear", - left: "20px", top: "30px" }] }, - { desc: "a two property property-indexed keyframes specification where one" - + " property is missing from the last keyframe", - input: [{ offset: 0, left: "10px", top: "20px" }, - { offset: 1, left: "30px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - left: "10px" , top: "20px" }, - { offset: 1, computedOffset: 1, easing: "linear", - left: "30px" }] }, - { desc: "a property-indexed keyframes specification with repeated values" - + " at offset 0 with different easings", - input: [{ offset: 0.0, left: "100px", easing: "ease" }, - { offset: 0.0, left: "200px", easing: "ease" }, - { offset: 0.5, left: "300px", easing: "linear" }, - { offset: 1.0, left: "400px", easing: "ease-out" }, - { offset: 1.0, left: "500px", easing: "step-end" }], - output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", - left: "100px" }, - { offset: 0.0, computedOffset: 0.0, easing: "ease", - left: "200px" }, - { offset: 0.5, computedOffset: 0.5, easing: "linear", - left: "300px" }, - { offset: 1.0, computedOffset: 1.0, easing: "ease-out", - left: "400px" }, - { offset: 1.0, computedOffset: 1.0, easing: "step-end", - left: "500px" }] }, -]; - gPropertyIndexedKeyframesTests.forEach(function(subtest) { test(function(t) { var effect = new KeyframeEffectReadOnly(target, subtest.input); @@ -314,208 +156,6 @@ test(function(t) { }, "the KeyframeEffectReadOnly constructor reads keyframe properties in the " + "expected order"); -var gKeyframeSequenceTests = [ - { desc: "a one property two keyframe sequence", - input: [{ offset: 0, left: "10px" }, - { offset: 1, left: "20px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, - { offset: 1, computedOffset: 1, easing: "linear", left: "20px" }] - }, - { desc: "a two property two keyframe sequence", - input: [{ offset: 0, left: "10px", top: "30px" }, - { offset: 1, left: "20px", top: "40px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - left: "10px", top: "30px" }, - { offset: 1, computedOffset: 1, easing: "linear", - left: "20px", top: "40px" }] }, - { desc: "a one shorthand property two keyframe sequence", - input: [{ offset: 0, margin: "10px" }, - { offset: 1, margin: "20px 30px 40px 50px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - margin: "10px" }, - { offset: 1, computedOffset: 1, easing: "linear", - margin: "20px 30px 40px 50px" }] }, - { desc: "a two property (a shorthand and one of its component longhands)" - + " two keyframe sequence", - input: [{ offset: 0, margin: "10px", marginTop: "20px" }, - { offset: 1, marginTop: "70px", margin: "30px 40px 50px 60px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - margin: "10px", marginTop: "20px" }, - { offset: 1, computedOffset: 1, easing: "linear", - marginTop: "70px", margin: "30px 40px 50px 60px" }] }, - { desc: "a keyframe sequence with duplicate values for a given interior" - + " offset", - input: [{ offset: 0.0, left: "10px" }, - { offset: 0.5, left: "20px" }, - { offset: 0.5, left: "30px" }, - { offset: 0.5, left: "40px" }, - { offset: 1.0, left: "50px" }], - output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", - left: "10px" }, - { offset: 0.5, computedOffset: 0.5, easing: "linear", - left: "20px" }, - { offset: 0.5, computedOffset: 0.5, easing: "linear", - left: "30px" }, - { offset: 0.5, computedOffset: 0.5, easing: "linear", - left: "40px" }, - { offset: 1.0, computedOffset: 1.0, easing: "linear", - left: "50px" }] }, - { desc: "a keyframe sequence with duplicate values for offsets 0 and 1", - input: [{ offset: 0, left: "10px" }, - { offset: 0, left: "20px" }, - { offset: 0, left: "30px" }, - { offset: 1, left: "40px" }, - { offset: 1, left: "50px" }, - { offset: 1, left: "60px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, - { offset: 0, computedOffset: 0, easing: "linear", left: "20px" }, - { offset: 0, computedOffset: 0, easing: "linear", left: "30px" }, - { offset: 1, computedOffset: 1, easing: "linear", left: "40px" }, - { offset: 1, computedOffset: 1, easing: "linear", left: "50px" }, - { offset: 1, computedOffset: 1, easing: "linear", left: "60px" }] - }, - { desc: "a two property four keyframe sequence", - input: [{ offset: 0, left: "10px" }, - { offset: 0, top: "20px" }, - { offset: 1, top: "30px" }, - { offset: 1, left: "40px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, - { offset: 0, computedOffset: 0, easing: "linear", top: "20px" }, - { offset: 1, computedOffset: 1, easing: "linear", top: "30px" }, - { offset: 1, computedOffset: 1, easing: "linear", left: "40px" }] - }, - { desc: "a one property keyframe sequence with some omitted offsets", - input: [{ offset: 0.00, left: "10px" }, - { offset: 0.25, left: "20px" }, - { left: "30px" }, - { left: "40px" }, - { offset: 1.00, left: "50px" }], - output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", - left: "10px" }, - { offset: 0.25, computedOffset: 0.25, easing: "linear", - left: "20px" }, - { offset: null, computedOffset: 0.50, easing: "linear", - left: "30px" }, - { offset: null, computedOffset: 0.75, easing: "linear", - left: "40px" }, - { offset: 1.00, computedOffset: 1.00, easing: "linear", - left: "50px" }] }, - { desc: "a two property keyframe sequence with some omitted offsets", - input: [{ offset: 0.00, left: "10px", top: "20px" }, - { offset: 0.25, left: "30px" }, - { left: "40px" }, - { left: "50px", top: "60px" }, - { offset: 1.00, left: "70px", top: "80px" }], - output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", - left: "10px", top: "20px" }, - { offset: 0.25, computedOffset: 0.25, easing: "linear", - left: "30px" }, - { offset: null, computedOffset: 0.50, easing: "linear", - left: "40px" }, - { offset: null, computedOffset: 0.75, easing: "linear", - left: "50px", top: "60px" }, - { offset: 1.00, computedOffset: 1.00, easing: "linear", - left: "70px", top: "80px" }] }, - { desc: "a one property keyframe sequence with all omitted offsets", - input: [{ left: "10px" }, - { left: "20px" }, - { left: "30px" }, - { left: "40px" }, - { left: "50px" }], - output: [{ offset: null, computedOffset: 0.00, easing: "linear", - left: "10px" }, - { offset: null, computedOffset: 0.25, easing: "linear", - left: "20px" }, - { offset: null, computedOffset: 0.50, easing: "linear", - left: "30px" }, - { offset: null, computedOffset: 0.75, easing: "linear", - left: "40px" }, - { offset: null, computedOffset: 1.00, easing: "linear", - left: "50px" }] }, - { desc: "a keyframe sequence with different easing values, but the same" - + " easing value for a given offset", - input: [{ offset: 0.0, easing: "ease", left: "10px"}, - { offset: 0.0, easing: "ease", top: "20px"}, - { offset: 0.5, easing: "linear", left: "30px" }, - { offset: 0.5, easing: "linear", top: "40px" }, - { offset: 1.0, easing: "step-end", left: "50px" }, - { offset: 1.0, easing: "step-end", top: "60px" }], - output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", - left: "10px" }, - { offset: 0.0, computedOffset: 0.0, easing: "ease", - top: "20px" }, - { offset: 0.5, computedOffset: 0.5, easing: "linear", - left: "30px" }, - { offset: 0.5, computedOffset: 0.5, easing: "linear", - top: "40px" }, - { offset: 1.0, computedOffset: 1.0, easing: "step-end", - left: "50px" }, - { offset: 1.0, computedOffset: 1.0, easing: "step-end", - top: "60px" }] }, - { desc: "a keyframe sequence with different composite values, but the" - + " same composite value for a given offset", - input: [{ offset: 0.0, composite: "replace", left: "10px" }, - { offset: 0.0, composite: "replace", top: "20px" }, - { offset: 0.5, composite: "add", left: "30px" }, - { offset: 0.5, composite: "add", top: "40px" }, - { offset: 1.0, composite: "replace", left: "50px" }, - { offset: 1.0, composite: "replace", top: "60px" }], - output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", - composite: "replace", left: "10px" }, - { offset: 0.0, computedOffset: 0.0, easing: "linear", - composite: "replace", top: "20px" }, - { offset: 0.5, computedOffset: 0.0, easing: "linear", - composite: "add", left: "30px" }, - { offset: 0.5, computedOffset: 0.0, easing: "linear", - composite: "add", top: "40px" }, - { offset: 1.0, computedOffset: 1.0, easing: "linear", - composite: "replace", left: "50px" }, - { offset: 1.0, computedOffset: 1.0, easing: "linear", - composite: "replace", top: "60px" }] }, - { desc: "a one property two keyframe sequence that needs to stringify" - + " its values", - input: [{ offset: 0, opacity: 0 }, - { offset: 1, opacity: 1 }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", opacity: "0" }, - { offset: 1, computedOffset: 1, easing: "linear", opacity: "1" }] - }, - { desc: "a keyframe sequence where shorthand precedes longhand", - input: [{ offset: 0, margin: "10px", marginRight: "20px" }, - { offset: 1, margin: "30px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - margin: "10px", marginRight: "20px" }, - { offset: 1, computedOffset: 1, easing: "linear", - margin: "30px" }] }, - { desc: "a keyframe sequence where longhand precedes shorthand", - input: [{ offset: 0, marginRight: "20px", margin: "10px" }, - { offset: 1, margin: "30px" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - marginRight: "20px", margin: "10px" }, - { offset: 1, computedOffset: 1, easing: "linear", - margin: "30px" }] }, - { desc: "a keyframe sequence where lesser shorthand precedes greater" - + " shorthand", - input: [{ offset: 0, - borderLeft: "1px solid rgb(1, 2, 3)", - border: "2px dotted rgb(4, 5, 6)" }, - { offset: 1, border: "3px dashed rgb(7, 8, 9)" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - borderLeft: "1px solid rgb(1, 2, 3)", - border: "2px dotted rgb(4, 5, 6)" }, - { offset: 1, computedOffset: 1, easing: "linear", - border: "3px dashed rgb(7, 8, 9)" }] }, - { desc: "a keyframe sequence where greater shorthand precedes lesser" - + " shorthand", - input: [{ offset: 0, border: "2px dotted rgb(4, 5, 6)", - borderLeft: "1px solid rgb(1, 2, 3)" }, - { offset: 1, border: "3px dashed rgb(7, 8, 9)" }], - output: [{ offset: 0, computedOffset: 0, easing: "linear", - border: "2px dotted rgb(4, 5, 6)", - borderLeft: "1px solid rgb(1, 2, 3)" }, - { offset: 1, computedOffset: 1, easing: "linear", - border: "3px dashed rgb(7, 8, 9)" }] }, -]; - gKeyframeSequenceTests.forEach(function(subtest) { test(function(t) { var effect = new KeyframeEffectReadOnly(target, subtest.input); @@ -530,20 +170,13 @@ gKeyframeSequenceTests.forEach(function(subtest) { " roundtrips"); }); -var gInvalidEasingInKeyframeSequenceTests = [ - { desc: "a blank easing", - input: [{ easing: "" }] }, - { desc: "an unrecognized easing", - input: [{ easing: "unrecognized" }] }, - { desc: "an 'initial' easing", - input: [{ easing: "initial" }] }, - { desc: "an 'inherit' easing", - input: [{ easing: "inherit" }] }, - { desc: "a variable easing", - input: [{ easing: "var(--x)" }] }, - { desc: "a multi-value easing", - input: [{ easing: "ease-in-out, ease-out" }] } -]; +gInvalidKeyframesTests.forEach(function(subtest) { + test(function(t) { + assert_throws(subtest.expected, function() { + new KeyframeEffectReadOnly(target, subtest.input); + }); + }, "KeyframeEffectReadOnly constructor throws with " + subtest.desc); +}); gInvalidEasingInKeyframeSequenceTests.forEach(function(subtest) { test(function(t) { @@ -556,7 +189,7 @@ gInvalidEasingInKeyframeSequenceTests.forEach(function(subtest) { test(function(t) { var effect = new KeyframeEffectReadOnly(target, - {left: ["10px", "20px"]}); + { left: ["10px", "20px"] }); var timing = effect.timing; assert_equals(timing.delay, 0, "default delay"); @@ -576,48 +209,10 @@ test(function(t) { }, "a KeyframeEffectReadOnly constructed without any " + "KeyframeEffectOptions object"); -var gKeyframeEffectOptionTests = [ - { desc: "an empty KeyframeEffectOptions object", - input: { }, - expected: { } }, - { desc: "a normal KeyframeEffectOptions object", - input: { delay: 1000, - fill: "auto", - iterations: 5.5, - duration: "auto", - direction: "alternate" }, - expected: { delay: 1000, - fill: "auto", - iterations: 5.5, - duration: "auto", - direction: "alternate" } }, - { desc: "a double value", - input: 3000, - expected: { duration: 3000 } }, - { desc: "+Infinity", - input: Infinity, - expected: { duration: Infinity } }, - { desc: "an Infinity duration", - input: { duration: Infinity }, - expected: { duration: Infinity } }, - { desc: "an auto duration", - input: { duration: "auto" }, - expected: { duration: "auto" } }, - { desc: "an Infinity iterations", - input: { iterations: Infinity }, - expected: { iterations: Infinity } }, - { desc: "an auto fill", - input: { fill: "auto" }, - expected: { fill: "auto" } }, - { desc: "a forwards fill", - input: { fill: "forwards" }, - expected: { fill: "forwards" } } -]; - gKeyframeEffectOptionTests.forEach(function(stest) { test(function(t) { var effect = new KeyframeEffectReadOnly(target, - {left: ["10px", "20px"]}, + { left: ["10px", "20px"] }, stest.input); // Helper function to provide default expected values when the test does @@ -641,57 +236,6 @@ gKeyframeEffectOptionTests.forEach(function(stest) { }, "a KeyframeEffectReadOnly constructed by " + stest.desc); }); -var gInvalidKeyframeEffectOptionTests = [ - { desc: "-Infinity", - input: -Infinity, - expected: { name: "TypeError" } }, - { desc: "NaN", - input: NaN, - expected: { name: "TypeError" } }, - { desc: "a negative value", - input: -1, - expected: { name: "TypeError" } }, - { desc: "a negative Infinity duration", - input: { duration: -Infinity }, - expected: { name: "TypeError" } }, - { desc: "a NaN duration", - input: { duration: NaN }, - expected: { name: "TypeError" } }, - { desc: "a negative duration", - input: { duration: -1 }, - expected: { name: "TypeError" } }, - { desc: "a string duration", - input: { duration: "merrychristmas" }, - expected: { name: "TypeError" } }, - { desc: "a negative Infinity iterations", - input: { iterations: -Infinity}, - expected: { name: "TypeError" } }, - { desc: "a NaN iterations", - input: { iterations: NaN }, - expected: { name: "TypeError" } }, - { desc: "a negative iterations", - input: { iterations: -1 }, - expected: { name: "TypeError" } }, - { desc: "a blank easing", - input: { easing: "" }, - expected: { name: "TypeError" } }, - { desc: "an unrecognized easing", - input: { easing: "unrecognised" }, - expected: { name: "TypeError" } }, - { desc: "an 'initial' easing", - input: { easing: "initial" }, - expected: { name: "TypeError" } }, - { desc: "an 'inherit' easing", - input: { easing: "inherit" }, - expected: { name: "TypeError" } }, - { desc: "a variable easing", - input: { easing: "var(--x)" }, - expected: { name: "TypeError" } }, - { desc: "a multi-value easing", - input: { easing: "ease-in-out, ease-out" }, - expected: { name: "TypeError" } } -]; - gInvalidKeyframeEffectOptionTests.forEach(function(stest) { test(function(t) { assert_throws(stest.expected, function() { @@ -703,9 +247,16 @@ gInvalidKeyframeEffectOptionTests.forEach(function(stest) { }); test(function(t) { - var effect = new KeyframeEffect(target, - { left: ["10px", "20px"] }); + var effect = new KeyframeEffectReadOnly(null, + { left: ["10px", "20px"] }, + { duration: 100 * MS_PER_SEC, + fill: "forwards" }); + assert_equals(effect.target, null, + "Effect created with null target has correct target"); +}, "a KeyframeEffectReadOnly constructed with null target"); +test(function(t) { + var effect = new KeyframeEffect(target, null); assert_class_string(effect, "KeyframeEffect"); assert_class_string(effect.timing, "AnimationEffectTiming"); }, "KeyframeEffect constructor creates an AnimationEffectTiming timing object"); @@ -718,7 +269,5 @@ test(function(t) { }); }, "KeyframeEffect constructor propagates exceptions generated by accessing" + " the options object"); - -done(); </script> </body> diff --git a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/setFrames.html b/tests/wpt/web-platform-tests/web-animations/keyframe-effect/setFrames.html new file mode 100644 index 00000000000..5564a9e47ca --- /dev/null +++ b/tests/wpt/web-platform-tests/web-animations/keyframe-effect/setFrames.html @@ -0,0 +1,50 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>KeyframeEffect setFrames() tests</title> +<link rel="help" href="https://w3c.github.io/web-animations/#dom-keyframeeffect-setframes"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../testcommon.js"></script> +<script src="../resources/keyframe-utils.js"></script> +<body> +<div id="log"></div> +<div id="target"></div> +<script> +'use strict'; + +var target = document.getElementById('target'); + +test(function(t) { + gEmptyKeyframeListTests.forEach(function(frame) { + var effect = new KeyframeEffect(target, {}); + effect.setFrames(frame); + assert_frame_lists_equal(effect.getFrames(), []); + }); +}, 'Keyframes can be replaced with an empty keyframe'); + +gPropertyIndexedKeyframesTests.forEach(function(subtest) { + test(function(t) { + var effect = new KeyframeEffect(target, {}); + effect.setFrames(subtest.input); + assert_frame_lists_equal(effect.getFrames(), subtest.output); + }, 'Keyframes can be replaced with ' + subtest.desc); +}); + +gKeyframeSequenceTests.forEach(function(subtest) { + test(function(t) { + var effect = new KeyframeEffect(target, {}); + effect.setFrames(subtest.input); + assert_frame_lists_equal(effect.getFrames(), subtest.output); + }, 'Keyframes can be replaced with ' + subtest.desc); +}); + +gInvalidKeyframesTests.forEach(function(subtest) { + test(function(t) { + var effect = new KeyframeEffect(target, {}); + assert_throws(subtest.expected, function() { + effect.setFrames(subtest.input); + }); + }, 'KeyframeEffect constructor throws with ' + subtest.desc); +}); +</script> +</body> diff --git a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/setTarget.html b/tests/wpt/web-platform-tests/web-animations/keyframe-effect/setTarget.html new file mode 100644 index 00000000000..e6be42e4f3f --- /dev/null +++ b/tests/wpt/web-platform-tests/web-animations/keyframe-effect/setTarget.html @@ -0,0 +1,89 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Writable effect.target tests</title> +<link rel="help" + href="https://w3c.github.io/web-animations/#dom-keyframeeffect-target"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../testcommon.js"></script> +<body> +<div id="log"></div> +<script> +"use strict"; + +var gKeyFrames = { 'marginLeft': ['0px', '100px'] }; + +test(function(t) { + var div = createDiv(t); + var effect = new KeyframeEffect(null, gKeyFrames, 100 * MS_PER_SEC); + effect.target = div; + + var anim = new Animation(effect, document.timeline); + anim.play(); + + anim.currentTime = 50 * MS_PER_SEC; + assert_equals(getComputedStyle(div).marginLeft, '50px', + 'Value at 50% progress'); +}, 'Test setting target before constructing the associated animation'); + +test(function(t) { + var div = createDiv(t); + div.style.marginLeft = '10px'; + var effect = new KeyframeEffect(null, gKeyFrames, 100 * MS_PER_SEC); + var anim = new Animation(effect, document.timeline); + anim.play(); + + anim.currentTime = 50 * MS_PER_SEC; + assert_equals(getComputedStyle(div).marginLeft, '10px', + 'Value at 50% progress before setting new target'); + effect.target = div; + assert_equals(getComputedStyle(div).marginLeft, '50px', + 'Value at 50% progress after setting new target'); +}, 'Test setting target from null to a valid target'); + +test(function(t) { + var div = createDiv(t); + div.style.marginLeft = '10px'; + var anim = div.animate(gKeyFrames, 100 * MS_PER_SEC); + + anim.currentTime = 50 * MS_PER_SEC; + assert_equals(getComputedStyle(div).marginLeft, '50px', + 'Value at 50% progress before clearing the target') + + anim.effect.target = null; + assert_equals(getComputedStyle(div).marginLeft, '10px', + 'Value after clearing the target') +}, 'Test setting target from a valid target to null'); + +test(function(t) { + var a = createDiv(t); + var b = createDiv(t); + a.style.marginLeft = '10px'; + b.style.marginLeft = '20px'; + var anim = a.animate(gKeyFrames, 100 * MS_PER_SEC); + + anim.currentTime = 50 * MS_PER_SEC; + assert_equals(getComputedStyle(a).marginLeft, '50px', + 'Value of 1st element (currently targeted) before ' + + 'changing the effect target'); + assert_equals(getComputedStyle(b).marginLeft, '20px', + 'Value of 2nd element (currently not targeted) before ' + + 'changing the effect target'); + anim.effect.target = b; + assert_equals(getComputedStyle(a).marginLeft, '10px', + 'Value of 1st element (currently not targeted) after ' + + 'changing the effect target'); + assert_equals(getComputedStyle(b).marginLeft, '50px', + 'Value of 2nd element (currently targeted) after ' + + 'changing the effect target'); + + // This makes sure the animation property is changed correctly on new + // targeted element. + anim.currentTime = 75 * MS_PER_SEC; + assert_equals(getComputedStyle(b).marginLeft, '75px', + 'Value of 2nd target (currently targeted) after ' + + 'changing the animation current time.'); +}, 'Test setting target from a valid target to another target'); + +</script> +</body> diff --git a/tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js b/tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js new file mode 100644 index 00000000000..6f24a9807b1 --- /dev/null +++ b/tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js @@ -0,0 +1,530 @@ +"use strict"; + +// Utility functions and common keyframe test data. + +// ------------------------------ +// Helper functions +// ------------------------------ + +/** + * Test equality between two lists of computed keyframes + * @param {Array.<ComputedKeyframe>} a - actual computed keyframes + * @param {Array.<ComputedKeyframe>} b - expected computed keyframes + */ +function assert_frame_lists_equal(a, b) { + assert_equals(a.length, b.length, "number of frames"); + for (var i = 0; i < Math.min(a.length, b.length); i++) { + assert_frames_equal(a[i], b[i], "ComputedKeyframe #" + i); + } +} + +/** Helper */ +function assert_frames_equal(a, b, name) { + assert_equals(Object.keys(a).sort().toString(), + Object.keys(b).sort().toString(), + "properties on " + name); + for (var p in a) { + assert_equals(a[p], b[p], "value for '" + p + "' on " + name); + } +} + +// ------------------------------ +// Easing values +// ------------------------------ + +// [specified easing value, expected easing value] +var gEasingValueTests = [ + ["linear", "linear"], + ["ease-in-out", "ease-in-out"], + ["Ease\\2d in-out", "ease-in-out"], + ["ease /**/", "ease"], +]; + +var gInvalidEasingInKeyframeSequenceTests = [ + { desc: "a blank easing", + input: [{ easing: "" }] }, + { desc: "an unrecognized easing", + input: [{ easing: "unrecognized" }] }, + { desc: "an 'initial' easing", + input: [{ easing: "initial" }] }, + { desc: "an 'inherit' easing", + input: [{ easing: "inherit" }] }, + { desc: "a variable easing", + input: [{ easing: "var(--x)" }] }, + { desc: "a multi-value easing", + input: [{ easing: "ease-in-out, ease-out" }] } +]; + +// ------------------------------ +// Composite values +// ------------------------------ + +var gGoodKeyframeCompositeValueTests = [ + "replace", "add", "accumulate", undefined +]; + +var gGoodOptionsCompositeValueTests = [ + "replace", "add", "accumulate" +]; + +var gBadCompositeValueTests = [ + "unrecognised", "replace ", "Replace", null +]; + +// ------------------------------ +// Keyframes +// ------------------------------ + +var gEmptyKeyframeListTests = [ + [], + null, + undefined, +]; + +var gPropertyIndexedKeyframesTests = [ + { desc: "a one property two value property-indexed keyframes specification", + input: { left: ["10px", "20px"] }, + output: [{ offset: null, computedOffset: 0, easing: "linear", + left: "10px" }, + { offset: null, computedOffset: 1, easing: "linear", + left: "20px" }] }, + { desc: "a one shorthand property two value property-indexed keyframes" + + " specification", + input: { margin: ["10px", "10px 20px 30px 40px"] }, + output: [{ offset: null, computedOffset: 0, easing: "linear", + margin: "10px" }, + { offset: null, computedOffset: 1, easing: "linear", + margin: "10px 20px 30px 40px" }] }, + { desc: "a two property (one shorthand and one of its longhand components)" + + " two value property-indexed keyframes specification", + input: { marginTop: ["50px", "60px"], + margin: ["10px", "10px 20px 30px 40px"] }, + output: [{ offset: null, computedOffset: 0, easing: "linear", + marginTop: "50px", margin: "10px" }, + { offset: null, computedOffset: 1, easing: "linear", + marginTop: "60px", margin: "10px 20px 30px 40px" }] }, + { desc: "a two property two value property-indexed keyframes specification", + input: { left: ["10px", "20px"], + top: ["30px", "40px"] }, + output: [{ offset: null, computedOffset: 0, easing: "linear", + left: "10px", top: "30px" }, + { offset: null, computedOffset: 1, easing: "linear", + left: "20px", top: "40px" }] }, + { desc: "a two property property-indexed keyframes specification with" + + " different numbers of values", + input: { left: ["10px", "20px", "30px"], + top: ["40px", "50px"] }, + output: [{ offset: null, computedOffset: 0.0, easing: "linear", + left: "10px", top: "40px" }, + { offset: null, computedOffset: 0.5, easing: "linear", + left: "20px" }, + { offset: null, computedOffset: 1.0, easing: "linear", + left: "30px", top: "50px" }] }, + { desc: "a property-indexed keyframes specification with an invalid value", + input: { left: ["10px", "20px", "30px", "40px", "50px"], + top: ["15px", "25px", "invalid", "45px", "55px"] }, + output: [{ offset: null, computedOffset: 0.00, easing: "linear", + left: "10px", top: "15px" }, + { offset: null, computedOffset: 0.25, easing: "linear", + left: "20px", top: "25px" }, + { offset: null, computedOffset: 0.50, easing: "linear", + left: "30px", top: "invalid" }, + { offset: null, computedOffset: 0.75, easing: "linear", + left: "40px", top: "45px" }, + { offset: null, computedOffset: 1.00, easing: "linear", + left: "50px", top: "55px" }] }, + { desc: "a one property two value property-indexed keyframes specification" + + " that needs to stringify its values", + input: { opacity: [0, 1] }, + output: [{ offset: null, computedOffset: 0, easing: "linear", + opacity: "0" }, + { offset: null, computedOffset: 1, easing: "linear", + opacity: "1" }] }, + { desc: "a one property one value property-indexed keyframes specification", + input: { left: ["10px"] }, + output: [{ offset: null, computedOffset: 1, easing: "linear", + left: "10px" }] }, + { desc: "a one property one non-array value property-indexed keyframes" + + " specification", + input: { left: "10px" }, + output: [{ offset: null, computedOffset: 1, easing: "linear", + left: "10px" }] }, + { desc: "a one property two value property-indexed keyframes specification" + + " where the first value is invalid", + input: { left: ["invalid", "10px"] }, + output: [{ offset: null, computedOffset: 0, easing: "linear", + left: "invalid" }, + { offset: null, computedOffset: 1, easing: "linear", + left: "10px" }] }, + { desc: "a one property two value property-indexed keyframes specification" + + " where the second value is invalid", + input: { left: ["10px", "invalid"] }, + output: [{ offset: null, computedOffset: 0, easing: "linear", + left: "10px" }, + { offset: null, computedOffset: 1, easing: "linear", + left: "invalid" }] }, + { desc: "a two property property-indexed keyframes specification where one" + + " property is missing from the first keyframe", + input: [{ offset: 0, left: "10px" }, + { offset: 1, left: "20px", top: "30px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, + { offset: 1, computedOffset: 1, easing: "linear", + left: "20px", top: "30px" }] }, + { desc: "a two property property-indexed keyframes specification where one" + + " property is missing from the last keyframe", + input: [{ offset: 0, left: "10px", top: "20px" }, + { offset: 1, left: "30px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + left: "10px" , top: "20px" }, + { offset: 1, computedOffset: 1, easing: "linear", + left: "30px" }] }, + { desc: "a property-indexed keyframes specification with repeated values" + + " at offset 0 with different easings", + input: [{ offset: 0.0, left: "100px", easing: "ease" }, + { offset: 0.0, left: "200px", easing: "ease" }, + { offset: 0.5, left: "300px", easing: "linear" }, + { offset: 1.0, left: "400px", easing: "ease-out" }, + { offset: 1.0, left: "500px", easing: "step-end" }], + output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", + left: "100px" }, + { offset: 0.0, computedOffset: 0.0, easing: "ease", + left: "200px" }, + { offset: 0.5, computedOffset: 0.5, easing: "linear", + left: "300px" }, + { offset: 1.0, computedOffset: 1.0, easing: "ease-out", + left: "400px" }, + { offset: 1.0, computedOffset: 1.0, easing: "step-end", + left: "500px" }] }, +]; + +var gKeyframeSequenceTests = [ + { desc: "a one property one keyframe sequence", + input: [{ offset: 1, left: "10px" }], + output: [{ offset: null, computedOffset: 1, easing: "linear", + left: "10px" }] }, + { desc: "a one property two keyframe sequence", + input: [{ offset: 0, left: "10px" }, + { offset: 1, left: "20px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, + { offset: 1, computedOffset: 1, easing: "linear", left: "20px" }] + }, + { desc: "a two property two keyframe sequence", + input: [{ offset: 0, left: "10px", top: "30px" }, + { offset: 1, left: "20px", top: "40px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + left: "10px", top: "30px" }, + { offset: 1, computedOffset: 1, easing: "linear", + left: "20px", top: "40px" }] }, + { desc: "a one shorthand property two keyframe sequence", + input: [{ offset: 0, margin: "10px" }, + { offset: 1, margin: "20px 30px 40px 50px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + margin: "10px" }, + { offset: 1, computedOffset: 1, easing: "linear", + margin: "20px 30px 40px 50px" }] }, + { desc: "a two property (a shorthand and one of its component longhands)" + + " two keyframe sequence", + input: [{ offset: 0, margin: "10px", marginTop: "20px" }, + { offset: 1, marginTop: "70px", margin: "30px 40px 50px 60px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + margin: "10px", marginTop: "20px" }, + { offset: 1, computedOffset: 1, easing: "linear", + marginTop: "70px", margin: "30px 40px 50px 60px" }] }, + { desc: "a keyframe sequence with duplicate values for a given interior" + + " offset", + input: [{ offset: 0.0, left: "10px" }, + { offset: 0.5, left: "20px" }, + { offset: 0.5, left: "30px" }, + { offset: 0.5, left: "40px" }, + { offset: 1.0, left: "50px" }], + output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", + left: "10px" }, + { offset: 0.5, computedOffset: 0.5, easing: "linear", + left: "20px" }, + { offset: 0.5, computedOffset: 0.5, easing: "linear", + left: "30px" }, + { offset: 0.5, computedOffset: 0.5, easing: "linear", + left: "40px" }, + { offset: 1.0, computedOffset: 1.0, easing: "linear", + left: "50px" }] }, + { desc: "a keyframe sequence with duplicate values for offsets 0 and 1", + input: [{ offset: 0, left: "10px" }, + { offset: 0, left: "20px" }, + { offset: 0, left: "30px" }, + { offset: 1, left: "40px" }, + { offset: 1, left: "50px" }, + { offset: 1, left: "60px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, + { offset: 0, computedOffset: 0, easing: "linear", left: "20px" }, + { offset: 0, computedOffset: 0, easing: "linear", left: "30px" }, + { offset: 1, computedOffset: 1, easing: "linear", left: "40px" }, + { offset: 1, computedOffset: 1, easing: "linear", left: "50px" }, + { offset: 1, computedOffset: 1, easing: "linear", left: "60px" }] + }, + { desc: "a two property four keyframe sequence", + input: [{ offset: 0, left: "10px" }, + { offset: 0, top: "20px" }, + { offset: 1, top: "30px" }, + { offset: 1, left: "40px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, + { offset: 0, computedOffset: 0, easing: "linear", top: "20px" }, + { offset: 1, computedOffset: 1, easing: "linear", top: "30px" }, + { offset: 1, computedOffset: 1, easing: "linear", left: "40px" }] + }, + { desc: "a single keyframe sequence with omitted offsets", + input: [{ left: "10px" }], + output: [{ offset: null, computedOffset: 1, easing: "linear", + left: "10px" }] }, + { desc: "a one property keyframe sequence with some omitted offsets", + input: [{ offset: 0.00, left: "10px" }, + { offset: 0.25, left: "20px" }, + { left: "30px" }, + { left: "40px" }, + { offset: 1.00, left: "50px" }], + output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", + left: "10px" }, + { offset: 0.25, computedOffset: 0.25, easing: "linear", + left: "20px" }, + { offset: null, computedOffset: 0.50, easing: "linear", + left: "30px" }, + { offset: null, computedOffset: 0.75, easing: "linear", + left: "40px" }, + { offset: 1.00, computedOffset: 1.00, easing: "linear", + left: "50px" }] }, + { desc: "a two property keyframe sequence with some omitted offsets", + input: [{ offset: 0.00, left: "10px", top: "20px" }, + { offset: 0.25, left: "30px" }, + { left: "40px" }, + { left: "50px", top: "60px" }, + { offset: 1.00, left: "70px", top: "80px" }], + output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", + left: "10px", top: "20px" }, + { offset: 0.25, computedOffset: 0.25, easing: "linear", + left: "30px" }, + { offset: null, computedOffset: 0.50, easing: "linear", + left: "40px" }, + { offset: null, computedOffset: 0.75, easing: "linear", + left: "50px", top: "60px" }, + { offset: 1.00, computedOffset: 1.00, easing: "linear", + left: "70px", top: "80px" }] }, + { desc: "a one property keyframe sequence with all omitted offsets", + input: [{ left: "10px" }, + { left: "20px" }, + { left: "30px" }, + { left: "40px" }, + { left: "50px" }], + output: [{ offset: null, computedOffset: 0.00, easing: "linear", + left: "10px" }, + { offset: null, computedOffset: 0.25, easing: "linear", + left: "20px" }, + { offset: null, computedOffset: 0.50, easing: "linear", + left: "30px" }, + { offset: null, computedOffset: 0.75, easing: "linear", + left: "40px" }, + { offset: null, computedOffset: 1.00, easing: "linear", + left: "50px" }] }, + { desc: "a keyframe sequence with different easing values, but the same" + + " easing value for a given offset", + input: [{ offset: 0.0, easing: "ease", left: "10px"}, + { offset: 0.0, easing: "ease", top: "20px"}, + { offset: 0.5, easing: "linear", left: "30px" }, + { offset: 0.5, easing: "linear", top: "40px" }, + { offset: 1.0, easing: "step-end", left: "50px" }, + { offset: 1.0, easing: "step-end", top: "60px" }], + output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", + left: "10px" }, + { offset: 0.0, computedOffset: 0.0, easing: "ease", + top: "20px" }, + { offset: 0.5, computedOffset: 0.5, easing: "linear", + left: "30px" }, + { offset: 0.5, computedOffset: 0.5, easing: "linear", + top: "40px" }, + { offset: 1.0, computedOffset: 1.0, easing: "step-end", + left: "50px" }, + { offset: 1.0, computedOffset: 1.0, easing: "step-end", + top: "60px" }] }, + { desc: "a keyframe sequence with different composite values, but the" + + " same composite value for a given offset", + input: [{ offset: 0.0, composite: "replace", left: "10px" }, + { offset: 0.0, composite: "replace", top: "20px" }, + { offset: 0.5, composite: "add", left: "30px" }, + { offset: 0.5, composite: "add", top: "40px" }, + { offset: 1.0, composite: "replace", left: "50px" }, + { offset: 1.0, composite: "replace", top: "60px" }], + output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", + composite: "replace", left: "10px" }, + { offset: 0.0, computedOffset: 0.0, easing: "linear", + composite: "replace", top: "20px" }, + { offset: 0.5, computedOffset: 0.0, easing: "linear", + composite: "add", left: "30px" }, + { offset: 0.5, computedOffset: 0.0, easing: "linear", + composite: "add", top: "40px" }, + { offset: 1.0, computedOffset: 1.0, easing: "linear", + composite: "replace", left: "50px" }, + { offset: 1.0, computedOffset: 1.0, easing: "linear", + composite: "replace", top: "60px" }] }, + { desc: "a one property two keyframe sequence that needs to stringify" + + " its values", + input: [{ offset: 0, opacity: 0 }, + { offset: 1, opacity: 1 }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", opacity: "0" }, + { offset: 1, computedOffset: 1, easing: "linear", opacity: "1" }] + }, + { desc: "a keyframe sequence where shorthand precedes longhand", + input: [{ offset: 0, margin: "10px", marginRight: "20px" }, + { offset: 1, margin: "30px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + margin: "10px", marginRight: "20px" }, + { offset: 1, computedOffset: 1, easing: "linear", + margin: "30px" }] }, + { desc: "a keyframe sequence where longhand precedes shorthand", + input: [{ offset: 0, marginRight: "20px", margin: "10px" }, + { offset: 1, margin: "30px" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + marginRight: "20px", margin: "10px" }, + { offset: 1, computedOffset: 1, easing: "linear", + margin: "30px" }] }, + { desc: "a keyframe sequence where lesser shorthand precedes greater" + + " shorthand", + input: [{ offset: 0, + borderLeft: "1px solid rgb(1, 2, 3)", + border: "2px dotted rgb(4, 5, 6)" }, + { offset: 1, border: "3px dashed rgb(7, 8, 9)" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + borderLeft: "1px solid rgb(1, 2, 3)", + border: "2px dotted rgb(4, 5, 6)" }, + { offset: 1, computedOffset: 1, easing: "linear", + border: "3px dashed rgb(7, 8, 9)" }] }, + { desc: "a keyframe sequence where greater shorthand precedes lesser" + + " shorthand", + input: [{ offset: 0, border: "2px dotted rgb(4, 5, 6)", + borderLeft: "1px solid rgb(1, 2, 3)" }, + { offset: 1, border: "3px dashed rgb(7, 8, 9)" }], + output: [{ offset: 0, computedOffset: 0, easing: "linear", + border: "2px dotted rgb(4, 5, 6)", + borderLeft: "1px solid rgb(1, 2, 3)" }, + { offset: 1, computedOffset: 1, easing: "linear", + border: "3px dashed rgb(7, 8, 9)" }] } +]; + +var gInvalidKeyframesTests = [ + { desc: "keyframes with an out-of-bounded positive offset", + input: [ { opacity: 0 }, + { opacity: 0.5, offset: 2 }, + { opacity: 1 } ], + expected: { name: "TypeError" } }, + { desc: "keyframes with an out-of-bounded negative offset", + input: [ { opacity: 0 }, + { opacity: 0.5, offset: -1 }, + { opacity: 1 } ], + expected: { name: "TypeError" } }, + { desc: "keyframes not loosely sorted by offset", + input: [ { opacity: 0, offset: 1 }, + { opacity: 1, offset: 0 } ], + expected: { name: "TypeError" } }, + { desc: "property-indexed keyframes with an invalid easing value", + input: { opacity: [ 0, 0.5, 1 ], + easing: "inherit" }, + expected: { name: "TypeError" } }, + { desc: "a keyframe sequence with an invalid easing value", + input: [ { opacity: 0, easing: "jumpy" }, + { opacity: 1 } ], + expected: { name: "TypeError" } }, + { desc: "keyframes with an invalid composite value", + input: [ { opacity: 0, composite: "alternate" }, + { opacity: 1 } ], + expected: { name: "TypeError" } } +]; + +// ------------------------------ +// KeyframeEffectOptions +// ------------------------------ + +var gKeyframeEffectOptionTests = [ + { desc: "an empty KeyframeEffectOptions object", + input: { }, + expected: { } }, + { desc: "a normal KeyframeEffectOptions object", + input: { delay: 1000, + fill: "auto", + iterations: 5.5, + duration: "auto", + direction: "alternate" }, + expected: { delay: 1000, + fill: "auto", + iterations: 5.5, + duration: "auto", + direction: "alternate" } }, + { desc: "a double value", + input: 3000, + expected: { duration: 3000 } }, + { desc: "+Infinity", + input: Infinity, + expected: { duration: Infinity } }, + { desc: "an Infinity duration", + input: { duration: Infinity }, + expected: { duration: Infinity } }, + { desc: "an auto duration", + input: { duration: "auto" }, + expected: { duration: "auto" } }, + { desc: "an Infinity iterations", + input: { iterations: Infinity }, + expected: { iterations: Infinity } }, + { desc: "an auto fill", + input: { fill: "auto" }, + expected: { fill: "auto" } }, + { desc: "a forwards fill", + input: { fill: "forwards" }, + expected: { fill: "forwards" } } +]; + +var gInvalidKeyframeEffectOptionTests = [ + { desc: "-Infinity", + input: -Infinity, + expected: { name: "TypeError" } }, + { desc: "NaN", + input: NaN, + expected: { name: "TypeError" } }, + { desc: "a negative value", + input: -1, + expected: { name: "TypeError" } }, + { desc: "a negative Infinity duration", + input: { duration: -Infinity }, + expected: { name: "TypeError" } }, + { desc: "a NaN duration", + input: { duration: NaN }, + expected: { name: "TypeError" } }, + { desc: "a negative duration", + input: { duration: -1 }, + expected: { name: "TypeError" } }, + { desc: "a string duration", + input: { duration: "merrychristmas" }, + expected: { name: "TypeError" } }, + { desc: "a negative Infinity iterations", + input: { iterations: -Infinity}, + expected: { name: "TypeError" } }, + { desc: "a NaN iterations", + input: { iterations: NaN }, + expected: { name: "TypeError" } }, + { desc: "a negative iterations", + input: { iterations: -1 }, + expected: { name: "TypeError" } }, + { desc: "a blank easing", + input: { easing: "" }, + expected: { name: "TypeError" } }, + { desc: "an unrecognized easing", + input: { easing: "unrecognised" }, + expected: { name: "TypeError" } }, + { desc: "an 'initial' easing", + input: { easing: "initial" }, + expected: { name: "TypeError" } }, + { desc: "an 'inherit' easing", + input: { easing: "inherit" }, + expected: { name: "TypeError" } }, + { desc: "a variable easing", + input: { easing: "var(--x)" }, + expected: { name: "TypeError" } }, + { desc: "a multi-value easing", + input: { easing: "ease-in-out, ease-out" }, + expected: { name: "TypeError" } } +]; diff --git a/tests/wpt/web-platform-tests/web-animations/testcommon.js b/tests/wpt/web-platform-tests/web-animations/testcommon.js index ab54202f10e..5ba03082a9c 100644 --- a/tests/wpt/web-platform-tests/web-animations/testcommon.js +++ b/tests/wpt/web-platform-tests/web-animations/testcommon.js @@ -8,9 +8,23 @@ policies and contribution forms [3]. [3] http://www.w3.org/2004/10/27-testcases */ -"use strict"; +'use strict'; + var MS_PER_SEC = 1000; +// The recommended minimum precision to use for time values[1]. +// +// [1] https://w3c.github.io/web-animations/#precision-of-time-values +var TIME_PRECISION = 0.0005; // ms + +// Allow implementations to substitute an alternative method for comparing +// times based on their precision requirements. +if (!window.assert_times_equal) { + window.assert_times_equal = function(actual, expected, description) { + assert_approx_equals(actual, expected, TIME_PRECISION, description); + } +} + // creates div element, appends it to the document body and // removes the created element during test cleanup function createDiv(test, doc) { diff --git a/tests/wpt/web-platform-tests/web-animations/timing-model/animation-effects/active-time.html b/tests/wpt/web-platform-tests/web-animations/timing-model/animation-effects/active-time.html new file mode 100644 index 00000000000..2fb028fe79b --- /dev/null +++ b/tests/wpt/web-platform-tests/web-animations/timing-model/animation-effects/active-time.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Active time tests</title> +<link rel="help" href="https://w3c.github.io/web-animations/#active-time"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../../testcommon.js"></script> +<body> +<div id="log"></div> +<script> +'use strict'; + +async_test(function(t) { + var div = createDiv(t); + var anim = div.animate({ opacity: [ 0, 1 ] }, { delay: 1 }); + assert_equals(anim.effect.getComputedTiming().progress, null); + anim.finished.then(t.step_func(function() { + assert_equals(anim.effect.getComputedTiming().progress, null); + t.done(); + })); +}, 'Test progress during before and after phase when fill is none'); + +</script> +</body> diff --git a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-currentIteration.html b/tests/wpt/web-platform-tests/web-animations/timing-model/animation-effects/current-iteration.html index b2602d06330..98d47fd8798 100644 --- a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-currentIteration.html +++ b/tests/wpt/web-platform-tests/web-animations/timing-model/animation-effects/current-iteration.html @@ -1,11 +1,10 @@ <!DOCTYPE html> <meta charset=utf-8> -<title>currentIteration of KeyframeEffectReadOnly getComputedTiming() tests</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffectreadonly-getcomputedtiming"> -<link rel="author" title="Daisuke Akatsuka" href="mailto:daisuke@mozilla-japan.org"> +<title>Current iteration tests</title> +<link rel="help" href="https://w3c.github.io/web-animations/#current-iteration"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="../testcommon.js"></script> +<script src="../../testcommon.js"></script> <body> <div id="log"></div> <script> diff --git a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-progress.html b/tests/wpt/web-platform-tests/web-animations/timing-model/animation-effects/simple-iteration-progress.html index c2ad686a638..a8fb33d738a 100644 --- a/tests/wpt/web-platform-tests/web-animations/keyframe-effect/getComputedTiming-progress.html +++ b/tests/wpt/web-platform-tests/web-animations/timing-model/animation-effects/simple-iteration-progress.html @@ -1,11 +1,11 @@ <!DOCTYPE html> <meta charset=utf-8> -<title>progress of KeyframeEffectReadOnly getComputedTiming() tests</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffectreadonly-getcomputedtiming"> -<link rel="author" title="Daisuke Akatsuka" href="mailto:daisuke@mozilla-japan.org"> +<title>Simple iteration progress tests</title> +<link rel="help" + href="https://w3c.github.io/web-animations/#simple-iteration-progress"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="../testcommon.js"></script> +<script src="../../testcommon.js"></script> <body> <div id="log"></div> <script> @@ -34,16 +34,6 @@ function executeTests(tests, description) { }); } -async_test(function(t) { - var div = createDiv(t); - var anim = div.animate({ opacity: [ 0, 1 ] }, { delay: 1 }); - assert_equals(anim.effect.getComputedTiming().progress, null); - anim.finished.then(t.step_func(function() { - assert_equals(anim.effect.getComputedTiming().progress, null); - t.done(); - })); -}, 'Test progress during before and after phase when fill is none'); - var gTests_zero_iterations = [ { input: { iterations: 0, diff --git a/tests/wpt/web-platform-tests/web-animations/timing-model/animations/set-the-animation-start-time.html b/tests/wpt/web-platform-tests/web-animations/timing-model/animations/set-the-animation-start-time.html new file mode 100644 index 00000000000..60e70bafafb --- /dev/null +++ b/tests/wpt/web-platform-tests/web-animations/timing-model/animations/set-the-animation-start-time.html @@ -0,0 +1,205 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Setting the start time tests</title> +<link rel="help" href="https://w3c.github.io/web-animations/#set-the-animation-start-time"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../../testcommon.js"></script> +<body> +<div id="log"></div> +<script> +'use strict'; + +test(function(t) +{ + // It should only be possible to set *either* the start time or the current + // time for an animation that does not have an active timeline. + + var animation = + new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC)); + + assert_equals(animation.currentTime, null, 'Intial current time'); + assert_equals(animation.startTuime, null, 'Intial start time'); + + animation.currentTime = 1000; + assert_equals(animation.currentTime, 1000, + 'Setting the current time succeeds'); + assert_equals(animation.startTime, null, + 'Start time remains null after setting current time'); + + animation.startTime = 1000; + assert_equals(animation.startTime, 1000, + 'Setting the start time succeeds'); + assert_equals(animation.currentTime, null, + 'Setting the start time clears the current time'); + + animation.startTime = null; + assert_equals(animation.startTime, null, + 'Setting the start time to an unresolved time succeeds'); + assert_equals(animation.currentTime, null, 'The current time is unaffected'); + +}, 'Setting the start time of an animation without an active timeline'); + +test(function(t) +{ + // Setting an unresolved start time on an animation without an active + // timeline should not clear the current time. + + var animation = + new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC)); + + assert_equals(animation.currentTime, null, 'Intial current time'); + assert_equals(animation.startTuime, null, 'Intial start time'); + + animation.currentTime = 1000; + assert_equals(animation.currentTime, 1000, + 'Setting the current time succeeds'); + assert_equals(animation.startTime, null, + 'Start time remains null after setting current time'); + + animation.startTime = null; + assert_equals(animation.startTime, null, 'Start time remains unresolved'); + assert_equals(animation.currentTime, 1000, 'Current time is unaffected'); + +}, 'Setting an unresolved start time an animation without an active timeline' + + ' does not clear the current time'); + +test(function(t) +{ + var animation = + new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC), + document.timeline); + + // So long as a hold time is set, querying the current time will return + // the hold time. + + // Since the start time is unresolved at this point, setting the current time + // will set the hold time + animation.currentTime = 1000; + assert_equals(animation.currentTime, 1000, + 'The current time is calculated from the hold time'); + + // If we set the start time, however, we should clear the hold time. + animation.startTime = document.timeline.currentTime - 2000; + assert_times_equal(animation.currentTime, 2000, + 'The current time is calculated from the start time,' + + ' not the hold time'); + + // Sanity check + assert_equals(animation.playState, 'running', + 'Animation reports it is running after setting a resolved' + + ' start time'); +}, 'Setting the start time clears the hold time'); + +test(function(t) +{ + var animation = + new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC), + document.timeline); + + // Set up a running animation (i.e. both start time and current time + // are resolved). + animation.startTime = document.timeline.currentTime - 1000; + assert_equals(animation.playState, 'running'); + assert_times_equal(animation.currentTime, 1000, + 'Current time is resolved for a running animation') + + // Clear start time + animation.startTime = null; + assert_times_equal(animation.currentTime, 1000, + 'Hold time is set after start time is made unresolved'); + assert_equals(animation.playState, 'paused', + 'Animation reports it is paused after setting an unresolved' + + ' start time'); +}, 'Setting an unresolved start time sets the hold time'); + +promise_test(function(t) +{ + var animation = + new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC), + document.timeline); + + var readyPromiseCallbackCalled = false; + animation.ready.then(function() { readyPromiseCallbackCalled = true; } ); + + // Put the animation in the play-pending state + animation.play(); + + // Sanity check + assert_equals(animation.playState, 'pending', + 'Animation is in play-pending state'); + + // Setting the start time should resolve the 'ready' promise, i.e. + // it should schedule a microtask to run the promise callbacks. + animation.startTime = document.timeline.currentTime; + assert_false(readyPromiseCallbackCalled, + 'Ready promise callback is not called synchronously'); + + // If we schedule another microtask then it should run immediately after + // the ready promise resolution microtask. + return Promise.resolve().then(function() { + assert_true(readyPromiseCallbackCalled, + 'Ready promise callback called after setting startTime'); + }); +}, 'Setting the start time resolves a pending ready promise'); + +promise_test(function(t) +{ + var animation = + new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC), + document.timeline); + + var readyPromiseCallbackCalled = false; + animation.ready.then(function() { readyPromiseCallbackCalled = true; } ); + + // Put the animation in the pause-pending state + animation.startTime = document.timeline.currentTime; + animation.pause(); + + // Sanity check + assert_equals(animation.playState, 'pending', + 'Animation is in pause-pending state'); + + // Setting the start time should resolve the 'ready' promise although + // the resolution callbacks when be run in a separate microtask. + animation.startTime = null; + assert_false(readyPromiseCallbackCalled, + 'Ready promise callback is not called synchronously'); + + return Promise.resolve().then(function() { + assert_true(readyPromiseCallbackCalled, + 'Ready promise callback called after setting startTime'); + }); +}, 'Setting the start time resolves a pending pause task'); + +promise_test(function(t) +{ + var animation = + new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC), + document.timeline); + + // Set start time such that the current time is past the end time + animation.startTime = document.timeline.currentTime + - 110 * MS_PER_SEC; + assert_equals(animation.playState, 'finished', + 'Seeked to finished state using the startTime'); + + // If the 'did seek' flag is true, the current time should be greater than + // the effect end. + assert_greater_than(animation.currentTime, + animation.effect.getComputedTiming().endTime, + 'Setting the start time updated the finished state with' + + ' the \'did seek\' flag set to true'); + + // Furthermore, that time should persist if we have correctly updated + // the hold time + var finishedCurrentTime = animation.currentTime; + return waitForAnimationFrames(1).then(function() { + assert_equals(animation.currentTime, finishedCurrentTime, + 'Current time does not change after seeking past the effect' + + ' end time by setting the current time'); + }); +}, 'Setting the start time updates the finished state'); + +</script> +</body> |