diff options
Diffstat (limited to 'tests/wpt/web-platform-tests')
13 files changed, 294 insertions, 32 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-001-ref.html b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-001-ref.html new file mode 100644 index 00000000000..37a102e0f60 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-001-ref.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<title>Reference: Select element in flexbox with zero height</title> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<style> + .container { + height: 0px; + border: 1px dotted black; + } +</style> +<body> + <div class="container"> + <select style="width:100%"><option>Hi</option></select> + </div> +</body> diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-001.html b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-001.html new file mode 100644 index 00000000000..e39461ef129 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-001.html @@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>Select element in flexbox with zero height</title> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1591925"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#content-size-suggestion"> +<link rel="match" href="select-element-zero-height-001-ref.html"> +<style> + .container { + display: flex; + flex-direction: column; + height: 0px; + border: 1px dotted black; + } +</style> +<body> + <div class="container"> + <select><option>Hi</option></select> + </div> +</body> diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-002-ref.html b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-002-ref.html new file mode 100644 index 00000000000..93222f70617 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-002-ref.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<title>Reference: Select element with background color in flexbox with zero height</title> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<style> + .container { + height: 0px; + border: 1px dotted black; + } + .with-background { + width: 100%; + background: lime; + } +</style> +<body> + <div class="container"> + <select class="with-background"><option>Hi</option></select> + </div> +</body> diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-002.html b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-002.html new file mode 100644 index 00000000000..6b6b92896bc --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/select-element-zero-height-002.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<title>Select element with background color in flexbox with zero height</title> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1591925"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#content-size-suggestion"> +<link rel="match" href="select-element-zero-height-002-ref.html"> +<style> + .container { + display: flex; + flex-direction: column; + height: 0px; + border: 1px dotted black; + } + .with-background { + background: lime; + } +</style> +<body> + <div class="container"> + <select class="with-background"><option>Hi</option></select> + </div> +</body> diff --git a/tests/wpt/web-platform-tests/css/css-transforms/animation/scale-interpolation.html b/tests/wpt/web-platform-tests/css/css-transforms/animation/scale-interpolation.html index e71b134ce5f..29999d49ccf 100644 --- a/tests/wpt/web-platform-tests/css/css-transforms/animation/scale-interpolation.html +++ b/tests/wpt/web-platform-tests/css/css-transforms/animation/scale-interpolation.html @@ -92,12 +92,12 @@ from: '-10 5 1', to: '1', }, [ - {at: -1, expect: '-21 9 1'}, - {at: 0, expect: '-10 5 1'}, - {at: 0.25, expect: '-7.25 4 1'}, - {at: 0.75, expect: '-1.75 2 1'}, + {at: -1, expect: '-21 9'}, + {at: 0, expect: '-10 5'}, + {at: 0.25, expect: '-7.25 4'}, + {at: 0.75, expect: '-1.75 2'}, {at: 1, expect: '1'}, - {at: 2, expect: '12 -3 1'}, + {at: 2, expect: '12 -3'}, ]); // Handling of the none value. @@ -148,12 +148,12 @@ from: 'initial', to: '2 0.5 1', }, [ - {at: -1, expect: '0 1.5 1'}, + {at: -1, expect: '0 1.5'}, {at: 0, expect: 'none'}, - {at: 0.25, expect: '1.25 0.875 1'}, - {at: 0.75, expect: '1.75 0.625 1'}, - {at: 1, expect: '2 0.5 1'}, - {at: 2, expect: '3 0 1'}, + {at: 0.25, expect: '1.25 0.875'}, + {at: 0.75, expect: '1.75 0.625'}, + {at: 1, expect: '2 0.5'}, + {at: 2, expect: '3 0'}, ]); test_interpolation({ @@ -161,12 +161,12 @@ from: '2 0.5 1', to: 'initial', }, [ - {at: -1, expect: '3 0 1'}, - {at: 0, expect: '2 0.5 1'}, - {at: 0.25, expect: '1.75 0.6251 1'}, - {at: 0.75, expect: '1.25 0.875 1'}, + {at: -1, expect: '3 0'}, + {at: 0, expect: '2 0.5'}, + {at: 0.25, expect: '1.75 0.6251'}, + {at: 0.75, expect: '1.25 0.875'}, {at: 1, expect: 'none'}, - {at: 2, expect: '0 1.5 1'}, + {at: 2, expect: '0 1.5'}, ]); @@ -194,7 +194,7 @@ {at: 0, expect: '0.5 1 2'}, {at: 0.25, expect: '0.875 0.875 1.75'}, {at: 0.75, expect: '1.625 0.625 1.25'}, - {at: 1, expect: '2 0.5 1'}, + {at: 1, expect: '2 0.5'}, {at: 2, expect: '3.5 0 0'}, ]); @@ -204,7 +204,7 @@ to: 'inherit', }, [ {at: -1, expect: '3.5 0 0'}, - {at: 0, expect: '2 0.5 1'}, + {at: 0, expect: '2 0.5'}, {at: 0.25, expect: '1.625 0.625 1.25'}, {at: 0.75, expect: '0.875 0.875 1.75'}, {at: 1, expect: '0.5 1 2'}, diff --git a/tests/wpt/web-platform-tests/css/css-transforms/animation/translate-interpolation.html b/tests/wpt/web-platform-tests/css/css-transforms/animation/translate-interpolation.html index 3d40863b3b4..1764df3e967 100644 --- a/tests/wpt/web-platform-tests/css/css-transforms/animation/translate-interpolation.html +++ b/tests/wpt/web-platform-tests/css/css-transforms/animation/translate-interpolation.html @@ -9,14 +9,6 @@ <script src="/resources/testharnessreport.js"></script> <script src="/css/support/interpolation-testcommon.js"></script> <style> - body { - width: 500px; - height: 500px; - } - div { - width: 10px; - height: 10px; - } .parent { translate: 100px 200px 300px; } diff --git a/tests/wpt/web-platform-tests/css/css-transforms/parsing/scale-parsing-valid.html b/tests/wpt/web-platform-tests/css/css-transforms/parsing/scale-parsing-valid.html index ac23a17b013..bbd443a717a 100644 --- a/tests/wpt/web-platform-tests/css/css-transforms/parsing/scale-parsing-valid.html +++ b/tests/wpt/web-platform-tests/css/css-transforms/parsing/scale-parsing-valid.html @@ -17,10 +17,10 @@ test_valid_value("scale", "1"); test_valid_value("scale", "100"); test_valid_value("scale", "100 100", "100"); -test_valid_value("scale", "100 100 1"); +test_valid_value("scale", "100 100 1", "100"); test_valid_value("scale", "100 200"); -test_valid_value("scale", "100 200 1"); +test_valid_value("scale", "100 200 1", "100 200"); test_valid_value("scale", "100 200 300"); </script> </body> diff --git a/tests/wpt/web-platform-tests/css/css-transforms/parsing/translate-parsing-valid.html b/tests/wpt/web-platform-tests/css/css-transforms/parsing/translate-parsing-valid.html index 17699ccc1c2..f15fdf0c4fb 100644 --- a/tests/wpt/web-platform-tests/css/css-transforms/parsing/translate-parsing-valid.html +++ b/tests/wpt/web-platform-tests/css/css-transforms/parsing/translate-parsing-valid.html @@ -23,14 +23,15 @@ test_valid_value("translate", "100px calc(10px - 10%)", "100px calc(10px - 10%)" test_valid_value("translate", "100px 200%"); test_valid_value("translate", "100% 200px"); -test_valid_value("translate", "100px 200px 0px"); +test_valid_value("translate", "100px 200px 0px", "100px 200px"); +test_valid_value("translate", "100px 0px 0px", "100px"); test_valid_value("translate", "100px 200px 300px"); test_valid_value("translate", "100% 200% 300px"); test_valid_value("translate", "calc(10% + 10px) calc(20% + 20px) calc(30em + 30px)"); test_valid_value("translate", "0", "0px"); -test_valid_value("translate", "1px 2px 0", "1px 2px 0px"); +test_valid_value("translate", "1px 2px 0", "1px 2px"); </script> </body> </html> diff --git a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/reftest.list b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/reftest.list index d3031a49b89..231532eac32 100644 --- a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/reftest.list +++ b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/reftest.list @@ -9,6 +9,7 @@ == will-change-stacking-context-position-1.html green-square-100-by-100-ref.html == will-change-stacking-context-transform-1.html green-square-100-by-100-ref.html == will-change-stacking-context-translate-1.html green-square-100-by-100-ref.html +== will-change-stacking-context-offset-path-1.html green-square-100-by-100-ref.html == will-change-stacking-context-transform-style-1.html green-square-100-by-100-ref.html == will-change-stacking-context-z-index-1.html green-square-100-by-100-ref.html == will-change-fixpos-cb-contain-1.html green-square-100-by-100-offset-ref.html @@ -18,4 +19,5 @@ == will-change-fixpos-cb-position-1.html green-square-100-by-100-offset-ref.html == will-change-fixpos-cb-transform-1.html green-square-100-by-100-offset-ref.html == will-change-fixpos-cb-translate-1.html green-square-100-by-100-offset-ref.html +== will-change-fixpos-cb-offset-path-1.html green-square-100-by-100-offset-ref.html == will-change-fixpos-cb-transform-style-1.html green-square-100-by-100-offset-ref.html diff --git a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/will-change-fixpos-cb-offset-path-1.html b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/will-change-fixpos-cb-offset-path-1.html new file mode 100644 index 00000000000..0fe1ec1da79 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/will-change-fixpos-cb-offset-path-1.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: offset-path' creates a containing block for fixed positioned elements</title> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-path-property"> +<link rel="match" href="green-square-100-by-100-offset-ref.html"> +<meta name="assert" content="If any non-initial value of a property would cause the element to generate a containing block for fixed-position elements, specifying that property in will-change must cause the element to generate a containing block for fixed-position elements."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: offset-path; margin: 100px 0 0 100px; background: red } +.child { top: 0; left: 0; width: 50px; background: green } +#fixpos { position: fixed } +#abspos { position: absolute; left: 50px } +</style> +<body> + <div id="wc"> + <div class="child" id="fixpos"> + </div> + <div class="child" id="abspos"> + </div> + </div> +</body> diff --git a/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/will-change-stacking-context-offset-path-1.html b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/will-change-stacking-context-offset-path-1.html new file mode 100644 index 00000000000..07277b66d92 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/will-change/will-change-stacking-context-offset-path-1.html @@ -0,0 +1,20 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS will-change: 'will-change: offset-path' creates a stacking context</title> +<link rel="author" title="Mozilla" href="http://www.mozilla.org/"> +<link rel="help" href="https://drafts.csswg.org/css-will-change-1/#will-change"> +<link rel="help" href="https://drafts.fxtf.org/motion-1/#offset-path-property"> +<link rel="match" href="green-square-100-by-100-ref.html"> +<meta name="assert" content="If any non-initial value of a property would create a stacking context on the element, specifying that property in will-change must create a stacking context on the element."> +<style> +html, body { margin: 0; padding: 0; } +div { width: 100px; height: 100px } +#wc { will-change: offset-path; background: red } +#child { position: absolute; top: 0; left: 0; z-index: -1; background: green } +</style> +<body> + <div id="wc"> + <div id="child"> + </div> + </div> +</body> diff --git a/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py b/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py index 1c27a0d14bd..7ec7b160115 100644 --- a/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py +++ b/tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/cors/support/cors-tester.py @@ -31,9 +31,9 @@ def main(request, response): cors = request.headers.get("origin", "no") - cookie = request.cookies.first(id, "no") - - line = 'cors = ' + cors + ' | cookie = ' + cookie.value; + cookie = request.cookies.first(id, None) + cookie_value = cookie.value if cookie is not None else "no" + line = 'cors = ' + cors + ' | cookie = ' + cookie_value; data = request.server.stash.take(id) if data is not None: diff --git a/tests/wpt/web-platform-tests/payment-method-basic-card/billing-address-is-null-manual.https.html b/tests/wpt/web-platform-tests/payment-method-basic-card/billing-address-is-null-manual.https.html new file mode 100644 index 00000000000..3250e0a2c55 --- /dev/null +++ b/tests/wpt/web-platform-tests/payment-method-basic-card/billing-address-is-null-manual.https.html @@ -0,0 +1,150 @@ +<!DOCTYPE html> <meta charset="utf-8" /> +<title>Test for requesting billing address</title> +<link + rel="help" + href="https://github.com/w3c/payment-method-basic-card/pull/65" +/> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + setup({ + explicit_done: true, + explicit_timeout: true, + }); + const basicCard = { supportedMethods: "basic-card" }; + const details = { + total: { + label: "label", + amount: { currency: "USD", value: "5.00" }, + }, + }; + + // Smoke tests + test(() => { + assert_true( + "onpaymentmethodchange" in PaymentRequest.prototype, + "The paymentmethodchange event handler is not supported on PaymentRequest" + ); + assert_true( + "PaymentMethodChangeEvent" in window, + "The PaymentMethodChangeEvent is not supported" + ); + }, "PaymentMethodChangeEvent support"); + + function dontRequestBillingAddress(options) { + promise_test(async t => { + const request = new PaymentRequest([basicCard], details, { + requestBillingAddress: false, + }); + const showPromise = request.show(); + + // Let's check the method data from PaymentMethodChangeEvent. + const event = await new Promise(resolve => + request.addEventListener("paymentmethodchange", resolve) + ); + assert_true( + event instanceof PaymentMethodChangeEvent, + "Expected instance of PaymentMethodChangeEvent" + ); + assert_equals( + event.methodDetails.billingAddress, + null, + "Expected methodDetails.billingAddress to be null" + ); + + // Let's check the billingAddress in the response + const response = await showPromise; + const { + details: { billingAddress: responseBillingAddress }, + } = response; + + assert_equals( + responseBillingAddress, + null, + "Expected PaymentResponse.data.billingAddress to be null" + ); + + // And we are done + await response.complete("success"); + }); + } + + function requestBillingAddress() { + promise_test(async t => { + const request = new PaymentRequest([basicCard], details, { + requestBillingAddress: true, + }); + const showPromise = request.show(); + + // Let's check the methodDetails from event. + const event = await new Promise(resolve => + request.addEventListener("paymentmethodchange", resolve) + ); + assert_true( + event instanceof PaymentMethodChangeEvent, + "Expected instance of PaymentMethodChangeEvent" + ); + const { billingAddress: eventBillingAddress } = event.methodDetails; + checkRedactList(eventBillingAddress); + + // Let's check the billingAddress in the response. + const response = await showPromise; + const { + details: { billingAddress: responseBillingAddress }, + } = await showPromise; + checkRedactList(responseBillingAddress); + + // And we are done. + await response.complete("success"); + }); + } + + function checkRedaction(billingAddress) { + assert_true( + billingAddress instanceof PaymentAddress, + "Expected instance of PaymentAddress" + ); + for (const item of ["organization", "phone", "recipient"]) { + assert_equals( + billingAddress[item], + "", + `Expected billingAddress's "${item}" attribute to equal null (redacted).` + ); + } + } +</script> + +<h2>Request billing address</h2> +<p> + Click on each button in sequence from top to bottom without refreshing the + page. Each button will bring up the Payment Request UI window. +</p> +<p> + When the payment sheet is presented, select a payment method (e.g., a credit + card), and press "Pay". +</p> +<ol> + <li> + <button onclick="dontRequestBillingAddress()"> + When no billing address is requested, + `PaymentMethodChangeEvent.methodData.billingAddress` is null. + </button> + </li> + <li> + <button onclick="requestBillingAddress()"> + When billing address is + requested,`PaymentMethodChangeEvent.methodData.billingAddress` is a + `PaymentAddress`. + </button> + </li> + <li><button onclick="done()">Done!</button></li> +</ol> +<small> + If you find a buggy test, please + <a href="https://github.com/web-platform-tests/wpt/issues">file a bug</a> and + tag one of the + <a + href="https://github.com/web-platform-tests/wpt/blob/master/payment-request/META.yml" + >suggested reviewers</a + >. +</small> |