diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini index 3605e8f3fc9..76b44d9e9cf 100644 --- a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -4,7 +4,7 @@ expected: TIMEOUT [Opening a blob URL in a new window immediately before revoking it works.] - expected: TIMEOUT + expected: FAIL [Fetching a blob URL immediately before revoking it works in an iframe.] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini new file mode 100644 index 00000000000..4bfb0c2053a --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-004.html] + [Miss float below something else] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini new file mode 100644 index 00000000000..baa9f1a7541 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-005.html] + [Miss clipped float] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-minimum-width-flex-items-013.html.ini b/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-minimum-width-flex-items-013.html.ini new file mode 100644 index 00000000000..d28e9d2c2ed --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-flexbox/flex-minimum-width-flex-items-013.html.ini @@ -0,0 +1,2 @@ +[flex-minimum-width-flex-items-013.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-015.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-015.html.ini new file mode 100644 index 00000000000..60f446a833e --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-015.html.ini @@ -0,0 +1,2 @@ +[pre-wrap-leading-spaces-015.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-016.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-016.html.ini new file mode 100644 index 00000000000..f2179192fb0 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-016.html.ini @@ -0,0 +1,2 @@ +[pre-wrap-leading-spaces-016.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-017.html.ini b/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-017.html.ini new file mode 100644 index 00000000000..76d72b1d5ae --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/css-text/white-space/pre-wrap-leading-spaces-017.html.ini @@ -0,0 +1,2 @@ +[pre-wrap-leading-spaces-017.html] + expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPoint-001.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPoint-001.html.ini deleted file mode 100644 index e38782d8c85..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPoint-001.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementFromPoint-001.html] - [CSSOM View - 5 - extensions to the Document interface] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini deleted file mode 100644 index e181af5397f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementsFromPoint-invalid-cases.html] - [The root element is the last element returned for otherwise empty queries within the viewport] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini new file mode 100644 index 00000000000..239c35135e4 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/offsetTopLeft-border-box.html.ini @@ -0,0 +1,7 @@ +[offsetTopLeft-border-box.html] + [container: 1] + expected: FAIL + + [container: 0] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/geometry/DOMMatrixInit-validate-fixup.html.ini b/tests/wpt/metadata-layout-2020/css/geometry/DOMMatrixInit-validate-fixup.html.ini new file mode 100644 index 00000000000..a45217daca9 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/geometry/DOMMatrixInit-validate-fixup.html.ini @@ -0,0 +1,7 @@ +[DOMMatrixInit-validate-fixup.html] + [{f: NaN, m42: NaN, is2D: true} (2d)] + expected: FAIL + + [{f: NaN, m42: NaN} (2d)] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/dom/events/Event-dispatch-click.html.ini b/tests/wpt/metadata-layout-2020/dom/events/Event-dispatch-click.html.ini index 0a32f1b8c1c..cc89f8c8d33 100644 --- a/tests/wpt/metadata-layout-2020/dom/events/Event-dispatch-click.html.ini +++ b/tests/wpt/metadata-layout-2020/dom/events/Event-dispatch-click.html.ini @@ -2,15 +2,6 @@ [event state during post-click handling] expected: FAIL - [disabled radio should be checked from dispatchEvent(new MouseEvent("click"))] - expected: FAIL - - [disabled checkbox should be checked from dispatchEvent(new MouseEvent("click"))] - expected: FAIL - - [disabled radio should get legacy-canceled-activation behavior] - expected: FAIL - - [disabled checkbox should get legacy-canceled-activation behavior] + [submit button should not activate if the event listener disables it] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/dom/events/Event-dispatch-click.tentative.html.ini b/tests/wpt/metadata-layout-2020/dom/events/Event-dispatch-click.tentative.html.ini new file mode 100644 index 00000000000..347df77e70b --- /dev/null +++ b/tests/wpt/metadata-layout-2020/dom/events/Event-dispatch-click.tentative.html.ini @@ -0,0 +1,7 @@ +[Event-dispatch-click.tentative.html] + [radio morphed into another type should not steal the existing checked state] + expected: FAIL + + [checkbox morphed into another type should not mutate checked state] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/fetch/connection-pool/network-partition-key.html.ini b/tests/wpt/metadata-layout-2020/fetch/connection-pool/network-partition-key.html.ini index 890d1fb5747..1e41dc5e034 100644 --- a/tests/wpt/metadata-layout-2020/fetch/connection-pool/network-partition-key.html.ini +++ b/tests/wpt/metadata-layout-2020/fetch/connection-pool/network-partition-key.html.ini @@ -1,25 +1,24 @@ [network-partition-key.html] - expected: TIMEOUT [Iframes] expected: FAIL [CSP sandbox] - expected: NOTRUN + expected: FAIL [Workers] - expected: TIMEOUT + expected: FAIL [Cross-site resources without credentials] expected: FAIL [about:blank from opaque origin iframe] - expected: NOTRUN + expected: FAIL [Without credentials] expected: FAIL [Workers with cross-site resources] - expected: NOTRUN + expected: FAIL [Cross-site resources with credentials] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index 36cdf3deaa9..6d548fe4825 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -312,24 +312,24 @@ [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] expected: NOTRUN - [ + diff --git a/tests/wpt/web-platform-tests/cors/resources/preflight-partitioning.py b/tests/wpt/web-platform-tests/cors/resources/preflight-partitioning.py new file mode 100644 index 00000000000..d0d9a4ebb6c --- /dev/null +++ b/tests/wpt/web-platform-tests/cors/resources/preflight-partitioning.py @@ -0,0 +1,35 @@ +def main(request, response): + headers = [(b"Content-Type", b"text/plain")] + headers.append((b"Access-Control-Allow-Origin", b"*")) + + if request.method == u"GET": + token = request.GET.first(b"token") + value = request.server.stash.take(token) + if value == None: + body = u"0" + else: + if request.GET.first(b"check", None) == b"keep": + request.server.stash.put(token, value) + body = u"1" + + return headers, body + + if request.method == u"OPTIONS": + if not b"Access-Control-Request-Method" in request.headers: + response.set_error(400, u"No Access-Control-Request-Method header") + return u"ERROR: No access-control-request-method in preflight!" + + headers.append((b"Access-Control-Allow-Methods", + request.headers[b'Access-Control-Request-Method'])) + + if b"max_age" in request.GET: + headers.append((b"Access-Control-Max-Age", request.GET[b'max_age'])) + + if b"token" in request.GET: + request.server.stash.put(request.GET.first(b"token"), 1) + + headers.append((b"Access-Control-Allow-Headers", b"x-print")) + + body = request.headers.get(b"x-print", b"NO") + + return headers, body diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-011.html b/tests/wpt/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-011.html index 6a0adb70dfd..a0f8c1573c4 100644 --- a/tests/wpt/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-011.html +++ b/tests/wpt/web-platform-tests/css/css-flexbox/flex-aspect-ratio-img-column-011.html @@ -41,9 +41,9 @@
- - + +
diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/flex-minimum-width-flex-items-013.html b/tests/wpt/web-platform-tests/css/css-flexbox/flex-minimum-width-flex-items-013.html index 6ee9ed10b56..9f358d66d7f 100644 --- a/tests/wpt/web-platform-tests/css/css-flexbox/flex-minimum-width-flex-items-013.html +++ b/tests/wpt/web-platform-tests/css/css-flexbox/flex-minimum-width-flex-items-013.html @@ -2,8 +2,9 @@ Flex transferred minimum width + - + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-line-height-ref.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-line-height-ref.html new file mode 100644 index 00000000000..64b0d41a389 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-line-height-ref.html @@ -0,0 +1,42 @@ + + +CSS Reftest Reference + + +
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/marker-line-height.html b/tests/wpt/web-platform-tests/css/css-pseudo/marker-line-height.html new file mode 100644 index 00000000000..8d226e3feaa --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-pseudo/marker-line-height.html @@ -0,0 +1,65 @@ + + +::marker supports 'line-height' + + + + + + +
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. +
  2. +
  3. +
  4. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
+
    +
  1. x
  2. +
  3. x
  4. +
  5. x
  6. +
  7. x
  8. +
diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation.html b/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation.html index 5f7dab7a8bf..df0e9bc6d34 100644 --- a/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation.html +++ b/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation.html @@ -20,7 +20,7 @@ const interpolationTests = [ property: "font", from: "oblique normal 100 ultra-condensed 5px / 20px serif", to: "italic small-caps 900 ultra-expanded 25px / 50px Ahem", - midPoint: ["italic small-caps 500 expanded 15px Ahem", "italic small-caps 500 expanded 15px/normal Ahem"], + midPoint: ["italic small-caps 500 expanded 15px / 35px Ahem", "italic small-caps 500 expanded 15px/35px Ahem"], }, { property: "font-family", @@ -113,6 +113,14 @@ const interpolationTests = [ midPoint: "500", }, + // `line-height` is not a font property but is a longhand of `font`, and is also supported. + { + property: "line-height", + from: "20px", + to: "50px", + midPoint: "35px", + }, + // ::marker supports `white-space` { property: "white-space", @@ -292,15 +300,6 @@ const interpolationTests = [ to: "decimal", midPoint: "disc", }, - - // ::marker does NOT support `line-height` because, despite being a - // longhand of `font`, it's not a font property. - { - property: "line-height", - from: "20px", - to: "50px", - midPoint: "normal", - }, ]; const target = document.getElementById("target"); diff --git a/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties.html b/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties.html index 15a4e894ff3..62a54a338b7 100644 --- a/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties.html +++ b/tests/wpt/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties.html @@ -14,7 +14,7 @@ diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-015.html b/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-015.html new file mode 100644 index 00000000000..9b9b3690e55 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-015.html @@ -0,0 +1,31 @@ + + +CSS Text test: breaking opportunities at leading spaces with white-space:pre-wrap + + + + + + + + + +

Test passes if there is a filled green square and no red.

+
+
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-016.html b/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-016.html new file mode 100644 index 00000000000..57a121815d3 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-016.html @@ -0,0 +1,31 @@ + + +CSS Text test: breaking opportunities at leading spaces with white-space:pre-wrap + + + + + + + + + +

Test passes if there is a filled green square and no red.

+
+
XXXX
X
diff --git a/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-017.html b/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-017.html new file mode 100644 index 00000000000..9aad17e9c5a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/white-space/pre-wrap-leading-spaces-017.html @@ -0,0 +1,31 @@ + + +CSS Text test: breaking opportunities at leading spaces with white-space:pre-wrap + + + + + + + + + +

Test passes if there is a filled green square and no red.

+
+
X
diff --git a/tests/wpt/web-platform-tests/css/geometry/support/dommatrix-test-util.js b/tests/wpt/web-platform-tests/css/geometry/support/dommatrix-test-util.js index af860e2913c..40c336ea8c9 100644 --- a/tests/wpt/web-platform-tests/css/geometry/support/dommatrix-test-util.js +++ b/tests/wpt/web-platform-tests/css/geometry/support/dommatrix-test-util.js @@ -35,7 +35,7 @@ function matrix2D(dict) { return matrix; } -function checkMatrix(actual, expected, { epsilon = 0 } = {}) { +function checkMatrix(actual, expected, { epsilon = Number.MIN_VALUE } = {}) { for (let member in expected) { if (epsilon && typeof expected[member] === "number") { assert_approx_equals(actual[member], expected[member], epsilon, member); diff --git a/tests/wpt/web-platform-tests/docs/writing-tests/file-names.md b/tests/wpt/web-platform-tests/docs/writing-tests/file-names.md index e68af233f15..96296c4ff69 100644 --- a/tests/wpt/web-platform-tests/docs/writing-tests/file-names.md +++ b/tests/wpt/web-platform-tests/docs/writing-tests/file-names.md @@ -36,6 +36,9 @@ themselves precede any test type flag, but are otherwise unordered. `.h2` : Indicates that a test is loaded over HTTP/2. + `.www` + : Indicates that a test is run on the `www` subdomain. + `.sub` : Indicates that a test uses the [server-side substitution](server-pipes.html#sub) feature. diff --git a/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.html b/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.html index 148f4f50d41..bbc408df882 100644 --- a/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.html +++ b/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.html @@ -302,4 +302,50 @@ async_test(function(t) { assert_false(didSubmit) t.done() }, "disconnected form should not submit") + +async_test(t => { + const form = document.createElement("form"); + form.onsubmit = t.step_func(ev => { + ev.preventDefault(); + assert_unreached("The form is unexpectedly submitted."); + }); + dump.append(form); + const input = form.appendChild(document.createElement("input")); + input.type = "submit" + input.disabled = true; + input.dispatchEvent(new MouseEvent("click", { cancelable: true })); + t.done(); +}, "disabled submit button should not activate"); + +async_test(t => { + const form = document.createElement("form"); + form.onsubmit = t.step_func(ev => { + ev.preventDefault(); + assert_unreached("The form is unexpectedly submitted."); + }); + dump.append(form); + const input = form.appendChild(document.createElement("input")); + input.onclick = t.step_func(() => { + input.disabled = true; + }); + input.type = "submit" + input.dispatchEvent(new MouseEvent("click", { cancelable: true })); + t.done(); +}, "submit button should not activate if the event listener disables it"); + +async_test(t => { + const form = document.createElement("form"); + form.onsubmit = t.step_func(ev => { + ev.preventDefault(); + assert_unreached("The form is unexpectedly submitted."); + }); + dump.append(form); + const input = form.appendChild(document.createElement("input")); + input.onclick = t.step_func(() => { + input.type = "submit" + input.disabled = true; + }); + input.click(); + t.done(); +}, "submit button that morphed from checkbox should not activate"); diff --git a/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.tentative.html b/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.tentative.html index 01ce1936a8b..cfdae55ef2a 100644 --- a/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.tentative.html +++ b/tests/wpt/web-platform-tests/dom/events/Event-dispatch-click.tentative.html @@ -49,4 +49,30 @@ test(t => { label.dispatchEvent(new MouseEvent("click")); assert_false(input.checked); }, "disabled radio should not be checked from label click by dispatchEvent"); + +test(t => { + const checkbox = dump.appendChild(document.createElement("input")); + checkbox.type = "checkbox"; + checkbox.onclick = ev => { + checkbox.type = "date"; + ev.preventDefault(); + }; + checkbox.dispatchEvent(new MouseEvent("click", { cancelable: true })); + assert_false(checkbox.checked); +}, "checkbox morphed into another type should not mutate checked state"); + +test(t => { + const radio1 = dump.appendChild(document.createElement("input")); + const radio2 = dump.appendChild(radio1.cloneNode()); + radio1.type = radio2.type = "radio"; + radio1.name = radio2.name = "foo"; + radio2.checked = true; + radio1.onclick = ev => { + radio1.type = "date"; + ev.preventDefault(); + }; + radio1.dispatchEvent(new MouseEvent("click", { cancelable: true })); + assert_false(radio1.checked); + assert_true(radio2.checked); +}, "radio morphed into another type should not steal the existing checked state"); diff --git a/tests/wpt/web-platform-tests/fetch/connection-pool/resources/network-partition-key.py b/tests/wpt/web-platform-tests/fetch/connection-pool/resources/network-partition-key.py index 44ddae7a75d..61e0496fca3 100644 --- a/tests/wpt/web-platform-tests/fetch/connection-pool/resources/network-partition-key.py +++ b/tests/wpt/web-platform-tests/fetch/connection-pool/resources/network-partition-key.py @@ -1,11 +1,9 @@ #!/usr/bin/env python -import datetime -import json import mimetypes import os -import sys -import time + +from wptserve.utils import isomorphic_decode, isomorphic_encode # Test server that tracks the last partition_id was used with each connection for each uuid, and # lets consumers query if multiple different partition_ids have been been used for any socket. @@ -27,17 +25,17 @@ def main(request, response): # Unless nocheck_partition is true, check partition_id against server_state, and update server_state. stash = request.server.stash test_failed = False - if request.GET.first(b"nocheck_partition", None) != "True": + if request.GET.first(b"nocheck_partition", None) != b"True": # Need to grab the lock to access the Stash, since requests are made in parallel. with stash.lock: # Don't use server hostname here, since H2 allows multiple hosts to reuse a connection. # Server IP is not currently available, unfortunately. - address_key = str(request.client_address) + "|" + str(request.url_parts.port) - server_state = stash.take(uuid) or { "test_failed": False } + address_key = isomorphic_encode(str(request.client_address) + u"|" + str(request.url_parts.port)) + server_state = stash.take(uuid) or {b"test_failed": False} if address_key in server_state and server_state[address_key] != partition_id: - server_state["test_failed"] = True + server_state[b"test_failed"] = True server_state[address_key] = partition_id - test_failed = server_state["test_failed"] + test_failed = server_state[b"test_failed"] stash.put(uuid, server_state) origin = request.headers.get(b"Origin") @@ -48,18 +46,18 @@ def main(request, response): if request.method == u"OPTIONS": return handle_preflight(request, response) - if dispatch == u"fetch_file": + if dispatch == b"fetch_file": return handle_fetch_file(request, response, partition_id, uuid) - if dispatch == u"check_partition": + if dispatch == b"check_partition": if test_failed: return simple_response(request, response, 200, b"OK", b"Multiple partition IDs used on a socket") return simple_response(request, response, 200, b"OK", b"ok") - if dispatch == u"clean_up": + if dispatch == b"clean_up": stash.take(uuid) if test_failed: - return simple_response(request, response, 200, b"OK", b"Test failed, but cleanup completed.") + return simple_response(request, response, 200, b"OK", b"Test failed, but cleanup completed.") return simple_response(request, response, 200, b"OK", b"cleanup complete") return simple_response(request, response, 404, b"Not Found", b"Unrecognized dispatch parameter: " + dispatch) @@ -71,7 +69,7 @@ def handle_preflight(request, response): response.headers.set(b"Access-Control-Max-Age", b"86400") return b"Preflight request" -def simple_response(request, response, status_code, status_message, body, content_type="text/plain"): +def simple_response(request, response, status_code, status_message, body, content_type=b"text/plain"): response.status = (status_code, status_message) response.headers.set(b"Content-Type", content_type) return body @@ -85,29 +83,29 @@ def handle_fetch_file(request, response, partition_id, uuid): if not subresource_origin or not rel_path or not include_credentials: return simple_response(request, response, 404, b"Not found", b"Invalid query parameters") - cur_path = os.path.realpath(__file__) + cur_path = os.path.realpath(isomorphic_decode(__file__)) base_path = os.path.abspath(os.path.join(os.path.dirname(cur_path), os.pardir, os.pardir, os.pardir)) - path = os.path.abspath(os.path.join(base_path, rel_path)) + path = os.path.abspath(os.path.join(base_path, isomorphic_decode(rel_path))) # Basic security check. if not path.startswith(base_path): return simple_response(request, response, 404, b"Not found", b"Invalid path") sandbox = request.GET.first(b"sandbox", None) - if sandbox == "true": - response.headers.set(b"Content-Security-Policy", "sandbox allow-scripts") + if sandbox == b"true": + response.headers.set(b"Content-Security-Policy", b"sandbox allow-scripts") - file = open(path, mode="r") + file = open(path, mode="rb") body = file.read() file.close() - subresource_path = "/" + os.path.relpath(__file__, base_path).replace('\\','/') - subresource_params = "?partition_id=" + partition_id + "&uuid=" + uuid + "&subresource_origin=" + subresource_origin + "&include_credentials=" + include_credentials - body = body.replace("SUBRESOURCE_PREFIX:", subresource_origin + subresource_path + subresource_params) + subresource_path = b"/" + isomorphic_encode(os.path.relpath(isomorphic_decode(__file__), base_path)).replace(b'\\', b'/') + subresource_params = b"?partition_id=" + partition_id + b"&uuid=" + uuid + b"&subresource_origin=" + subresource_origin + b"&include_credentials=" + include_credentials + body = body.replace(b"SUBRESOURCE_PREFIX:", subresource_origin + subresource_path + subresource_params) other_origin = request.GET.first(b"other_origin", None) if other_origin: - body = body.replace("OTHER_PREFIX:", other_origin + subresource_path + subresource_params) + body = body.replace(b"OTHER_PREFIX:", other_origin + subresource_path + subresource_params) mimetypes.init() mimetype_pair = mimetypes.guess_type(path) diff --git a/tests/wpt/web-platform-tests/html/canvas/element/drawing-text-to-the-canvas/2d.text.drawing.style.fontVariant.settings.html b/tests/wpt/web-platform-tests/html/canvas/element/drawing-text-to-the-canvas/2d.text.drawing.style.fontVariant.settings.html new file mode 100644 index 00000000000..c1d6272aa11 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/canvas/element/drawing-text-to-the-canvas/2d.text.drawing.style.fontVariant.settings.html @@ -0,0 +1,75 @@ + + +Canvas test: 2d.text.drawing.style.fontVariant.settings + + + + + + +

2d.text.drawing.style.fontVariant.settings

+

Testing basic functionalities of fontKerning for canvas

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/tests/wpt/web-platform-tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.html b/tests/wpt/web-platform-tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.html new file mode 100644 index 00000000000..d4f9413f954 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.html @@ -0,0 +1,75 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.fontVariant.settings + + + + +

2d.text.drawing.style.fontVariant.settings

+

Testing basic functionalities of fontKerning for canvas

+ + + diff --git a/tests/wpt/web-platform-tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.worker.js b/tests/wpt/web-platform-tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.worker.js new file mode 100644 index 00000000000..d90bdd5f032 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.worker.js @@ -0,0 +1,71 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.fontVariant.settings +// Description:Testing basic functionalities of fontKerning for canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing basic functionalities of fontKerning for canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + +var offscreenCanvas = new OffscreenCanvas(100, 50); +var ctx = offscreenCanvas.getContext('2d'); + +// Setting fontVariantCaps with lower cases +_assertSame(ctx.fontVariantCaps, "Normal", "ctx.fontVariantCaps", "\"Normal\""); + +ctx.fontVariantCaps = "normal"; +_assertSame(ctx.fontVariantCaps, "Normal", "ctx.fontVariantCaps", "\"Normal\""); + +ctx.fontVariantCaps = "small-caps"; +_assertSame(ctx.fontVariantCaps, "SmallCaps", "ctx.fontVariantCaps", "\"SmallCaps\""); + +ctx.fontVariantCaps = "all-small-caps"; +_assertSame(ctx.fontVariantCaps, "AllSmallCaps", "ctx.fontVariantCaps", "\"AllSmallCaps\""); + +ctx.fontVariantCaps = "petite-caps"; +_assertSame(ctx.fontVariantCaps, "PetiteCaps", "ctx.fontVariantCaps", "\"PetiteCaps\""); + +ctx.fontVariantCaps = "all-petite-caps"; +_assertSame(ctx.fontVariantCaps, "AllPetiteCaps", "ctx.fontVariantCaps", "\"AllPetiteCaps\""); + +ctx.fontVariantCaps = "unicase"; +_assertSame(ctx.fontVariantCaps, "Unicase", "ctx.fontVariantCaps", "\"Unicase\""); + +ctx.fontVariantCaps = "titling-caps"; +_assertSame(ctx.fontVariantCaps, "TitlingCaps", "ctx.fontVariantCaps", "\"TitlingCaps\""); + +// Setting fontVariantCaps with lower cases and upper cases word. +ctx.fontVariantCaps = "nORmal"; +_assertSame(ctx.fontVariantCaps, "Normal", "ctx.fontVariantCaps", "\"Normal\""); + +ctx.fontVariantCaps = "smaLL-caps"; +_assertSame(ctx.fontVariantCaps, "SmallCaps", "ctx.fontVariantCaps", "\"SmallCaps\""); + +ctx.fontVariantCaps = "all-small-CAPS"; +_assertSame(ctx.fontVariantCaps, "AllSmallCaps", "ctx.fontVariantCaps", "\"AllSmallCaps\""); + +ctx.fontVariantCaps = "pEtitE-caps"; +_assertSame(ctx.fontVariantCaps, "PetiteCaps", "ctx.fontVariantCaps", "\"PetiteCaps\""); + +ctx.fontVariantCaps = "All-Petite-Caps"; +_assertSame(ctx.fontVariantCaps, "AllPetiteCaps", "ctx.fontVariantCaps", "\"AllPetiteCaps\""); + +ctx.fontVariantCaps = "uNIcase"; +_assertSame(ctx.fontVariantCaps, "Unicase", "ctx.fontVariantCaps", "\"Unicase\""); + +ctx.fontVariantCaps = "titling-CAPS"; +_assertSame(ctx.fontVariantCaps, "TitlingCaps", "ctx.fontVariantCaps", "\"TitlingCaps\""); + +// Setting fontVariantCaps with non-existing font variant. +ctx.fontVariantCaps = "abcd"; +_assertSame(ctx.fontVariantCaps, "TitlingCaps", "ctx.fontVariantCaps", "\"TitlingCaps\""); +t.done(); + +}); +done(); diff --git a/tests/wpt/web-platform-tests/html/canvas/tools/yaml/element/drawing-text-to-the-canvas.yaml b/tests/wpt/web-platform-tests/html/canvas/tools/yaml/element/drawing-text-to-the-canvas.yaml index 921464e6bc7..0f8a118ca8d 100644 --- a/tests/wpt/web-platform-tests/html/canvas/tools/yaml/element/drawing-text-to-the-canvas.yaml +++ b/tests/wpt/web-platform-tests/html/canvas/tools/yaml/element/drawing-text-to-the-canvas.yaml @@ -842,4 +842,59 @@ ctx.fontKerning = "NONE"; @assert ctx.fontKerning === "None"; +- name: 2d.text.drawing.style.fontVariant.settings + desc: Testing basic functionalities of fontKerning for canvas + testing: + - 2d.text.drawing.style.fontVariantCaps + code: | + // Setting fontVariantCaps with lower cases + @assert ctx.fontVariantCaps === "Normal"; + + ctx.fontVariantCaps = "normal"; + @assert ctx.fontVariantCaps === "Normal"; + + ctx.fontVariantCaps = "small-caps"; + @assert ctx.fontVariantCaps === "SmallCaps"; + + ctx.fontVariantCaps = "all-small-caps"; + @assert ctx.fontVariantCaps === "AllSmallCaps"; + + ctx.fontVariantCaps = "petite-caps"; + @assert ctx.fontVariantCaps === "PetiteCaps"; + + ctx.fontVariantCaps = "all-petite-caps"; + @assert ctx.fontVariantCaps === "AllPetiteCaps"; + + ctx.fontVariantCaps = "unicase"; + @assert ctx.fontVariantCaps === "Unicase"; + + ctx.fontVariantCaps = "titling-caps"; + @assert ctx.fontVariantCaps === "TitlingCaps"; + + // Setting fontVariantCaps with lower cases and upper cases word. + ctx.fontVariantCaps = "nORmal"; + @assert ctx.fontVariantCaps === "Normal"; + + ctx.fontVariantCaps = "smaLL-caps"; + @assert ctx.fontVariantCaps === "SmallCaps"; + + ctx.fontVariantCaps = "all-small-CAPS"; + @assert ctx.fontVariantCaps === "AllSmallCaps"; + + ctx.fontVariantCaps = "pEtitE-caps"; + @assert ctx.fontVariantCaps === "PetiteCaps"; + + ctx.fontVariantCaps = "All-Petite-Caps"; + @assert ctx.fontVariantCaps === "AllPetiteCaps"; + + ctx.fontVariantCaps = "uNIcase"; + @assert ctx.fontVariantCaps === "Unicase"; + + ctx.fontVariantCaps = "titling-CAPS"; + @assert ctx.fontVariantCaps === "TitlingCaps"; + + // Setting fontVariantCaps with non-existing font variant. + ctx.fontVariantCaps = "abcd"; + @assert ctx.fontVariantCaps === "TitlingCaps"; + # TODO: shadows, alpha, composite, clip \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/html/canvas/tools/yaml/offscreen/text.yaml b/tests/wpt/web-platform-tests/html/canvas/tools/yaml/offscreen/text.yaml index 16187397eb3..9a895bc5185 100644 --- a/tests/wpt/web-platform-tests/html/canvas/tools/yaml/offscreen/text.yaml +++ b/tests/wpt/web-platform-tests/html/canvas/tools/yaml/offscreen/text.yaml @@ -1343,4 +1343,60 @@ @assert ctx.fontKerning === "None"; t.done(); +- name: 2d.text.drawing.style.fontVariant.settings + desc: Testing basic functionalities of fontKerning for canvas + testing: + - 2d.text.drawing.style.fontVariantCaps + code: | + // Setting fontVariantCaps with lower cases + @assert ctx.fontVariantCaps === "Normal"; + + ctx.fontVariantCaps = "normal"; + @assert ctx.fontVariantCaps === "Normal"; + + ctx.fontVariantCaps = "small-caps"; + @assert ctx.fontVariantCaps === "SmallCaps"; + + ctx.fontVariantCaps = "all-small-caps"; + @assert ctx.fontVariantCaps === "AllSmallCaps"; + + ctx.fontVariantCaps = "petite-caps"; + @assert ctx.fontVariantCaps === "PetiteCaps"; + + ctx.fontVariantCaps = "all-petite-caps"; + @assert ctx.fontVariantCaps === "AllPetiteCaps"; + + ctx.fontVariantCaps = "unicase"; + @assert ctx.fontVariantCaps === "Unicase"; + + ctx.fontVariantCaps = "titling-caps"; + @assert ctx.fontVariantCaps === "TitlingCaps"; + + // Setting fontVariantCaps with lower cases and upper cases word. + ctx.fontVariantCaps = "nORmal"; + @assert ctx.fontVariantCaps === "Normal"; + + ctx.fontVariantCaps = "smaLL-caps"; + @assert ctx.fontVariantCaps === "SmallCaps"; + + ctx.fontVariantCaps = "all-small-CAPS"; + @assert ctx.fontVariantCaps === "AllSmallCaps"; + + ctx.fontVariantCaps = "pEtitE-caps"; + @assert ctx.fontVariantCaps === "PetiteCaps"; + + ctx.fontVariantCaps = "All-Petite-Caps"; + @assert ctx.fontVariantCaps === "AllPetiteCaps"; + + ctx.fontVariantCaps = "uNIcase"; + @assert ctx.fontVariantCaps === "Unicase"; + + ctx.fontVariantCaps = "titling-CAPS"; + @assert ctx.fontVariantCaps === "TitlingCaps"; + + // Setting fontVariantCaps with non-existing font variant. + ctx.fontVariantCaps = "abcd"; + @assert ctx.fontVariantCaps === "TitlingCaps"; + t.done(); + # TODO: shadows, alpha, composite, clip \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-multiple-queued-navigations.html b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-multiple-queued-navigations.html new file mode 100644 index 00000000000..0569881ea5e --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-multiple-queued-navigations.html @@ -0,0 +1,52 @@ + + + Multiple queued lazy load navigations do not crash the page + + + + + + + + + +
+ + diff --git a/tests/wpt/web-platform-tests/infrastructure/metadata/infrastructure/testdriver/click_iframe_crossorigin.sub.html.ini b/tests/wpt/web-platform-tests/infrastructure/metadata/infrastructure/testdriver/click_iframe_crossorigin.sub.html.ini new file mode 100644 index 00000000000..10e24dd773f --- /dev/null +++ b/tests/wpt/web-platform-tests/infrastructure/metadata/infrastructure/testdriver/click_iframe_crossorigin.sub.html.ini @@ -0,0 +1,4 @@ +[click_iframe_crossorigin.sub.html] + [TestDriver click on a document in an iframe] + expected: + if os == "mac" and product == "chrome": [PASS, FAIL] # https://github.com/web-platform-tests/wpt/issues/26295 diff --git a/tests/wpt/web-platform-tests/infrastructure/server/subdomain-flag.www.sub.window.js b/tests/wpt/web-platform-tests/infrastructure/server/subdomain-flag.www.sub.window.js new file mode 100644 index 00000000000..9b4140340a4 --- /dev/null +++ b/tests/wpt/web-platform-tests/infrastructure/server/subdomain-flag.www.sub.window.js @@ -0,0 +1,5 @@ +test(() => { + assert_equals(location.hostname, "{{domains[www]}}"); +}, "Use of .www. file name flag implies www subdomain"); + +done(); diff --git a/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-backspace.tentative.html b/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-backspace.tentative.html index d057654a77c..71db5e72878 100644 --- a/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-backspace.tentative.html +++ b/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-backspace.tentative.html @@ -1241,6 +1241,303 @@ promise_test(async () => { checkGetTargetRangesOfInputOnDeleteSomething(); }, 'Backspace at "{}
cell
"'); +// Testing multiple cell selection mode. +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr1 = cell1.parentNode; + let tr2 = cell4.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendBackspaceKey(); + assert_in_array(gEditor.innerHTML, ["
cell2
cell3
", + "

cell2
cell3
"]); + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Backspace at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell3 = gEditor.querySelector("tr + tr > td"); + let tr1 = cell1.parentNode; + let tr2 = cell3.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell3); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendBackspaceKey(); + assert_in_array(gEditor.innerHTML, ["
cell2
cell4
", + "

cell2

cell4
", + "
cell2
cell4
"]); + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell3 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 0, + endContainer: tr2, + endOffset: 1, + }, + ]); + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Backspace at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell2 = gEditor.querySelector("td + td"); + let tr1 = cell1.parentNode; + let tbody = tr1.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell2); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendBackspaceKey(); + assert_in_array(gEditor.innerHTML, ["
cell3cell4
", + "


cell3cell4
", + "
cell3cell4
"]); + if (gEditor.querySelector("tr + tr")) { + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell2 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr1, + startOffset: 1, + endContainer: tr1, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething({ + startContainer: tbody, + startOffset: 0, + endContainer: tbody, + endOffset: 1, + }); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Backspace at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell3 = gEditor.querySelector("tr + tr > td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr2 = cell3.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell3); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendBackspaceKey(); + assert_in_array(gEditor.innerHTML, ["
cell1cell2
", + "
cell1cell2


", + "
cell1cell2
"]); + if (gEditor.querySelector("tr + tr")) { + // XXX Perhaps, target range should be selecting only all children of + // cell3 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr2, + startOffset: 0, + endContainer: tr2, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething({ + startContainer: tbody, + startOffset: 1, + endContainer: tbody, + endOffset: 2, + }); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Backspace at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell2 = gEditor.querySelector("td + td"); + let cell3 = gEditor.querySelector("tr + tr > td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr1 = cell1.parentNode; + let tr2 = cell3.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell2); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell3); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 4, "Should support multiple cell selection"); + await sendBackspaceKey(); + assert_in_array(gEditor.innerHTML, ["
", + "




", + "
"]); + if (gEditor.querySelector("table")) { + // XXX Perhaps, target range should be selecting only all children of + // cell1, cell2, cell3 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr1, + startOffset: 1, + endContainer: tr1, + endOffset: 2, + }, + { + startContainer: tr2, + startOffset: 0, + endContainer: tr2, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething({ + startContainer: gEditor, + startOffset: 0, + endContainer: gEditor, + endOffset: 1, + }); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Backspace at "{}{}{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell2 = gEditor.querySelector("td + td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr1 = cell1.parentNode; + let tr2 = cell4.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.setStart(cell2.firstChild, 1); + range.setEnd(cell2.firstChild, 4); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 3, "Should support multiple cell selection"); + await sendBackspaceKey(); + assert_in_array(gEditor.innerHTML, ["
cell2
cell3
", + "

cell2
cell3
", + "
c2
cell3
", + "

c2
cell3
"]); + if (cell2.firstChild.length == "cell2".length) { + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: cell2.firstChild, + startOffset: 1, + endContainer: cell2.firstChild, + endOffset: 4, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Backspace at "{}{}
cell1c[ell]2
cell3cell4
"'); + // If caret is not adjacent of deleting character, browser may not delete the // character, but update the caret position for next deletion. promise_test(async () => { diff --git a/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-forwarddelete.tentative.html b/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-forwarddelete.tentative.html index 136a4a6be4b..bbc76f43fbc 100644 --- a/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-forwarddelete.tentative.html +++ b/tests/wpt/web-platform-tests/input-events/input-events-get-target-ranges-forwarddelete.tentative.html @@ -1358,6 +1358,303 @@ promise_test(async () => { checkGetTargetRangesOfInputOnDeleteSomething(); }, 'Delete at "{}
cell
"'); +// Testing multiple cell selection mode. +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr1 = cell1.parentNode; + let tr2 = cell4.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendDeleteKey(); + assert_in_array(gEditor.innerHTML, ["
cell2
cell3
", + "

cell2
cell3
"]); + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Delete at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell3 = gEditor.querySelector("tr + tr > td"); + let tr1 = cell1.parentNode; + let tr2 = cell3.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell3); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendDeleteKey(); + assert_in_array(gEditor.innerHTML, ["
cell2
cell4
", + "

cell2

cell4
", + "
cell2
cell4
"]); + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell3 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 0, + endContainer: tr2, + endOffset: 1, + }, + ]); + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Delete at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell2 = gEditor.querySelector("td + td"); + let tr1 = cell1.parentNode; + let tbody = tr1.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell2); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendDeleteKey(); + assert_in_array(gEditor.innerHTML, ["
cell3cell4
", + "


cell3cell4
", + "
cell3cell4
"]); + if (gEditor.querySelector("tr + tr")) { + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell2 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr1, + startOffset: 1, + endContainer: tr1, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething({ + startContainer: tbody, + startOffset: 0, + endContainer: tbody, + endOffset: 1, + }); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Delete at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell3 = gEditor.querySelector("tr + tr > td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr2 = cell3.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell3); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 2, "Should support multiple cell selection"); + await sendDeleteKey(); + assert_in_array(gEditor.innerHTML, ["
cell1cell2
", + "
cell1cell2


", + "
cell1cell2
"]); + if (gEditor.querySelector("tr + tr")) { + // XXX Perhaps, target range should be selecting only all children of + // cell3 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr2, + startOffset: 0, + endContainer: tr2, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething({ + startContainer: tbody, + startOffset: 1, + endContainer: tbody, + endOffset: 2, + }); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Delete at "{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell2 = gEditor.querySelector("td + td"); + let cell3 = gEditor.querySelector("tr + tr > td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr1 = cell1.parentNode; + let tr2 = cell3.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell2); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell3); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 4, "Should support multiple cell selection"); + await sendDeleteKey(); + assert_in_array(gEditor.innerHTML, ["
", + "




", + "
"]); + if (gEditor.querySelector("table")) { + // XXX Perhaps, target range should be selecting only all children of + // cell1, cell2, cell3 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr1, + startOffset: 1, + endContainer: tr1, + endOffset: 2, + }, + { + startContainer: tr2, + startOffset: 0, + endContainer: tr2, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething({ + startContainer: gEditor, + startOffset: 0, + endContainer: gEditor, + endOffset: 1, + }); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Delete at "{}{}{}{}
cell1cell2
cell3cell4
"'); + +promise_test(async () => { + initializeTest("
cell1cell2
cell3cell4
"); + let cell1 = gEditor.querySelector("td"); + let cell2 = gEditor.querySelector("td + td"); + let cell4 = gEditor.querySelector("tr + tr > td + td"); + let tr1 = cell1.parentNode; + let tr2 = cell4.parentNode; + gSelection.removeAllRanges(); + let range = document.createRange(); + range.selectNode(cell1); + gSelection.addRange(range); + range = document.createRange(); + range.setStart(cell2.firstChild, 1); + range.setEnd(cell2.firstChild, 4); + gSelection.addRange(range); + range = document.createRange(); + range.selectNode(cell4); + gSelection.addRange(range); + assert_equals(gSelection.rangeCount, 3, "Should support multiple cell selection"); + await sendDeleteKey(); + assert_in_array(gEditor.innerHTML, ["
cell2
cell3
", + "

cell2
cell3
", + "
c2
cell3
", + "

c2
cell3
"]); + if (cell2.firstChild.length == "cell2".length) { + // XXX Perhaps, target range should be selecting only all children of + // cell1 and cell4 instead. + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } else { + checkGetTargetRangesOfBeforeinputOnDeleteSomething([ + { + startContainer: tr1, + startOffset: 0, + endContainer: tr1, + endOffset: 1, + }, + { + startContainer: cell2.firstChild, + startOffset: 1, + endContainer: cell2.firstChild, + endOffset: 4, + }, + { + startContainer: tr2, + startOffset: 1, + endContainer: tr2, + endOffset: 2, + }, + ]); + } + checkGetTargetRangesOfInputOnDeleteSomething(); +}, 'Delete at "{}{}
cell1c[ell]2
cell3cell4
"'); + // If caret is not adjacent of deleting character, browser may not delete the // character, but update the caret position for next deletion. promise_test(async () => { diff --git a/tests/wpt/web-platform-tests/largest-contentful-paint/image-src-change.html b/tests/wpt/web-platform-tests/largest-contentful-paint/image-src-change.html index bd78476390c..f35d8030257 100644 --- a/tests/wpt/web-platform-tests/largest-contentful-paint/image-src-change.html +++ b/tests/wpt/web-platform-tests/largest-contentful-paint/image-src-change.html @@ -5,7 +5,7 @@ - + + + +
+
+
+ diff --git a/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-negative-overflow.html b/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-negative-overflow.html new file mode 100644 index 00000000000..21caa263c96 --- /dev/null +++ b/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-negative-overflow.html @@ -0,0 +1,31 @@ + +Layout Instability: parent and overflowing absolute child moved together + + + + +
+
+
+ diff --git a/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-overflow.html b/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-overflow.html new file mode 100644 index 00000000000..24dda875c7b --- /dev/null +++ b/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-overflow.html @@ -0,0 +1,31 @@ + +Layout Instability: parent and overflowing absolute child moved together + + + + +
+
+
+ diff --git a/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-will-change.html b/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-will-change.html new file mode 100644 index 00000000000..1597f108925 --- /dev/null +++ b/tests/wpt/web-platform-tests/layout-instability/absolute-child-shift-with-parent-will-change.html @@ -0,0 +1,31 @@ + +Layout Instability: parent and overflowing absolute child moved together + + + + +
+
+
+ diff --git a/tests/wpt/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html b/tests/wpt/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html new file mode 100644 index 00000000000..7083a93db7d --- /dev/null +++ b/tests/wpt/web-platform-tests/paint-timing/fcp-only/fcp-ignore-from-subframe.html @@ -0,0 +1,27 @@ + + + + Performance Paint Timing Test: Paints in the iframe should be reported in the iframe + and not in the top document + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-history-about-srcdoc.html b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-history-about-srcdoc.html new file mode 100644 index 00000000000..31d2a33938a --- /dev/null +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-history-about-srcdoc.html @@ -0,0 +1,66 @@ + +Referrer Policy: navigating back to an about:srcdoc iframe reuses the original referrer policy + + + + + +
+ diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript-child.html b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript-child.html index e20da4f2ccc..670f78ab3ad 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript-child.html +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript-child.html @@ -30,7 +30,11 @@ iframe.onload = t.step_func(() => { iframe.onload = null; const iframeChild = iframe.contentDocument.createElement("iframe"); - iframeChild.src = `javascript:'${createScriptString(get_host_info().REMOTE_ORIGIN)}'`; + // We add a custom referrer to the fetch request. Otherwise, + // since the frame's URL is "about:blank", the Referer header will + // always be empty: + // https://w3c.github.io/webappsec-referrer-policy/#strip-url. + iframeChild.src = `javascript:'${createScriptString(get_host_info().REMOTE_ORIGIN, location.origin+"/custom")}'`; iframe.contentDocument.body.appendChild(iframeChild); }); document.body.appendChild(iframe); diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript.html b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript.html index 77b6d759f5f..e8de690c9c3 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript.html +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/iframe-inheritance-javascript.html @@ -7,13 +7,39 @@
diff --git a/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/resources/make-html-script.js b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/resources/make-html-script.js index e285c559c04..a013fa64b30 100644 --- a/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/resources/make-html-script.js +++ b/tests/wpt/web-platform-tests/referrer-policy/generic/inheritance/resources/make-html-script.js @@ -1,10 +1,13 @@ -function createScriptString(origin) { - return ` - - - -
- -
- diff --git a/tests/wpt/web-platform-tests/subresource-integrity/subresource-ed25519-with-csp.tentative.html b/tests/wpt/web-platform-tests/subresource-integrity/subresource-ed25519-with-csp.tentative.html deleted file mode 100644 index ca80c228655..00000000000 --- a/tests/wpt/web-platform-tests/subresource-integrity/subresource-ed25519-with-csp.tentative.html +++ /dev/null @@ -1,51 +0,0 @@ - - - -Subresource Integrity with Ed25519 plus Content Security Policy - - - - -
-
- - - diff --git a/tests/wpt/web-platform-tests/subresource-integrity/subresource-ed25519.tentative.html b/tests/wpt/web-platform-tests/subresource-integrity/subresource-ed25519.tentative.html deleted file mode 100644 index 1f091ebd569..00000000000 --- a/tests/wpt/web-platform-tests/subresource-integrity/subresource-ed25519.tentative.html +++ /dev/null @@ -1,83 +0,0 @@ - - -Subresource Integrity - - - - -
- -
- - diff --git a/tests/wpt/web-platform-tests/subresource-integrity/tools/ed25519.py b/tests/wpt/web-platform-tests/subresource-integrity/tools/ed25519.py deleted file mode 100644 index 8497786d530..00000000000 --- a/tests/wpt/web-platform-tests/subresource-integrity/tools/ed25519.py +++ /dev/null @@ -1,109 +0,0 @@ -# The original version of this file was downloaded from -# http://ed25519.cr.yp.to/software.html, and came with the following copyright -# statement: -# The Ed25519 software is in the public domain. - -import hashlib - -b = 256 -q = 2**255 - 19 -l = 2**252 + 27742317777372353535851937790883648493 - -def H(m): - return hashlib.sha512(m).digest() - -def expmod(b,e,m): - if e == 0: return 1 - t = expmod(b,e/2,m)**2 % m - if e & 1: t = (t*b) % m - return t - -def inv(x): - return expmod(x,q-2,q) - -d = -121665 * inv(121666) -I = expmod(2,(q-1)/4,q) - -def xrecover(y): - xx = (y*y-1) * inv(d*y*y+1) - x = expmod(xx,(q+3)/8,q) - if (x*x - xx) % q != 0: x = (x*I) % q - if x % 2 != 0: x = q-x - return x - -By = 4 * inv(5) -Bx = xrecover(By) -B = [Bx % q,By % q] - -def edwards(P,Q): - x1 = P[0] - y1 = P[1] - x2 = Q[0] - y2 = Q[1] - x3 = (x1*y2+x2*y1) * inv(1+d*x1*x2*y1*y2) - y3 = (y1*y2+x1*x2) * inv(1-d*x1*x2*y1*y2) - return [x3 % q,y3 % q] - -def scalarmult(P,e): - if e == 0: return [0,1] - Q = scalarmult(P,e/2) - Q = edwards(Q,Q) - if e & 1: Q = edwards(Q,P) - return Q - -def encodeint(y): - bits = [(y >> i) & 1 for i in range(b)] - return ''.join([chr(sum([bits[i * 8 + j] << j for j in range(8)])) for i in range(b/8)]) - -def encodepoint(P): - x = P[0] - y = P[1] - bits = [(y >> i) & 1 for i in range(b - 1)] + [x & 1] - return ''.join([chr(sum([bits[i * 8 + j] << j for j in range(8)])) for i in range(b/8)]) - -def bit(h,i): - return (ord(h[i/8]) >> (i%8)) & 1 - -def publickey(sk): - h = H(sk) - a = 2**(b-2) + sum(2**i * bit(h,i) for i in range(3,b-2)) - A = scalarmult(B,a) - return encodepoint(A) - -def Hint(m): - h = H(m) - return sum(2**i * bit(h,i) for i in range(2*b)) - -def signature(m,sk,pk): - h = H(sk) - a = 2**(b-2) + sum(2**i * bit(h,i) for i in range(3,b-2)) - r = Hint(''.join([h[i] for i in range(b/8,b/4)]) + m) - R = scalarmult(B,r) - S = (r + Hint(encodepoint(R) + pk + m) * a) % l - return encodepoint(R) + encodeint(S) - -def isoncurve(P): - x = P[0] - y = P[1] - return (-x*x + y*y - 1 - d*x*x*y*y) % q == 0 - -def decodeint(s): - return sum(2**i * bit(s,i) for i in range(0,b)) - -def decodepoint(s): - y = sum(2**i * bit(s,i) for i in range(0,b-1)) - x = xrecover(y) - if x & 1 != bit(s,b-1): x = q-x - P = [x,y] - if not isoncurve(P): raise Exception("decoding point that is not on curve") - return P - -def checkvalid(s,m,pk): - if len(s) != b/4: raise Exception("signature length is wrong") - if len(pk) != b/8: raise Exception("public-key length is wrong") - R = decodepoint(s[0:b/8]) - A = decodepoint(pk) - S = decodeint(s[b/8:b/4]) - h = Hint(encodepoint(R) + pk + m) - if scalarmult(B,S) != edwards(R,scalarmult(A,h)): - raise Exception("signature does not pass verification") diff --git a/tests/wpt/web-platform-tests/subresource-integrity/tools/list_hashes.py b/tests/wpt/web-platform-tests/subresource-integrity/tools/list_hashes.py index 0db19850e94..5f189ce44b2 100644 --- a/tests/wpt/web-platform-tests/subresource-integrity/tools/list_hashes.py +++ b/tests/wpt/web-platform-tests/subresource-integrity/tools/list_hashes.py @@ -3,8 +3,6 @@ from __future__ import print_function from os import path, listdir from hashlib import sha512, sha384, sha256, md5 from base64 import b64encode -from random import randint -import ed25519 import re DIR = path.normpath(path.join(__file__, "..", "..")) @@ -41,21 +39,6 @@ Generate an encoded sha256 URI. def sha256_uri(content): return "sha256-%s" % format_digest(sha256(content).digest()) -''' -Generate an encoded ed25519 signature. -''' -def ed25519_signature(private_public_key, content): - signature = ed25519.signature(content, *private_public_key) - return "ed25519-%s" % format_digest(signature) - -''' -Generate private + public key pair for ed25519 signatures. -''' -def ed25519_key_pair(): - secret_key = ''.join(chr(randint(0, 255)) for _ in range(0,32)) - public_key = ed25519.publickey(secret_key) - return (secret_key, public_key) - ''' Generate an encoded md5 digest URI. ''' @@ -63,7 +46,6 @@ def md5_uri(content): return "md5-%s" % format_digest(md5(content).digest()) def main(): - ed25519_key = ed25519_key_pair() for file in js_and_css_files(): print("Listing hash values for %s" % file) with open(file, "r") as content_file: @@ -72,8 +54,6 @@ def main(): print("\tSHA384 integrity: %s" % sha384_uri(content)) print("\tSHA256 integrity: %s" % sha256_uri(content)) print("\tMD5 integrity: %s" % md5_uri(content)) - print("\tEd25519 integrity: %s" % ed25519_signature(ed25519_key, content)) - print("\nEd25519 public key (used above): %s" % format_digest(ed25519_key[1])) if __name__ == "__main__": main() diff --git a/tests/wpt/web-platform-tests/tools/ci/tests/test_pr_preview.py b/tests/wpt/web-platform-tests/tools/ci/tests/test_pr_preview.py index 13aef508663..ed6310c1ea1 100644 --- a/tests/wpt/web-platform-tests/tools/ci/tests/test_pr_preview.py +++ b/tests/wpt/web-platform-tests/tools/ci/tests/test_pr_preview.py @@ -10,6 +10,7 @@ import os import shutil import stat import subprocess +import sys import tempfile import threading @@ -171,6 +172,11 @@ def temp_repo(): try: subprocess.check_call(['git', 'init'], cwd=directory) + # Explicitly create the default branch. + subprocess.check_call( + ['git', 'checkout', '-b', 'master'], + cwd=directory + ) subprocess.check_call( ['git', 'config', 'user.name', 'example'], cwd=directory @@ -220,7 +226,7 @@ def synchronize(expected_traffic, refs={}): child = subprocess.Popen( [ - 'python', + sys.executable, subject, '--host', 'http://{}:{}'.format(test_host, test_port), @@ -267,7 +273,7 @@ def detect(event, expected_github_traffic, expected_preview_traffic): child = subprocess.Popen( [ - 'python', + sys.executable, subject, '--host', 'http://{}:{}'.format(test_host, github_port), diff --git a/tests/wpt/web-platform-tests/tools/manifest/item.py b/tests/wpt/web-platform-tests/tools/manifest/item.py index efb49d7f4ec..9a43a68f1fb 100644 --- a/tests/wpt/web-platform-tests/tools/manifest/item.py +++ b/tests/wpt/web-platform-tests/tools/manifest/item.py @@ -147,6 +147,14 @@ class URLManifestItem(ManifestItem): flags = set(urlparse(self.url).path.rsplit("/", 1)[1].split(".")[1:-1]) return "h2" in flags + @property + def subdomain(self): + # type: () -> bool + flags = set(urlparse(self.url).path.rsplit("/", 1)[1].split(".")[1:-1]) + # Note: this is currently hard-coded to check for `www`, rather than + # all possible valid subdomains. It can be extended if needed. + return "www" in flags + def to_json(self): # type: () -> Tuple[Optional[Text], Dict[Any, Any]] rel_url = None if self._url == self.path.replace(os.path.sep, u"/") else self._url diff --git a/tests/wpt/web-platform-tests/tools/manifest/tests/test_item.py b/tests/wpt/web-platform-tests/tools/manifest/tests/test_item.py index cf52fe80aad..4f2fc8f03f2 100644 --- a/tests/wpt/web-platform-tests/tools/manifest/tests/test_item.py +++ b/tests/wpt/web-platform-tests/tools/manifest/tests/test_item.py @@ -47,6 +47,37 @@ def test_url_not_https(path): assert m.https is False +@pytest.mark.parametrize("path", [ + "a.www.c", + "a.b.www.c", + "a.www.b.c", + "a.b.www.c.d", + "a.https.www.c", + "a.b.https.www.c", + "a.https.www.b.c", + "a.b.https.www.c.d", +]) +def test_url_subdomain(path): + m = HarnessTest("/foo", "bar/" + path, "/", "bar/" + path) + + assert m.subdomain is True + + +@pytest.mark.parametrize("path", [ + "www", + "a.www", + "a.b.www", + "www.a", + "www.a.b", + "a.bwwww.c", + "a.wwwwb.c", +]) +def test_url_not_subdomain(path): + m = HarnessTest("/foo", "bar/" + path, "/", "bar/" + path) + + assert m.subdomain is False + + @pytest.mark.parametrize("fuzzy", [ {('/foo/test.html', u'/foo/ref.html', '=='): [[1, 1], [200, 200]]}, {('/foo/test.html', u'/foo/ref.html', '=='): [[0, 1], [100, 200]]}, diff --git a/tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py b/tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py index 02b611e378b..74246fafdd7 100644 --- a/tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py +++ b/tests/wpt/web-platform-tests/tools/wpt/tests/test_wpt.py @@ -170,15 +170,14 @@ def test_run_zero_tests(): pytest.skip("port 8000 already in use") with pytest.raises(SystemExit) as excinfo: - wpt.main(argv=["run", "--yes", "--no-pause", "--binary-arg", "headless", - "--channel", "dev", "chrome", - "/non-existent-dir/non-existent-file.html"]) + wpt.main(argv=["run", "--yes", "--no-pause", "--channel", "dev", + "chrome", "/non-existent-dir/non-existent-file.html"]) assert excinfo.value.code != 0 with pytest.raises(SystemExit) as excinfo: - wpt.main(argv=["run", "--yes", "--no-pause", "--binary-arg", "headless", - "--no-fail-on-unexpected", "--channel", "dev", - "chrome", "/non-existent-dir/non-existent-file.html"]) + wpt.main(argv=["run", "--yes", "--no-pause", "--no-fail-on-unexpected", + "--channel", "dev", "chrome", + "/non-existent-dir/non-existent-file.html"]) assert excinfo.value.code != 0 @@ -196,14 +195,13 @@ def test_run_failing_test(): assert os.path.isfile("../../%s" % failing_test) with pytest.raises(SystemExit) as excinfo: - wpt.main(argv=["run", "--yes", "--no-pause", "--binary-arg", "headless", - "--channel", "dev", "chrome", failing_test]) + wpt.main(argv=["run", "--yes", "--no-pause", "--channel", "dev", + "chrome", failing_test]) assert excinfo.value.code != 0 with pytest.raises(SystemExit) as excinfo: - wpt.main(argv=["run", "--yes", "--no-pause", "--binary-arg", "headless", - "--no-fail-on-unexpected", "--channel", "dev", - "chrome", failing_test]) + wpt.main(argv=["run", "--yes", "--no-pause", "--no-fail-on-unexpected", + "--channel", "dev", "chrome", failing_test]) assert excinfo.value.code == 0 @@ -227,15 +225,15 @@ def test_run_verify_unstable(temp_test): """) with pytest.raises(SystemExit) as excinfo: - wpt.main(argv=["run", "--yes", "--verify", "--binary-arg", "headless", - "--channel", "dev", "chrome", unstable_test]) + wpt.main(argv=["run", "--yes", "--verify", "--channel", "dev", + "chrome", unstable_test]) assert excinfo.value.code != 0 stable_test = temp_test("test(function() {}, 'my test');") with pytest.raises(SystemExit) as excinfo: - wpt.main(argv=["run", "--yes", "--verify", "--binary-arg", "headless", - "--channel", "dev", "chrome", stable_test]) + wpt.main(argv=["run", "--yes", "--verify", "--channel", "dev", + "chrome", stable_test]) assert excinfo.value.code == 0 diff --git a/tests/wpt/web-platform-tests/tools/wpt/tox.ini b/tests/wpt/web-platform-tests/tools/wpt/tox.ini index 7e6eb8e42a4..50717135539 100644 --- a/tests/wpt/web-platform-tests/tools/wpt/tox.ini +++ b/tests/wpt/web-platform-tests/tools/wpt/tox.ini @@ -18,4 +18,5 @@ commands = pytest {posargs} passenv = + DISPLAY TASKCLUSTER_ROOT_URL diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py index 4c3891c1cb6..55518685494 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/base.py @@ -307,14 +307,18 @@ class TestExecutor(object): self.runner.send_message("test_ended", test, result) - def server_url(self, protocol): + def server_url(self, protocol, subdomain=False): scheme = "https" if protocol == "h2" else protocol - return "%s://%s:%s" % (scheme, - self.server_config["browser_host"], - self.server_config["ports"][protocol][0]) + host = self.server_config["browser_host"] + if subdomain: + # The only supported subdomain filename flag is "www". + host = "{subdomain}.{host}".format(subdomain="www", host=host) + return "{scheme}://{host}:{port}".format(scheme=scheme, host=host, + port=self.server_config["ports"][protocol][0]) def test_url(self, test): - return urljoin(self.server_url(test.environment["protocol"]), test.url) + return urljoin(self.server_url(test.environment["protocol"], + test.subdomain), test.url) @abstractmethod def do_test(self, test): diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wpttest.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wpttest.py index 31b245612be..aafe3fa6e00 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wpttest.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wpttest.py @@ -158,13 +158,15 @@ class Test(object): long_timeout = 60 # seconds def __init__(self, tests_root, url, inherit_metadata, test_metadata, - timeout=None, path=None, protocol="http", quic=False): + timeout=None, path=None, protocol="http", subdomain=False, + quic=False): self.tests_root = tests_root self.url = url self._inherit_metadata = inherit_metadata self._test_metadata = test_metadata self.timeout = timeout if timeout is not None else self.default_timeout self.path = path + self.subdomain = subdomain self.environment = {"protocol": protocol, "prefs": self.prefs, "quic": quic} def __eq__(self, other): @@ -190,7 +192,8 @@ class Test(object): test_metadata, timeout=timeout, path=os.path.join(manifest_file.tests_root, manifest_item.path), - protocol=server_protocol(manifest_item)) + protocol=server_protocol(manifest_item), + subdomain=manifest_item.subdomain) @property def id(self): @@ -395,9 +398,9 @@ class TestharnessTest(Test): def __init__(self, tests_root, url, inherit_metadata, test_metadata, timeout=None, path=None, protocol="http", testdriver=False, - jsshell=False, scripts=None, quic=False): + jsshell=False, scripts=None, subdomain=False, quic=False): Test.__init__(self, tests_root, url, inherit_metadata, test_metadata, timeout, - path, protocol, quic) + path, protocol, subdomain, quic) self.testdriver = testdriver self.jsshell = jsshell @@ -422,6 +425,7 @@ class TestharnessTest(Test): testdriver=testdriver, jsshell=jsshell, scripts=scripts, + subdomain=manifest_item.subdomain, quic=quic) @property @@ -453,8 +457,8 @@ class ReftestTest(Test): test_type = "reftest" def __init__(self, tests_root, url, inherit_metadata, test_metadata, references, - timeout=None, path=None, viewport_size=None, dpi=None, fuzzy=None, protocol="http", - quic=False): + timeout=None, path=None, viewport_size=None, dpi=None, fuzzy=None, + protocol="http", quic=False): Test.__init__(self, tests_root, url, inherit_metadata, test_metadata, timeout, path, protocol, quic) diff --git a/tests/wpt/web-platform-tests/webdriver/tests/back/back.py b/tests/wpt/web-platform-tests/webdriver/tests/back/back.py index 9ca52e8f223..5b50bc1bbb5 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/back/back.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/back/back.py @@ -109,3 +109,18 @@ def test_history_pushstate(session, url): assert session.url == pushstate_page assert session.execute_script("return history.state;") is None + + +def test_removed_iframe(session, url): + page = inline("

foo") + + session.url = page + session.url = url("/webdriver/tests/support/html/frames_no_bfcache.html") + + subframe = session.find.css("#sub-frame", all=False) + session.switch_frame(subframe) + + response = back(session) + assert_success(response) + + assert session.url == page diff --git a/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py b/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py index 4a1e2158151..d71bbd11021 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/forward/forward.py @@ -130,3 +130,20 @@ def test_history_pushstate(session, url): assert session.url == "{}#pushstate".format(pushstate_page) assert session.execute_script("return history.state;") == {"foo": "bar"} + + +def test_removed_iframe(session, url): + page = inline("

foo") + + session.url = url("/webdriver/tests/support/html/frames_no_bfcache.html") + session.url = page + + session.back() + + subframe = session.find.css("#sub-frame", all=False) + session.switch_frame(subframe) + + response = forward(session) + assert_success(response) + + assert session.url == page diff --git a/tests/wpt/web-platform-tests/webdriver/tests/support/html/frames_no_bfcache.html b/tests/wpt/web-platform-tests/webdriver/tests/support/html/frames_no_bfcache.html new file mode 100644 index 00000000000..1972187d21f --- /dev/null +++ b/tests/wpt/web-platform-tests/webdriver/tests/support/html/frames_no_bfcache.html @@ -0,0 +1,18 @@ + + + + + + + +

+ +
+ + diff --git a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py index 98b4bee16e2..9e5315588e3 100644 --- a/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py +++ b/tests/wpt/web-platform-tests/webdriver/tests/switch_to_window/switch.py @@ -1,6 +1,7 @@ from webdriver.transport import Response from tests.support.asserts import assert_error, assert_success +from tests.support.inline import iframe, inline def switch_to_window(session, handle): @@ -51,3 +52,16 @@ def test_no_browsing_context(session, url): assert_success(response) assert session.window_handle == new_handle + + +def test_switch_to_window_sets_top_level_context(session): + session.url = inline(iframe("

foo")) + + frame = session.find.css("iframe", all=False) + session.switch_frame(frame) + session.find.css("p", all=False) + + response = switch_to_window(session, session.window_handle) + assert_success(response) + + session.find.css("iframe", all=False)