Update web-platform-tests to revision 6ea3164d34a632b16b857d7474985b93acd8de11

This commit is contained in:
WPT Sync Bot 2020-12-11 08:19:25 +00:00
parent 3342711f68
commit c67c5d4fb8
284 changed files with 3792 additions and 1407 deletions

View file

@ -4,7 +4,7 @@
expected: TIMEOUT expected: TIMEOUT
[Opening a blob URL in a new window immediately before revoking it works.] [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.] [Fetching a blob URL immediately before revoking it works in an iframe.]
expected: FAIL expected: FAIL

View file

@ -1,4 +0,0 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -0,0 +1,2 @@
[dynamic-import.html]
expected: CRASH

View file

@ -0,0 +1,2 @@
[top-level-await.https.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[vh-support-transform-translate.html]
expected: TIMEOUT

View file

@ -1,7 +0,0 @@
[offsetTopLeft-border-box.html]
[container: 1]
expected: FAIL
[container: 0]
expected: FAIL

View file

@ -309,27 +309,18 @@
[Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain] [<iframe>: separate response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain] [<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" text/plain] [<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html */*] [<iframe>: combined response Content-Type: text/html */*]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*] [<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL

View file

@ -11,6 +11,6 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!] [X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20'NosniFF'] [X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
expected: FAIL expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -0,0 +1,4 @@
[traverse_the_history_4.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -0,0 +1,2 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -0,0 +1,7 @@
[sandbox-document-open.html]
[other_document.open()]
expected: FAIL
[document.open()]
expected: FAIL

View file

@ -0,0 +1,4 @@
[form-double-submit-2.html]
[preventDefault should allow onclick submit() to succeed]
expected: FAIL

View file

@ -0,0 +1,4 @@
[module-delayed.html]
[async document.write in a module]
expected: FAIL

View file

@ -0,0 +1,4 @@
[module-static-import-delayed.html]
[document.write in an imported module]
expected: FAIL

View file

@ -3,6 +3,3 @@
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] [The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT expected: TIMEOUT
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: FAIL

View file

@ -1,4 +1,5 @@
[realtimeanalyser-fft-scaling.html] [realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.] [X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL expected: FAIL

View file

@ -386,3 +386,9 @@
[X SNR (-480.9982135660622 dB) is not greater than or equal to 65.737. Got -480.9982135660622.] [X SNR (-480.9982135660622 dB) is not greater than or equal to 65.737. Got -480.9982135660622.]
expected: FAIL expected: FAIL
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[28696\]\t3.8483718720978944e+16\t9.3139332532882690e-1\t3.8483718720978944e+16\t4.1318439454558392e+16\t3.8985999999999999e-3\n\t[28697\]\t7.0477002859115601e-1\t9.0675884485244751e-1\t2.0198881626129150e-1\t2.2275913536212616e-1\t3.8985999999999999e-3\n\tMax AbsError of 3.8483718720978944e+16 at index of 28696.\n\tMax RelError of 4.1318439454558392e+16 at index of 28696.\n]
expected: FAIL
[X SNR (-288.2714546901987 dB) is not greater than or equal to 65.737. Got -288.2714546901987.]
expected: FAIL

View file

@ -0,0 +1,5 @@
[018.html]
expected: TIMEOUT
[origin of the script that invoked the method, javascript:]
expected: TIMEOUT

View file

@ -7,7 +7,7 @@
expected: FAIL expected: FAIL
[Opening a blob URL in a new window immediately before revoking it works.] [Opening a blob URL in a new window immediately before revoking it works.]
expected: TIMEOUT expected: FAIL
[Opening a blob URL in a noopener about:blank window immediately before revoking it works.] [Opening a blob URL in a noopener about:blank window immediately before revoking it works.]
expected: TIMEOUT expected: TIMEOUT

File diff suppressed because it is too large Load diff

View file

@ -1,4 +0,0 @@
[hit-test-floats-004.html]
[Miss float below something else]
expected: FAIL

View file

@ -0,0 +1,2 @@
[dynamic-import.html]
expected: CRASH

View file

@ -0,0 +1,2 @@
[top-level-await.https.html]
expected: TIMEOUT

View file

@ -0,0 +1,2 @@
[vh-support-transform-translate.html]
expected: TIMEOUT

View file

@ -1,7 +0,0 @@
[offsetTopLeft-border-box.html]
[container: 1]
expected: FAIL
[container: 0]
expected: FAIL

View file

@ -309,27 +309,18 @@
[fetch(): separate response Content-Type: text/plain ] [fetch(): separate response Content-Type: text/plain ]
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain] [<iframe>: separate response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain] [<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" text/plain] [<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html */*] [<iframe>: combined response Content-Type: text/html */*]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*] [<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
expected: FAIL expected: FAIL

View file

@ -11,6 +11,6 @@
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!] [X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20'NosniFF'] [X-Content-Type-Options%3A%20no%0D%0AX-Content-Type-Options%3A%20nosniff]
expected: FAIL expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -0,0 +1,4 @@
[traverse_the_history_4.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -0,0 +1,2 @@
[cross-origin-objects-on-new-window.html]
expected: TIMEOUT

View file

@ -0,0 +1,7 @@
[sandbox-document-open.html]
[other_document.open()]
expected: FAIL
[document.open()]
expected: FAIL

View file

@ -0,0 +1,4 @@
[form-double-submit-2.html]
[preventDefault should allow onclick submit() to succeed]
expected: FAIL

View file

@ -0,0 +1,4 @@
[module-delayed.html]
[async document.write in a module]
expected: FAIL

View file

@ -0,0 +1,4 @@
[module-static-import-delayed.html]
[document.write in an imported module]
expected: FAIL

View file

@ -4,6 +4,3 @@
[The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document] [The incumbent settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: TIMEOUT expected: TIMEOUT
[The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document]
expected: FAIL

View file

@ -1,4 +1,5 @@
[realtimeanalyser-fft-scaling.html] [realtimeanalyser-fft-scaling.html]
expected: TIMEOUT
[X 2048-point FFT peak position is not equal to 64. Got 0.] [X 2048-point FFT peak position is not equal to 64. Got 0.]
expected: FAIL expected: FAIL

View file

@ -614,3 +614,9 @@
[X SNR (-480.9982135660622 dB) is not greater than or equal to 65.737. Got -480.9982135660622.] [X SNR (-480.9982135660622 dB) is not greater than or equal to 65.737. Got -480.9982135660622.]
expected: FAIL expected: FAIL
[X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...\] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[28696\]\t3.8483718720978944e+16\t9.3139332532882690e-1\t3.8483718720978944e+16\t4.1318439454558392e+16\t3.8985999999999999e-3\n\t[28697\]\t7.0477002859115601e-1\t9.0675884485244751e-1\t2.0198881626129150e-1\t2.2275913536212616e-1\t3.8985999999999999e-3\n\tMax AbsError of 3.8483718720978944e+16 at index of 28696.\n\tMax RelError of 4.1318439454558392e+16 at index of 28696.\n]
expected: FAIL
[X SNR (-288.2714546901987 dB) is not greater than or equal to 65.737. Got -288.2714546901987.]
expected: FAIL

View file

@ -0,0 +1,5 @@
[018.html]
expected: TIMEOUT
[origin of the script that invoked the method, javascript:]
expected: TIMEOUT

View file

@ -35,6 +35,6 @@ def main(request, response):
if len(matches) != 1: if len(matches) != 1:
return 404, [], '{} origin policies found at a path matching "{}"'.format(len(matches), filepath_pattern) return 404, [], '{} origin policies found at a path matching "{}"'.format(len(matches), filepath_pattern)
with open(matches[0]) as f: with open(matches[0], 'rb') as f:
data = f.read() data = f.read()
return return_code, [('Content-Type', content_type)], data return return_code, [('Content-Type', content_type)], data

View file

@ -12,7 +12,7 @@
var t = async_test("Test that violation report event was fired"); var t = async_test("Test that violation report event was fired");
window.addEventListener("securitypolicyviolation", t.step_func_done(function(e) { window.addEventListener("securitypolicyviolation", t.step_func_done(function(e) {
assert_equals(e.violatedDirective, "style-src"); assert_equals(e.violatedDirective, "style-src-attr");
})); }));
window.onload = function() { window.onload = function() {
try { try {

View file

@ -7,7 +7,7 @@
<title>style-blocked</title> <title>style-blocked</title>
<script src="/resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src='../support/logTest.sub.js?logs=["violated-directive=style-src","PASS"]'></script> <script src='../support/logTest.sub.js?logs=["violated-directive=style-src-elem","PASS"]'></script>
<script src="../support/alertAssert.sub.js?alerts=[]"></script> <script src="../support/alertAssert.sub.js?alerts=[]"></script>
<script> <script>
window.addEventListener('securitypolicyviolation', function(e) { window.addEventListener('securitypolicyviolation', function(e) {

View file

@ -21,7 +21,7 @@ def main(request, response):
try: try:
if b'drop' in request.GET: if b'drop' in request.GET:
cookie = request.GET[b'drop'] cookie = request.GET[b'drop']
cookie += "; max-age=0" cookie += b'; max-age=0'
if b'set' in request.GET: if b'set' in request.GET:
cookie = request.GET[b'set'] cookie = request.GET[b'set']

View file

@ -0,0 +1,8 @@
<!doctype HTML>
<html>
<meta charset="utf8">
<title>CSS Content Visibility: auto in overflow hidden paints (reference)</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<div>content</div>

View file

@ -0,0 +1,16 @@
<!doctype HTML>
<meta charset="utf8">
<title>CSS Content Visibility: auto in overflow hidden paints</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<link rel="match" href="content-visibility-079-ref.html">
<meta name="assert" content="content-visibility auto element paints in an overflow hidden element that is not sized">
<style>
.auto { content-visibility: auto; }
.overflow { overflow: hidden; }
</style>
<div class=overflow>
<div class=auto>content</div>
</div>

View file

@ -29,7 +29,6 @@
.tall { .tall {
width: 50px; width: 50px;
height: 100px; height: 100px;
background: green;
} }
</style> </style>
<body> <body>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: inline)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid;">
<svg style="background: green; height: 100px;" viewBox="0 0 1 1"></svg>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid;">
<svg style="background: green; width: 100px;" viewBox="0 0 1 1"></svg>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block) with larger row track size</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-rows: 200px;">
<svg style="background: green; height: 100px;" viewBox="0 0 1 1"></svg>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block) with larger row track size</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: 200px;">
<svg style="background: green; height: 100px;" viewBox="0 0 1 1"></svg>
</div>

View file

@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml">
<html:link rel="help" href="https://www.w3.org/TR/css-masking-1/"/>
<html:link rel="help" href="https://crbug.com/1155384"/>
<html:link rel="match" href="reference/mask-and-nested-clip-path-ref.svg"/>
<mask id="mask">
<rect x="0" y="0" width="200" height="200" fill="white" />
</mask>
<clipPath id="nested-clip-path">
<rect x="100" y="0" width="300" height="300" />
</clipPath>
<clipPath id="clip-path" clip-path="url(#nested-clip-path)">
<rect x="0" y="100" width="300" height="300" />
</clipPath>
<rect x="0" y="0" width="300" height="300" fill="red" mask="url(#mask)" clip-path="url(#clip-path)"/>
<rect x="100" y="100" width="100" height="100" fill="green"/>
</svg>

After

Width:  |  Height:  |  Size: 787 B

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg">
<rect x="100" y="100" width="100" height="100" fill="green"/>
</svg>

After

Width:  |  Height:  |  Size: 112 B

View file

@ -1,4 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<br><br><br><br><br>
<p>There should be no red.</p> <p>There should be no red.</p>
<div style="position:absolute; top:0; left:0; background-color:green; height:100px; width:100px;"></div> <div style="position:absolute; top:0; left:0; background-color:green; height:100px; width:100px;"></div>
<div style="position:absolute; bottom:0; right:0; background-color:green; height:100px; width:100px;"></div> <div style="position:absolute; bottom:0; right:0; background-color:green; height:100px; width:100px;"></div>

View file

@ -2,6 +2,7 @@
<title>Abspos elements nested inside a column spanner</title> <title>Abspos elements nested inside a column spanner</title>
<link rel="help" href="href=https://drafts.csswg.org/css-multicol/"> <link rel="help" href="href=https://drafts.csswg.org/css-multicol/">
<link rel="match" href="abspos-containing-block-outside-spanner-ref.html"> <link rel="match" href="abspos-containing-block-outside-spanner-ref.html">
<br><br><br><br><br>
<p>There should be no red.</p> <p>There should be no red.</p>
<div style="position:absolute; top:0; left:0; background-color:red; height:100px; width:100px;"></div> <div style="position:absolute; top:0; left:0; background-color:red; height:100px; width:100px;"></div>
<div style="position:absolute; bottom:0; right:0; background-color:red; height:100px; width:100px;"></div> <div style="position:absolute; bottom:0; right:0; background-color:red; height:100px; width:100px;"></div>

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1157299">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="position: relative; width: 100px; height: 100px; box-sizing: border-box; overflow: auto; padding-bottom: 10px;">
<div style="background: green; margin-bottom: 10px;">
<div style="height: 100px; margin-bottom: -20px;"></div>
</div>
<div id="target" style="position: absolute; top: 0; left: 0;"></div>
</div>
<script>
document.body.offsetTop;
document.getElementById('target').style.top = '10px';
</script>

View file

@ -0,0 +1,7 @@
<!DOCTYPE html>
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1157299">
<link rel="match" href="../reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div style="width: 100px; height: 100px; box-sizing: border-box; overflow: auto; padding-bottom: 10px;">
<div style="height: 100px; background: green; margin-bottom: -10px;"></div>
</div>

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html class="test-wait">
<link rel="help" href="https://drafts.css-houdini.org/css-paint-api/">
<style>
#output {
width: 100px;
height: 100px;
}
body {
-webkit-mask-box-image-source: url(resources/dot.png);
column-count: 3;
}
.test-wait {
column-count: 600;
}
</style>
<body>
<div id="output"></div>
<script id="code" type="text/worklet">
registerPaint('green', class {
paint(ctx, geom) {}
});
</script>
<script>
// Regression test for crbug.com/1095163, the test passes as long as it doesn't
// crash.
var el = document.getElementById('output');
el.style.backgroundImage = 'paint(green)';
var blob = new Blob([document.getElementById('code').textContent],
{type: 'text/javascript'});
CSS.paintWorklet.addModule(URL.createObjectURL(blob)).then(function() {
document.documentElement.classList.remove("test-wait");
});
</script>
</body>
</html>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<canvas id ="output" width="100" height="100" style="background: blue;"></canvas>
<script>
"use strict";
const canvas = document.getElementById('output');
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 100, 100);
</script>

View file

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://html.spec.whatwg.org/#hostimportmoduledynamically(referencingscriptormodule,-specifier,-promisecapability)">
<link rel="match" href="dynamic-import-ref.html">
<style>
#output {
width: 100px;
height: 100px;
background-image: paint(rects);
background-color: blue;
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<body>
<div id="output"></div>
<script id="code" type="text/worklet">
registerPaint('rects', class {
async paint(ctx, geom) {
ctx.fillStyle = 'red';
try {
await import('./resources/imported-module.mjs');
} catch (e) {
if (e.constructor === TypeError) {
ctx.fillStyle = 'green';
}
}
ctx.fillRect(0, 0, geom.width, geom.height);
}
});
</script>
<script>
"use strict";
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
</script>

View file

@ -0,0 +1,2 @@
// This doesn't need to contain anything. If it's dynamically import()ed
// successfully, the test fails.

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<canvas id="output" width="100" height="100" style="background: blue;"></canvas>
<script>
"use strict";
const canvas = document.getElementById('output');
const ctx = canvas.getContext('2d');
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 100, 100);
</script>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://html.spec.whatwg.org/#calling-scripts">
<link rel="match" href="top-level-await-ref.html">
<style>
#output {
width: 100px;
height: 100px;
background-image: paint(rects);
background-color: blue;
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/worklet-reftest.js"></script>
<body>
<div id="output"></div>
<script id="code" type="text/worklet">
// This will cause a syntax error, and the paint processor will never get registered, in browsers
// without top-level await support.
await 1;
registerPaint('rects', class {
async paint(ctx, geom) {
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, geom.width, geom.height);
}
});
</script>
<script>
"use strict";
importWorkletAndTerminateTestAfterAsyncPaint(CSS.paintWorklet, document.getElementById('code').textContent);
</script>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: inline)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid;">
<div style="background: green; height: 100px; aspect-ratio: 1/1;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid;">
<div style="background: green; width: 100px; aspect-ratio: 1/1;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: inline, on replaced elements)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid;">
<img src="support/20x50-green.png" style="height: 100px; aspect-ratio: 1/1;">
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block, on replaced elements)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid;">
<img src="support/20x50-green.png" style="width: 100px; aspect-ratio: 1/1;">
</div>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: inline, on replaced elements) with auto && ratio</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: repeat(2, min-content);">
<img src="support/20x50-green.png" style="height: 100px; aspect-ratio: auto 1/1;">
<div style="background: green; width: 60px; height: 100px;"></div>
</div>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block, on replaced elements) with auto && ratio</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: repeat(2, min-content);">
<img src="support/20x50-green.png" style="width: 40px; aspect-ratio: auto 1/1;">
<div style="background: green; width: 60px; height: 100px;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block) with larger row track size</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-rows: 200px;">
<div style="background: green; width: 100px; aspect-ratio: 1/1;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid container (ratio-dependent: inline)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#layout-algorithm">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; height: 100px; aspect-ratio: 1/1;">
<div style="background: green;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid container (ratio-dependent: block)</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#layout-algorithm">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; width: 100px; aspect-ratio: 1/1;">
<div style="background: green;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block) with larger row track size</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: 200px;">
<div style="background: green; height: 100px; aspect-ratio: 1/1;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block) with larger row track size</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: 200px;">
<div style="background: green; height: 100px; aspect-ratio: 1/1; writing-mode: vertical-lr;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: grid item (ratio-dependent: block) with larger row track size</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: 200px; grid-template-rows: 200px;">
<div style="background: green; height: 50%; aspect-ratio: 1/1; writing-mode: vertical-lr;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: items stretched in both axes should ignore aspect ratio</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: 100px; grid-template-rows: 100px;">
<div style="background: green; aspect-ratio: 1/1; justify-self: stretch; align-self: stretch;"></div>
</div>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>CSS aspect-ratio: items stretched in one axis should respect aspect ratio with stretched size</title>
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#aspect-ratio">
<link rel="help" href="https://drafts.csswg.org/css-grid/#grid-item-sizing">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht" />
<style>
#reference-overlapped-red {
position: absolute;
background-color: red;
width: 100px;
height: 100px;
z-index: -1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="reference-overlapped-red"></div>
<div style="display: grid; grid-template-columns: 100px; grid-template-rows: 100px;">
<div style="background: green; aspect-ratio: 1/1; justify-self: stretch;"></div>
</div>

View file

@ -153,3 +153,15 @@ declare that they need access to the QUIC server:
The QUIC server is not yet enabled by default, so QUIC tests will be skipped The QUIC server is not yet enabled by default, so QUIC tests will be skipped
unless `--enable-quic` is specified to `./wpt run`. unless `--enable-quic` is specified to `./wpt run`.
### Test Features specified as query params
Alternatively to specifying [Test Features](file-names.md#test-features) in
the test filename, they can be specified by setting the `wpt_flags` in the
[test variant](testharness.html#variants). For example, the following variant
will be loaded over HTTPS:
```html
<meta name="variant" content="?wpt_flags=https">
```
`https`, `h2` and `www` features are supported by `wpt_flags`.

View file

@ -37,9 +37,8 @@ command](https://w3c.github.io/webdriver/#element-click):
```python ```python
from tests.support.asserts import assert_success from tests.support.asserts import assert_success
from tests.support.inline import inline
def test_null_response_value(session): def test_null_response_value(session, inline):
# The high-level API is used to set up a document and locate a click target # The high-level API is used to set up a document and locate a click target
session.url = inline("<p>foo") session.url = inline("<p>foo")
element = session.find.css("p", all=False) element = session.find.css("p", all=False)

View file

@ -9,6 +9,10 @@ def main(request, response):
] ]
key = request.GET.first(b"key", None) key = request.GET.first(b"key", None)
# We serialize the key into JSON, so have to decode it first.
if key is not None:
key = key.decode('utf-8')
body = u""" body = u"""
<!DOCTYPE html> <!DOCTYPE html>
<script src="/portals/resources/stash-utils.sub.js"></script> <script src="/portals/resources/stash-utils.sub.js"></script>

View file

@ -3,7 +3,7 @@
This directory contains tests for [HTML](https://html.spec.whatwg.org/multipage/). This directory contains tests for [HTML](https://html.spec.whatwg.org/multipage/).
Sub-directory names should be based on the URL of the corresponding part of the Sub-directory names should be based on the URL of the corresponding part of the
multipage-version specification. For example, The URL of multipage-version specification. For example, the URL of
"8.3 Base64 utility methods" is [https://html.spec.whatwg.org/multipage/webappapis.html#atob](https://html.spec.whatwg.org/multipage/webappapis.html#atob). So the directory in WPT is [webappapis/atob/](/html/webappapis/atob). "8.3 Base64 utility methods" is [https://html.spec.whatwg.org/multipage/webappapis.html#atob](https://html.spec.whatwg.org/multipage/webappapis.html#atob). So the directory in WPT is [webappapis/atob/](/html/webappapis/atob).
For historical reasons, parts of HTML have their own directories: For historical reasons, parts of HTML have their own directories:
@ -17,4 +17,5 @@ For historical reasons, parts of HTML have their own directories:
* [/websockets](/websockets) * [/websockets](/websockets)
* [/webstorage](/webstorage) * [/webstorage](/webstorage)
* [/workers](/workers) * [/workers](/workers)
* [/worklets](/worklets)
* [/x-frame-options](/x-frame-options) * [/x-frame-options](/x-frame-options)

View file

@ -0,0 +1,16 @@
<script>
onload = () => {
document.open();
document.write(`
<script>
try {
document.domain = document.domain;
parent.postMessage('document-domain-is-allowed', '*');
} catch (error) {
parent.postMessage('document-domain-is-disallowed', '*');
}
</sc`+`ript>
`);
document.close();
}
</script>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>
Check sandbox-flags aren't lost after using document.open().
</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
promise_test(async test => {
let message = new Promise(resolve =>
window.addEventListener("message", event => resolve(event.data))
);
let iframe = document.createElement("iframe");
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin");
iframe.setAttribute("src", "./resources/document-open.html")
document.body.appendChild(iframe);
assert_equals(await message, "document-domain-is-disallowed");
}, "document.open()");
promise_test(async test => {
let iframe = document.createElement("iframe");
iframe.setAttribute("sandbox", "allow-scripts allow-same-origin");
iframe.setAttribute("src", "/common/blank.html");
let loaded = new Promise(resolve => {iframe.onload = resolve; });
document.body.appendChild(iframe);
await loaded;
let message = new Promise(resolve =>
window.addEventListener("message", event => resolve(event.data))
);
iframe.contentDocument.open();
iframe.contentDocument.write(`
<script>
try {
document.domain = document.domain;
parent.postMessage('document-domain-is-allowed', '*');
} catch (error) {
parent.postMessage('document-domain-is-disallowed', '*');
}
</sc`+`ript>
`);
iframe.contentDocument.close();
assert_equals(await message, "document-domain-is-disallowed");
}, "other_document.open()");
</script>
</body>
</html>

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Test navigating to about:blank while window.open initial load pending.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(t => {
// Open a new window and initiate a navigation. The test does not actually
// expect this navigation to complete so it does not matter what URL is
// used other than it must not be about:blank. The intent is to start a
// navigation to some URL and then assign about:blank to the location
// attribute. This assignment should stop the inital navigation and start a
// new navigation to about:blank. When the about:blank page finishes loading
// the load event is expected to fire and the document URL should to be set to
// about:blank.
var window1 = window.open('resources/post-to-opener.html', '_blank');
t.add_cleanup(() => {
window1.close();
});
window1.location = 'about:blank';
window1.onload = t.step_func_done(e => {
assert_equals(window1.document.URL, "about:blank");
});
}, 'Navigating to about:blank while window.open initial load pending.');
</script>

View file

@ -78,7 +78,7 @@ function runConvertToBlobTest(testScenario) {
var ctx = srcCanvas.getContext('2d', testScenario.canvasColorParam); var ctx = srcCanvas.getContext('2d', testScenario.canvasColorParam);
var compositeOverBlack = (testScenario.encodeOptions.type == "image/jpeg"); var compositeOverBlack = (testScenario.encodeOptions.type == "image/jpeg");
drawPatternOnCanvsa(ctx, testScenario.alpha, compositeOverBlack); drawPatternOnCanvsa(ctx, testScenario.alpha, compositeOverBlack);
var refPixels = ctx.getImageData(0, 0, 2, 2).data; var refPixels = ctx.getImageData(0, 0, 2, 2, testScenario.imageSetting).data;
var t = async_test("Test canvas convertToBlob(): " + var t = async_test("Test canvas convertToBlob(): " +
testScenarioToString(testScenario)); testScenarioToString(testScenario));
@ -88,7 +88,7 @@ function runConvertToBlobTest(testScenario) {
var dstCanvas = createCanvas(testScenario); var dstCanvas = createCanvas(testScenario);
var dstCtx = dstCanvas.getContext('2d', testScenario.canvasColorParam); var dstCtx = dstCanvas.getContext('2d', testScenario.canvasColorParam);
dstCtx.drawImage(image, 0, 0); dstCtx.drawImage(image, 0, 0);
var actualPixels = dstCtx.getImageData(0, 0, 2, 2).data; var actualPixels = dstCtx.getImageData(0, 0, 2, 2, testScenario.imageSetting).data;
testPixels(actualPixels, refPixels, testScenario); testPixels(actualPixels, refPixels, testScenario);
}); });
@ -122,6 +122,11 @@ function runAllTests() {
{colorSpace: 'srgb', pixelFormat: 'uint8'}, {colorSpace: 'srgb', pixelFormat: 'uint8'},
{colorSpace: 'srgb', pixelFormat: 'float16'}, {colorSpace: 'srgb', pixelFormat: 'float16'},
]; ];
var imageSettings = [
{colorSpace: 'srgb', storageFormat: 'uint8'},
{colorSpace: 'srgb', storageFormat: 'float32'},
];
var alphaValues = [0.5, 1]; var alphaValues = [0.5, 1];
// The *correct* way to test convertToBlob() is to directly examine the // The *correct* way to test convertToBlob() is to directly examine the
@ -137,6 +142,7 @@ function runAllTests() {
testScenario.encodeOptions = encodeOptionsSet[i]; testScenario.encodeOptions = encodeOptionsSet[i];
testScenario.canvasColorParam = canvasColorParams[j]; testScenario.canvasColorParam = canvasColorParams[j];
testScenario.alpha = alphaValues[k]; testScenario.alpha = alphaValues[k];
testScenario.imageSetting = imageSettings[j]
testScenarioSet.push(testScenario); testScenarioSet.push(testScenario);
} }

View file

@ -37,13 +37,13 @@ var e_sRGB_TransparentBlueImage = [0.121521, 0.121521, 0.886230, 0.501953];
// sRGB(226,31,31,128) // sRGB(226,31,31,128)
var e_sRGB_TransparentBlackImage = [0.121521, 0.121521, 0.121521, 0.501953]; var e_sRGB_TransparentBlackImage = [0.121521, 0.121521, 0.121521, 0.501953];
function testPixels(ctx, tests, sourceType) function testPixels(ctx, tests, sourceType, imageSetting)
{ {
var actual, expected, tolerance = 0.025; var actual, expected, tolerance = 0.025;
if (sourceType === 'video') if (sourceType === 'video')
tolerance = 0.03; tolerance = 0.03;
for (var i = 0; i < tests.length; i++) { for (var i = 0; i < tests.length; i++) {
actual = ctx.getImageData(tests[i][0], tests[i][1], 1, 1).data; actual = ctx.getImageData(tests[i][0], tests[i][1], 1, 1, imageSetting).data;
assert_implements(actual, 'ImageData data not supported'); assert_implements(actual, 'ImageData data not supported');
expected = tests[i][2]; expected = tests[i][2];
assert_equals(actual.length, expected.length); assert_equals(actual.length, expected.length);
@ -59,6 +59,7 @@ function checkNoCrop(imageBitmap, colorInfo, sourceType)
canvas.height = 50; canvas.height = 50;
var ctx = canvas.getContext('2d', var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'}); {colorSpace: 'srgb', pixelFormat:'float16'});
var imageSetting = {colorSpace: 'srgb', storageFormat:'float32'}
ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(imageBitmap, 0, 0); ctx.drawImage(imageBitmap, 0, 0);
var tests; var tests;
@ -100,7 +101,7 @@ function checkNoCrop(imageBitmap, colorInfo, sourceType)
"This pixel should be e-sRGB transparent black."], "This pixel should be e-sRGB transparent black."],
[41, 41, transparentBlack, [41, 41, transparentBlack,
"This pixel should be transparent black."]]; "This pixel should be transparent black."]];
testPixels(ctx, tests, sourceType); testPixels(ctx, tests, sourceType, imageSetting);
} }
function checkCrop(imageBitmap, colorInfo, sourceType) function checkCrop(imageBitmap, colorInfo, sourceType)
@ -110,6 +111,7 @@ function checkCrop(imageBitmap, colorInfo, sourceType)
canvas.height = 50; canvas.height = 50;
var ctx = canvas.getContext('2d', var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'}); {colorSpace: 'srgb', pixelFormat:'float16'});
var imageSetting = {colorSpace: 'srgb', storageFormat:'float32'};
ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(imageBitmap, 0, 0); ctx.drawImage(imageBitmap, 0, 0);
var tests; var tests;
@ -151,7 +153,7 @@ function checkCrop(imageBitmap, colorInfo, sourceType)
"This pixel should be e-sRGB transparent black."], "This pixel should be e-sRGB transparent black."],
[21, 21, transparentBlack, [21, 21, transparentBlack,
"This pixel should be transparent black."]]; "This pixel should be transparent black."]];
testPixels(ctx, tests, sourceType); testPixels(ctx, tests, sourceType, imageSetting);
} }
@ -171,9 +173,11 @@ function compareBitmaps(bitmap1, bitmap2)
ctx2.clearRect(0, 0, canvas2.width, canvas2.height); ctx2.clearRect(0, 0, canvas2.width, canvas2.height);
ctx1.drawImage(bitmap1, 0, 0); ctx1.drawImage(bitmap1, 0, 0);
ctx2.drawImage(bitmap2, 0, 0); ctx2.drawImage(bitmap2, 0, 0);
var data1 = ctx1.getImageData(0, 0, 50, 50).data; var data1 = ctx1.getImageData(0, 0, 50, 50,
{colorSpace: 'srgb', storageFormat:'float32'}).data;
assert_implements(data1, 'ImageData data not supported'); assert_implements(data1, 'ImageData data not supported');
var data2 = ctx2.getImageData(0, 0, 50, 50).data; var data2 = ctx2.getImageData(0, 0, 50, 50,
{colorSpace: 'srgb', storageFormat:'float32'}).data;
assert_implements(data2, 'ImageData data not supported'); assert_implements(data2, 'ImageData data not supported');
var dataMatched = true; var dataMatched = true;
for (var i = 0; i < data1.length; i++) { for (var i = 0; i < data1.length; i++) {
@ -430,7 +434,8 @@ runAllCreateImageBitmapFromColorManagedBlobTests();
promise_test(async () => { promise_test(async () => {
var canvas = initializeTestCanvas('srgb', 'uint8'); var canvas = initializeTestCanvas('srgb', 'uint8');
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
var data = ctx.getImageData(0, 0, 20, 20); var data = ctx.getImageData(0, 0, 20, 20,
{colorSpace: 'srgb', storageFormat:'uint8'});
await testImageBitmapOpaque(data); await testImageBitmapOpaque(data);
}, 'createImageBitmap in e-sRGB from an opaque sRGB ImageData with resize.'); }, 'createImageBitmap in e-sRGB from an opaque sRGB ImageData with resize.');
@ -439,7 +444,8 @@ promise_test(async () => {
var canvas = initializeTestCanvas('srgb', 'float16'); var canvas = initializeTestCanvas('srgb', 'float16');
var ctx = canvas.getContext('2d', var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'}); {colorSpace: 'srgb', pixelFormat:'float16'});
var data = ctx.getImageData(0, 0, 20, 20); var data = ctx.getImageData(0, 0, 20, 20,
{colorSpace: 'srgb', storageFormat:'float32'});
await testImageBitmapOpaque(data); await testImageBitmapOpaque(data);
}, 'createImageBitmap in e-sRGB from an opaque e-sRGB ImageData with resize.'); }, 'createImageBitmap in e-sRGB from an opaque e-sRGB ImageData with resize.');
@ -449,7 +455,8 @@ promise_test(async () => {
promise_test(async () => { promise_test(async () => {
var canvas = initializeTestCanvasTransparent('srgb', 'uint8'); var canvas = initializeTestCanvasTransparent('srgb', 'uint8');
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
var data = ctx.getImageData(0, 0, 20, 20); var data = ctx.getImageData(0, 0, 20, 20,
{colorSpace: 'srgb', storageFormat:'uint8'});
await testImageBitmapTransparent(data); await testImageBitmapTransparent(data);
}, 'createImageBitmap in e-sRGB from a transparent sRGB ImageData with resize.'); }, 'createImageBitmap in e-sRGB from a transparent sRGB ImageData with resize.');
@ -458,7 +465,8 @@ promise_test(async () => {
var canvas = initializeTestCanvasTransparent('srgb', 'float16'); var canvas = initializeTestCanvasTransparent('srgb', 'float16');
var ctx = canvas.getContext('2d', var ctx = canvas.getContext('2d',
{colorSpace: 'srgb', pixelFormat:'float16'}); {colorSpace: 'srgb', pixelFormat:'float16'});
var data = ctx.getImageData(0, 0, 20, 20); var data = ctx.getImageData(0, 0, 20, 20,
{colorSpace: 'srgb', storageFormat:'float32'});
await testImageBitmapTransparent(data); await testImageBitmapTransparent(data);
}, 'createImageBitmap in e-sRGB from a transparent e-sRGB ImageData with resize.'); }, 'createImageBitmap in e-sRGB from a transparent e-sRGB ImageData with resize.');

View file

@ -20,12 +20,12 @@ function checkImageData(canvasColorSettings, imageData) {
// Test createImageData when the canvas is color managed // Test createImageData when the canvas is color managed
var helperImageData = new ImageData(xWidth, xHeight); var helperImageData = new ImageData(xWidth, xHeight);
function runTestCreateImageData(canvasColorSettings) { function runTestCreateImageData(canvasColorSettings, imageSetting) {
var aCanvas = document.createElement("canvas"); var aCanvas = document.createElement("canvas");
aCanvas.width = xWidth; aCanvas.width = xWidth;
aCanvas.height = xHeight; aCanvas.height = xHeight;
var ctx = aCanvas.getContext('2d', canvasColorSettings); var ctx = aCanvas.getContext('2d', canvasColorSettings);
var imageData = ctx.createImageData(xWidth, xHeight); var imageData = ctx.createImageData(xWidth, xHeight, imageSetting);
checkImageData(canvasColorSettings, imageData); checkImageData(canvasColorSettings, imageData);
imageData = ctx.createImageData(helperImageData); imageData = ctx.createImageData(helperImageData);
@ -34,41 +34,47 @@ function runTestCreateImageData(canvasColorSettings) {
var testScenariosCreateImageData = [ var testScenariosCreateImageData = [
["Test color managed cretateImageData: {srgb, uint8} -> {srgb, uint8}", ["Test color managed cretateImageData: {srgb, uint8} -> {srgb, uint8}",
{colorSpace: "srgb", pixelFormat: "uint8"}], {colorSpace: "srgb", pixelFormat: "uint8"},
{colorSpace: "srgb", storageFormat: "uint8"}],
["Test color managed cretateImageData: {srgb, float16} -> {srgb, float32}", ["Test color managed cretateImageData: {srgb, float16} -> {srgb, float32}",
{colorSpace: "srgb", pixelFormat: "float16"}], {colorSpace: "srgb", pixelFormat: "float16"},
{colorSpace: "srgb", storageFormat: "float32"}],
]; ];
function runCreateImageDataTests() { function runCreateImageDataTests() {
for (var i = 0; i < testScenariosCreateImageData.length; i++){ for (var i = 0; i < testScenariosCreateImageData.length; i++){
var t = test(function() { var t = test(function() {
runTestCreateImageData(testScenariosCreateImageData[i][1]); runTestCreateImageData(testScenariosCreateImageData[i][1],
testScenariosCreateImageData[i][2]);
}, testScenariosCreateImageData[i][0]); }, testScenariosCreateImageData[i][0]);
} }
} }
runCreateImageDataTests(); runCreateImageDataTests();
// Test getImageData when the canvas is color managed // Test getImageData when the canvas is color managed
function runTestGetImageData(canvasColorSettings) { function runTestGetImageData(canvasColorSettings, imageSetting) {
var aCanvas = document.createElement("canvas"); var aCanvas = document.createElement("canvas");
aCanvas.width = xWidth; aCanvas.width = xWidth;
aCanvas.height = xHeight; aCanvas.height = xHeight;
var ctx = aCanvas.getContext('2d', canvasColorSettings); var ctx = aCanvas.getContext('2d', canvasColorSettings);
var imageData = ctx.getImageData(0, 0, xWidth, xHeight); var imageData = ctx.getImageData(0, 0, xWidth, xHeight, imageSetting);
checkImageData(canvasColorSettings, imageData); checkImageData(canvasColorSettings, imageData);
} }
var testScenariosGetImageData = [ var testScenariosGetImageData = [
["Test color managed getImageData: {srgb, uint8} -> {srgb, uint8}", ["Test color managed getImageData: {srgb, uint8} -> {srgb, uint8}",
{colorSpace: "srgb", pixelFormat: "uint8"}], {colorSpace: "srgb", pixelFormat: "uint8"},
{colorSpace: "srgb", storageFormat: "uint8"}],
["Test color managed getImageData: {srgb, float16} -> {srgb, float32}", ["Test color managed getImageData: {srgb, float16} -> {srgb, float32}",
{colorSpace: "srgb", pixelFormat: "float16"}], {colorSpace: "srgb", pixelFormat: "float16"},
{colorSpace: "srgb", storageFormat: "float32"}],
]; ];
function runGetImageDataTests() { function runGetImageDataTests() {
for (var i = 0; i < testScenariosGetImageData.length; i++){ for (var i = 0; i < testScenariosGetImageData.length; i++){
var t = test(function() { var t = test(function() {
runTestGetImageData(testScenariosGetImageData[i][1]); runTestGetImageData(testScenariosGetImageData[i][1],
testScenariosGetImageData[i][2]);
}, testScenariosGetImageData[i][0]); }, testScenariosGetImageData[i][0]);
} }
} }
@ -81,6 +87,7 @@ function prepareTestScenariosPutImageData() {
var colorSpaces = ["srgb"]; var colorSpaces = ["srgb"];
var imageDataStorageFormats = ["uint8", "uint16", "float32"]; var imageDataStorageFormats = ["uint8", "uint16", "float32"];
var canvasPixelFormats = ["uint8", "float16"]; var canvasPixelFormats = ["uint8", "float16"];
// var canvasStorageFormats = ["uint8", "float32"];
for (i = 0; i < colorSpaces.length; i++) for (i = 0; i < colorSpaces.length; i++)
for (j = 0; j < imageDataStorageFormats.length; j++) for (j = 0; j < imageDataStorageFormats.length; j++)
@ -93,7 +100,8 @@ function prepareTestScenariosPutImageData() {
{colorSpace: colorSpaces[i], storageFormat: imageDataStorageFormats[j]}; {colorSpace: colorSpaces[i], storageFormat: imageDataStorageFormats[j]};
canvasColorSettings = canvasColorSettings =
{colorSpace: colorSpaces[k], pixelFormat: canvasPixelFormats[l]}; {colorSpace: colorSpaces[k], pixelFormat: canvasPixelFormats[l]};
testScenariosPutImageData.push([testTitle, imageDataColorSettings, canvasColorSettings]); testScenariosPutImageData.push([testTitle, imageDataColorSettings,
canvasColorSettings]);
} }
} }

View file

@ -29,14 +29,16 @@ function runTest(testScenario) {
var refCtx = refCanvas.getContext( var refCtx = refCanvas.getContext(
'2d', testScenario.canvasColorParams); '2d', testScenario.canvasColorParams);
refCtx.drawImage(_8bitImage, 0, 0); refCtx.drawImage(_8bitImage, 0, 0);
var refPixels = refCtx.getImageData(0, 0, 2, 2).data; var refPixels = refCtx.getImageData(0, 0, 2, 2,
testScenario.imageSetting).data;
var testCanvas = document.createElement("canvas"); var testCanvas = document.createElement("canvas");
testCanvas.width = testCanvas.height = 2; testCanvas.width = testCanvas.height = 2;
var testCtx = testCanvas.getContext( var testCtx = testCanvas.getContext(
'2d', testScenario.canvasColorParams); '2d', testScenario.canvasColorParams);
testCtx.drawImage(_16bitImage, 0, 0); testCtx.drawImage(_16bitImage, 0, 0);
var testPixels = testCtx.getImageData(0, 0, 2, 2).data; var testPixels = testCtx.getImageData(0, 0, 2, 2,
testScenario.imageSetting).data;
assert_array_approx_equals(refPixels, testPixels, tolerance); assert_array_approx_equals(refPixels, testPixels, tolerance);
@ -73,6 +75,11 @@ function runAllTests() {
{colorSpace: 'srgb', pixelFormat: 'float16'}, {colorSpace: 'srgb', pixelFormat: 'float16'},
]; ];
var imageSettings = [
{colorSpace: 'srgb', storageFormat: 'uint8'},
{colorSpace: 'srgb', storageFormat: 'float32'},
];
var testScenarioSet = []; var testScenarioSet = [];
var id = 1; var id = 1;
for (var i = 0; i < canvasColorParams.length; i++) { for (var i = 0; i < canvasColorParams.length; i++) {
@ -81,6 +88,7 @@ function runAllTests() {
for (var m = 0; m < pngInterlaceStatus.length; m++) { for (var m = 0; m < pngInterlaceStatus.length; m++) {
var testScenario = {}; var testScenario = {};
testScenario.canvasColorParams = canvasColorParams[i]; testScenario.canvasColorParams = canvasColorParams[i];
testScenario.imageSetting = imageSettings[i];
testScenario._8bitImagePath = _8bitPngPrefix + testScenario._8bitImagePath = _8bitPngPrefix +
pngColorSpaces[j] + pngTransparencyStatus[k] + ".png"; pngColorSpaces[j] + pngTransparencyStatus[k] + ".png";
testScenario._16bitImagePath = _16bitPngPrefix + testScenario._16bitImagePath = _16bitPngPrefix +

View file

@ -12,11 +12,11 @@ var e_sRGB_TransparentBlue = [0.121521, 0.121521, 0.886230, 0.501953];
// sRGB(226,31,31,128) // sRGB(226,31,31,128)
var e_sRGB_TransparentBlack = [0.121521, 0.121521, 0.121521, 0.501953]; var e_sRGB_TransparentBlack = [0.121521, 0.121521, 0.121521, 0.501953];
function testPixels(ctx, tests) function testPixels(ctx, tests, imageSetting)
{ {
var actual, expected, tolerance = 0.01; var actual, expected, tolerance = 0.01;
for (var i = 0; i < tests.length; i++) { for (var i = 0; i < tests.length; i++) {
actual = ctx.getImageData(tests[i].x, tests[i].y, 1, 1).data; actual = ctx.getImageData(tests[i].x, tests[i].y, 1, 1, imageSetting).data;
expected = tests[i].color; expected = tests[i].color;
assert_equals(actual.length, expected.length); assert_equals(actual.length, expected.length);
for (var j = 0; j < actual.length; j++) for (var j = 0; j < actual.length; j++)
@ -36,7 +36,7 @@ function drawSRGBImageOnExtendedSRGBCanvas(source)
{x: 15, y: 5, color: e_sRGB_TransparentGreen}, {x: 15, y: 5, color: e_sRGB_TransparentGreen},
{x: 5, y: 15, color: e_sRGB_TransparentBlue}, {x: 5, y: 15, color: e_sRGB_TransparentBlue},
{x: 15, y: 15, color: e_sRGB_TransparentBlack}]; {x: 15, y: 15, color: e_sRGB_TransparentBlack}];
testPixels(ctx, tests); testPixels(ctx, tests, {colorSpace: 'srgb', storageFormat:'float32'});
} }
promise_test(function() { promise_test(function() {

View file

@ -88,10 +88,10 @@ function initializeOffscreenCanvasTransparent(canvasColorSpace, canvasPixelForma
return offscreen; return offscreen;
} }
function testPixels(testCtx, refCtx, pixelFormat, isTrnasparent) function testPixels(testCtx, refCtx, pixelFormat, image_setting, isTrnasparent)
{ {
var actual = testCtx.getImageData(0, 0, 4, 4).data; var actual = testCtx.getImageData(0, 0, 4, 4, image_setting).data;
var expected = refCtx.getImageData(0, 0, 4, 4).data; var expected = refCtx.getImageData(0, 0, 4, 4, image_setting).data;
var tolerance = 4; var tolerance = 4;
if (pixelFormat === 'float16') if (pixelFormat === 'float16')
@ -111,8 +111,10 @@ function runDrawOffscreenCanvasTestOpaque(testScenario) {
var offscreen_canvas_opaque = initializeOffscreenCanvas( var offscreen_canvas_opaque = initializeOffscreenCanvas(
testScenario.imageColorSpace, testScenario.imagePixelFormat); testScenario.imageColorSpace, testScenario.imagePixelFormat);
canvas_ctx_blank.drawImage(offscreen_canvas_opaque, 0, 0); canvas_ctx_blank.drawImage(offscreen_canvas_opaque, 0, 0);
var image_setting = {colorSpace: testScenario.canvasColorSpace,
storageFormat: testScenario.storageFormat}
testPixels(canvas_ctx_blank, canvas_ctx_opaque, testPixels(canvas_ctx_blank, canvas_ctx_opaque,
testScenario.canvasPixelFormat, false); testScenario.canvasPixelFormat, image_setting, false);
} }
function runDrawOffscreenCanvasTestTransparent(testScenario) { function runDrawOffscreenCanvasTestTransparent(testScenario) {
@ -124,19 +126,23 @@ function runDrawOffscreenCanvasTestTransparent(testScenario) {
var offscreen_canvas_transparent = initializeOffscreenCanvasTransparent( var offscreen_canvas_transparent = initializeOffscreenCanvasTransparent(
testScenario.imageColorSpace, testScenario.imagePixelFormat); testScenario.imageColorSpace, testScenario.imagePixelFormat);
canvas_ctx_blank.drawImage(offscreen_canvas_transparent, 0, 0); canvas_ctx_blank.drawImage(offscreen_canvas_transparent, 0, 0);
var image_setting = {colorSpace: testScenario.canvasColorSpace,
storageFormat: testScenario.storageFormat}
testPixels(canvas_ctx_blank, canvas_ctx_transparent, testPixels(canvas_ctx_blank, canvas_ctx_transparent,
testScenario.canvasPixelFormat, true); testScenario.canvasPixelFormat, image_setting, true);
} }
function runAllTests() { function runAllTests() {
var canvasColorSpaces = ['srgb']; var canvasColorSpaces = ['srgb'];
var canvasPixelFormats = ['uint8', 'float16']; var canvasPixelFormats = ['uint8', 'float16'];
var storageFormats = ['uint8', 'float32'];
var testScenarioSet = []; var testScenarioSet = [];
for (var i = 0; i < canvasColorSpaces.length; i++) { for (var i = 0; i < canvasColorSpaces.length; i++) {
for (var j = 0; j < canvasPixelFormats.length; j++) { for (var j = 0; j < canvasPixelFormats.length; j++) {
var canvas_color_space = canvasColorSpaces[i]; var canvas_color_space = canvasColorSpaces[i];
var canvas_pixel_format = canvasPixelFormats[j]; var canvas_pixel_format = canvasPixelFormats[j];
var image_storage_format = storageFormats[j];
for (var k = 0; k < canvasColorSpaces.length; k++) { for (var k = 0; k < canvasColorSpaces.length; k++) {
for (var m = 0; m < canvasPixelFormats.length; m++) { for (var m = 0; m < canvasPixelFormats.length; m++) {
var image_host_color_space = canvasColorSpaces[k]; var image_host_color_space = canvasColorSpaces[k];
@ -147,6 +153,7 @@ function runAllTests() {
testScenario.canvasPixelFormat = canvas_pixel_format; testScenario.canvasPixelFormat = canvas_pixel_format;
testScenario.imageColorSpace = image_host_color_space; testScenario.imageColorSpace = image_host_color_space;
testScenario.imagePixelFormat = image_host_pixel_format; testScenario.imagePixelFormat = image_host_pixel_format;
testScenario.storageFormat = image_storage_format;
testScenarioSet.push(testScenario); testScenarioSet.push(testScenario);
} }
} }

View file

@ -27,7 +27,7 @@ function drawSRGBThenGetImageData_e_sRGB() {
{colorSpace: 'srgb', pixelFormat:'float16'}); {colorSpace: 'srgb', pixelFormat:'float16'});
ctx.fillStyle = 'rgba(51, 102, 153, 0.8)'; ctx.fillStyle = 'rgba(51, 102, 153, 0.8)';
ctx.fillRect(0, 0, 10, 10); ctx.fillRect(0, 0, 10, 10);
var pixel = ctx.getImageData(5, 5, 1, 1).data; var pixel = ctx.getImageData(5, 5, 1, 1, {colorSpace: 'srgb', storageFormat:'float32'}).data;
// Check against the same color in e-sRGB. 0.01 protects the test against // Check against the same color in e-sRGB. 0.01 protects the test against
// color conversion deviations. // color conversion deviations.
assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01); assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01);
@ -46,7 +46,7 @@ function putImageData_e_sRGBThenGetImageData_e_sRGB_InRange() {
imageData.data[2] = 0.6; imageData.data[2] = 0.6;
imageData.data[3] = 0.8; imageData.data[3] = 0.8;
ctx.putImageData(imageData, 5, 5); ctx.putImageData(imageData, 5, 5);
var pixel = ctx.getImageData(5, 5, 1, 1).data; var pixel = ctx.getImageData(5, 5, 1, 1, {colorSpace: 'srgb', storageFormat:'float32'}).data;
// Check against the same color in e-sRGB. 0.001 protects the test against // Check against the same color in e-sRGB. 0.001 protects the test against
// rounding errors. // rounding errors.
assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01); assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01);
@ -65,7 +65,7 @@ function putImageData_e_sRGBThenGetImageData_e_sRGB_OutOfRange() {
imageData.data[2] = 0.7; imageData.data[2] = 0.7;
imageData.data[3] = 1.8; imageData.data[3] = 1.8;
ctx.putImageData(imageData, 5, 5); ctx.putImageData(imageData, 5, 5);
var pixel = ctx.getImageData(5, 5, 1, 1).data; var pixel = ctx.getImageData(5, 5, 1, 1, {colorSpace: 'srgb', storageFormat:'float32'}).data;
// Check against the same color in e-sRGB. 0.001 protects the test against // Check against the same color in e-sRGB. 0.001 protects the test against
// rounding errors. // rounding errors.
assert_array_approx_equals(pixel, [1.3, -1.13, 0.7, 1.8], 0.01); assert_array_approx_equals(pixel, [1.3, -1.13, 0.7, 1.8], 0.01);
@ -85,7 +85,7 @@ function putImageDataSRGBThenGetImageData_e_sRGB() {
imageData.data[2] = 153; imageData.data[2] = 153;
imageData.data[3] = 204; imageData.data[3] = 204;
ctx.putImageData(imageData, 5, 5); ctx.putImageData(imageData, 5, 5);
var pixel = ctx.getImageData(5, 5, 1, 1).data; var pixel = ctx.getImageData(5, 5, 1, 1, {colorSpace: 'srgb', storageFormat:'float32'}).data;
// Check against the same color in e-sRGB. 0.01 protects the test against // Check against the same color in e-sRGB. 0.01 protects the test against
// color conversion deviations. // color conversion deviations.
assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01); assert_array_approx_equals(pixel, [0.2, 0.4, 0.6, 0.8], 0.01);

View file

@ -87,8 +87,10 @@ function initializeColorManagedCanvas(canvasColorSettings)
} }
var canvasColorSettingsSet = [ var canvasColorSettingsSet = [
{name: "SRGB", colorSettings: {colorSpace: "srgb", pixelFormat: "uint8"}}, {name: "SRGB", colorSettings: {colorSpace: "srgb", pixelFormat: "uint8"},
{name: "e-SRGB", colorSettings: {colorSpace: "srgb", pixelFormat: "float16"}}, imageSetting: {colorSpace: "srgb", storageFormat: "uint8"}},
{name: "e-SRGB", colorSettings: {colorSpace: "srgb", pixelFormat: "float16"},
imageSetting: {colorSpace: "srgb", storageFormat: "float32"}},
]; ];
var srgbImageDataU8, e_srgbImageDataU16, e_srgbImageDataF32; var srgbImageDataU8, e_srgbImageDataU16, e_srgbImageDataF32;
@ -127,10 +129,10 @@ var imageDataColorSettingsSet = [
// * ImageData imagedata = ctx.createImageData(width, height); // * ImageData imagedata = ctx.createImageData(width, height);
// No color conversion. imagedata follows the color settings of the canvas. // No color conversion. imagedata follows the color settings of the canvas.
function runTestCreateImageDataWH(canvasColorSettings) { function runTestCreateImageDataWH(canvasColorSettings, imageSetting) {
var canvas = initializeColorManagedCanvas(canvasColorSettings); var canvas = initializeColorManagedCanvas(canvasColorSettings);
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
var imageData = ctx.createImageData(xWidth, xHeight); var imageData = ctx.createImageData(xWidth, xHeight, imageSetting);
checkImageDataColorSettings(canvasColorSettings, imageData); checkImageDataColorSettings(canvasColorSettings, imageData);
} }
@ -139,13 +141,15 @@ for (var i = 0; i < canvasColorSettingsSet.length; i++) {
var message = "Test createImageData(width, height) from " + var message = "Test createImageData(width, height) from " +
canvasColorSettingsSet[i].name + " canvas "; canvasColorSettingsSet[i].name + " canvas ";
testScenariosCreateImageDataWH. testScenariosCreateImageDataWH.
push([message, canvasColorSettingsSet[i].colorSettings]); push([message, canvasColorSettingsSet[i].colorSettings,
canvasColorSettingsSet[i].imageSetting]);
} }
function runTestCreateImageDataWHTests() { function runTestCreateImageDataWHTests() {
for (var i = 0; i < testScenariosCreateImageDataWH.length; i++){ for (var i = 0; i < testScenariosCreateImageDataWH.length; i++){
var t = test(function() { var t = test(function() {
runTestCreateImageDataWH(testScenariosCreateImageDataWH[i][1]); runTestCreateImageDataWH(testScenariosCreateImageDataWH[i][1],
testScenariosCreateImageDataWH[i][2]);
}, testScenariosCreateImageDataWH[i][0]); }, testScenariosCreateImageDataWH[i][0]);
} }
} }
@ -156,10 +160,10 @@ runTestCreateImageDataWHTests();
// * ImageData imagedata = ctx.getImageData(sx, sy, sw, sh); // * ImageData imagedata = ctx.getImageData(sx, sy, sw, sh);
// No color conversion. imagedata follows the color settings of the canvas. // No color conversion. imagedata follows the color settings of the canvas.
function runTestGetImageDataXYWH(canvasColorSettings) { function runTestGetImageDataXYWH(canvasColorSettings, imageSetting) {
var canvas = initializeColorManagedCanvas(canvasColorSettings); var canvas = initializeColorManagedCanvas(canvasColorSettings);
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
var imageData = ctx.getImageData(0, 0, xWidth, xHeight); var imageData = ctx.getImageData(0, 0, xWidth, xHeight, imageSetting);
checkImageDataColorSettings(canvasColorSettings, imageData); checkImageDataColorSettings(canvasColorSettings, imageData);
checkImageDataColorValues(canvasColorSettings, imageData); checkImageDataColorValues(canvasColorSettings, imageData);
} }
@ -169,13 +173,15 @@ for (var i = 0; i < canvasColorSettingsSet.length; i++) {
var message = "Test getImageData(sx, sy, sw, sh) from " + var message = "Test getImageData(sx, sy, sw, sh) from " +
canvasColorSettingsSet[i].name + " canvas "; canvasColorSettingsSet[i].name + " canvas ";
testScenariosGetImageDataXYWH. testScenariosGetImageDataXYWH.
push([message, canvasColorSettingsSet[i].colorSettings]); push([message, canvasColorSettingsSet[i].colorSettings,
canvasColorSettingsSet[i].imageSetting]);
} }
function runTestGetImageDataXYWHTests() { function runTestGetImageDataXYWHTests() {
for (var i = 0; i < testScenariosGetImageDataXYWH.length; i++){ for (var i = 0; i < testScenariosGetImageDataXYWH.length; i++){
var t = test(function() { var t = test(function() {
runTestGetImageDataXYWH(testScenariosGetImageDataXYWH[i][1]); runTestGetImageDataXYWH(testScenariosGetImageDataXYWH[i][1],
testScenariosGetImageDataXYWH[i][2]);
}, testScenariosGetImageDataXYWH[i][0]); }, testScenariosGetImageDataXYWH[i][0]);
} }
} }
@ -186,7 +192,7 @@ runTestGetImageDataXYWHTests();
// * void ctx.putImageData(imagedata, dx, dy, ...); // * void ctx.putImageData(imagedata, dx, dy, ...);
// Color conversion, if needed, to the color settings of the canvas. // Color conversion, if needed, to the color settings of the canvas.
function runTestPutImageDataDxDy(canvasColorSettings, imageData) { function runTestPutImageDataDxDy(canvasColorSettings, imageData, imageSetting) {
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
canvas.width = xWidth * 2; canvas.width = xWidth * 2;
canvas.height = xHeight * 2; canvas.height = xHeight * 2;
@ -194,7 +200,7 @@ function runTestPutImageDataDxDy(canvasColorSettings, imageData) {
{colorSpace: canvasColorSettings.colorSpace, {colorSpace: canvasColorSettings.colorSpace,
pixelFormat: canvasColorSettings.pixelFormat}); pixelFormat: canvasColorSettings.pixelFormat});
ctx.putImageData(imageData, xWidth/2, xHeight/2); ctx.putImageData(imageData, xWidth/2, xHeight/2);
var ctxImageData = ctx.getImageData(xWidth/2, xHeight/2, xWidth, xHeight); var ctxImageData = ctx.getImageData(xWidth/2, xHeight/2, xWidth, xHeight, imageSetting);
checkImageDataColorSettings(canvasColorSettings, ctxImageData); checkImageDataColorSettings(canvasColorSettings, ctxImageData);
checkImageDataColorValues(canvasColorSettings, ctxImageData, 'noBlank', checkImageDataColorValues(canvasColorSettings, ctxImageData, 'noBlank',
xWidth, xHeight, 'isWCG_U8toSRGB_U8'); xWidth, xHeight, 'isWCG_U8toSRGB_U8');
@ -208,7 +214,8 @@ for (var i = 0; i < canvasColorSettingsSet.length; i++) {
imageDataColorSettingsSet[j].name + " ImageData"; imageDataColorSettingsSet[j].name + " ImageData";
testScenariosPutImageDataDxDy. testScenariosPutImageDataDxDy.
push([message, canvasColorSettingsSet[i].colorSettings, push([message, canvasColorSettingsSet[i].colorSettings,
imageDataColorSettingsSet[j].imageData]); imageDataColorSettingsSet[j].imageData,
canvasColorSettingsSet[i].imageSetting]);
} }
} }
@ -216,7 +223,8 @@ function runTestPutImageDataDxDyTests() {
for (var i = 0; i < testScenariosPutImageDataDxDy.length; i++){ for (var i = 0; i < testScenariosPutImageDataDxDy.length; i++){
var t = test(function() { var t = test(function() {
runTestPutImageDataDxDy( runTestPutImageDataDxDy(
testScenariosPutImageDataDxDy[i][1], testScenariosPutImageDataDxDy[i][2]); testScenariosPutImageDataDxDy[i][1], testScenariosPutImageDataDxDy[i][2],
testScenariosPutImageDataDxDy[i][3]);
}, testScenariosPutImageDataDxDy[i][0]); }, testScenariosPutImageDataDxDy[i][0]);
} }
} }
@ -248,7 +256,8 @@ for (var i = 0; i < canvasColorSettingsSet.length; i++) {
imageDataColorSettingsSet[j].name + " ImageData"; imageDataColorSettingsSet[j].name + " ImageData";
testScenariosCreateImageDataFromImageData. testScenariosCreateImageDataFromImageData.
push([message, canvasColorSettingsSet[i].colorSettings, push([message, canvasColorSettingsSet[i].colorSettings,
imageDataColorSettingsSet[j].imageData]); imageDataColorSettingsSet[j].imageData,
canvasColorSettingsSet[i].imageSetting]);
} }
} }

View file

@ -41,7 +41,7 @@ function generateExpectedResult(testScenario, canvas)
ctx.fillRect(0, 1, 1, 1); ctx.fillRect(0, 1, 1, 1);
ctx.fillStyle = generateFillStyle(27, 27, 27, testScenario.alpha); ctx.fillStyle = generateFillStyle(27, 27, 27, testScenario.alpha);
ctx.fillRect(1, 1, 1, 1); ctx.fillRect(1, 1, 1, 1);
return ctx.getImageData(0, 0, 2, 2).data; return ctx.getImageData(0, 0, 2, 2, testScenario.imageSetting).data;
} }
function generateTestName(testScenario) { function generateTestName(testScenario) {
@ -79,7 +79,7 @@ function runTransferFromImageBitmapTest(testScenario) {
{colorSpace: testScenario.colorSpace, {colorSpace: testScenario.colorSpace,
pixelFormat: testScenario.pixelFormat}); pixelFormat: testScenario.pixelFormat});
ctx.drawImage(dstCanvas, 0, 0); ctx.drawImage(dstCanvas, 0, 0);
var actualPixels = ctx.getImageData(0, 0, 2, 2).data; var actualPixels = ctx.getImageData(0, 0, 2, 2, testScenario.imageSetting).data;
testPixels(actualPixels, expectedPixels, testScenario); testPixels(actualPixels, expectedPixels, testScenario);
}); });
}, generateTestName(testScenario)); }, generateTestName(testScenario));
@ -91,6 +91,10 @@ function runAllTests() {
{colorSpace: 'srgb', pixelFormat: 'uint8'}, {colorSpace: 'srgb', pixelFormat: 'uint8'},
{colorSpace: 'srgb', pixelFormat: 'float16'}, {colorSpace: 'srgb', pixelFormat: 'float16'},
]; ];
var imageSettings = [
{colorSpace: 'srgb', storageFormat: 'uint8'},
{colorSpace: 'srgb', storageFormat: 'float32'},
];
var alphaValues = [0.5, 1]; var alphaValues = [0.5, 1];
var colorSpaceConversions = ['none', 'default']; var colorSpaceConversions = ['none', 'default'];
@ -103,6 +107,7 @@ function runAllTests() {
testScenario.pixelFormat = colorSpaces[i].pixelFormat; testScenario.pixelFormat = colorSpaces[i].pixelFormat;
testScenario.alpha = alphaValues[j]; testScenario.alpha = alphaValues[j];
testScenario.colorSpaceConversion = colorSpaceConversions[k]; testScenario.colorSpaceConversion = colorSpaceConversions[k];
testScenario.imageSetting = imageSettings[i];
testScenarios.push(testScenario); testScenarios.push(testScenario);
} }

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<ol>
<details><summary>summary</summary></details>
<li value="1">1</li>
<li value="2">2 <details><summary>summary</summary></details></li>
<li value="3">3</li>
<details><summary>summary</summary></details>
<li value="4">4</li>
</ol>
<ol>
<summary>summary</summary>
<li value="1">1</li>
<li value="2">2 <summary>summary</summary></li>
<li value="3">3</li>
<summary>summary</summary>
<li value="4">4</li>
</ol>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<title>Check if SUMMARY has 'counter-increment: list-item 0'</title>
<link rel="match" href="summary-in-ol-ref.html">
<ol>
<details><summary>summary</summary></details>
<li>1</li>
<li>2 <details><summary>summary</summary></details></li>
<li>3</li>
<details><summary>summary</summary></details>
<li>4</li>
</ol>
<ol>
<summary>summary</summary>
<li>1</li>
<li>2 <summary>summary</summary></li>
<li>3</li>
<summary>summary</summary>
<li>4</li>
</ol>

View file

@ -8,7 +8,9 @@
"lodash-dotdot": "../node_modules/lodash-es/lodash.js", "lodash-dotdot": "../node_modules/lodash-es/lodash.js",
"lodash-dotdot/": "../node_modules/lodash-es/", "lodash-dotdot/": "../node_modules/lodash-es/",
"mapped/": "https://example.com/", "mapped/": "https://example.com/",
"mapped/path/": "https://github.com/WICG/import-maps/issues/207/" "mapped/path/": "https://github.com/WICG/import-maps/issues/207/",
"mapped/non-ascii-1/": "https://example.com/%E3%81%8D%E3%81%A4%E3%81%AD/",
"mapped/non-ascii-2/": "https://example.com/きつね/"
} }
}, },
"importMapBaseURL": "https://example.com/app/index.html", "importMapBaseURL": "https://example.com/app/index.html",
@ -46,11 +48,23 @@
"mapped/path": "https://example.com/path", "mapped/path": "https://example.com/path",
"mapped/path/": "https://github.com/WICG/import-maps/issues/207/", "mapped/path/": "https://github.com/WICG/import-maps/issues/207/",
"mapped/path/..": null, "mapped/path/..": null,
"mapped/path/../path/": null,
"mapped/path/../207": null,
"mapped/path/../207/": "https://github.com/WICG/import-maps/issues/207/",
"mapped/path//": null,
"mapped/path/WICG/import-maps/issues/207/": "https://github.com/WICG/import-maps/issues/207/WICG/import-maps/issues/207/",
"mapped/path//WICG/import-maps/issues/207/": "https://github.com/WICG/import-maps/issues/207/",
"mapped/path/../backtrack": null, "mapped/path/../backtrack": null,
"mapped/path/../../backtrack": null, "mapped/path/../../backtrack": null,
"mapped/path/../../../backtrack": null, "mapped/path/../../../backtrack": null,
"moment/../backtrack": null, "moment/../backtrack": null,
"moment/..": null "moment/..": null,
"mapped/non-ascii-1/": "https://example.com/%E3%81%8D%E3%81%A4%E3%81%AD/",
"mapped/non-ascii-1/../%E3%81%8D%E3%81%A4%E3%81%AD/": "https://example.com/%E3%81%8D%E3%81%A4%E3%81%AD/",
"mapped/non-ascii-1/../きつね/": "https://example.com/%E3%81%8D%E3%81%A4%E3%81%AD/",
"mapped/non-ascii-2/": "https://example.com/%E3%81%8D%E3%81%A4%E3%81%AD/",
"mapped/non-ascii-2/../%E3%81%8D%E3%81%A4%E3%81%AD/": "https://example.com/%E3%81%8D%E3%81%A4%E3%81%AD/",
"mapped/non-ascii-2/../きつね/": "https://example.com/%E3%81%8D%E3%81%A4%E3%81%AD/"
} }
} }
} }

View file

@ -8,7 +8,11 @@
"..": "/lib/dotdot.mjs", "..": "/lib/dotdot.mjs",
"..\\": "/lib/dotdotbackslash.mjs", "..\\": "/lib/dotdotbackslash.mjs",
"%2E": "/lib/percent2e.mjs", "%2E": "/lib/percent2e.mjs",
"%2F": "/lib/percent2f.mjs" "%2F": "/lib/percent2f.mjs",
"https://map.example/%E3%81%8D%E3%81%A4%E3%81%AD/": "/a/",
"https://map.example/きつね/fox/": "/b/",
"%E3%81%8D%E3%81%A4%E3%81%AD/": "/c/",
"きつね/fox/": "/d/"
} }
}, },
"importMapBaseURL": "https://example.com/app/index.html", "importMapBaseURL": "https://example.com/app/index.html",
@ -38,6 +42,30 @@
"expectedResults": { "expectedResults": {
"only-slash": null "only-slash": null
} }
},
"URL-like specifiers are normalized": {
"expectedResults": {
"https://map.example/%E3%81%8D%E3%81%A4%E3%81%AD/": "https://example.com/a/",
"https://map.example/%E3%81%8D%E3%81%A4%E3%81%AD/bar": "https://example.com/a/bar",
"https://map.example/%E3%81%8D%E3%81%A4%E3%81%AD/fox/": "https://example.com/b/",
"https://map.example/%E3%81%8D%E3%81%A4%E3%81%AD/fox/bar": "https://example.com/b/bar",
"https://map.example/きつね/": "https://example.com/a/",
"https://map.example/きつね/bar": "https://example.com/a/bar",
"https://map.example/きつね/fox/": "https://example.com/b/",
"https://map.example/きつね/fox/bar": "https://example.com/b/bar"
}
},
"Bare specifiers are not normalized": {
"expectedResults": {
"%E3%81%8D%E3%81%A4%E3%81%AD/": "https://example.com/c/",
"%E3%81%8D%E3%81%A4%E3%81%AD/bar": "https://example.com/c/bar",
"%E3%81%8D%E3%81%A4%E3%81%AD/fox/": "https://example.com/c/fox/",
"%E3%81%8D%E3%81%A4%E3%81%AD/fox/bar": "https://example.com/c/fox/bar",
"きつね/": null,
"きつね/bar": null,
"きつね/fox/": "https://example.com/d/",
"きつね/fox/bar": "https://example.com/d/bar"
}
} }
} }
} }

View file

@ -0,0 +1,10 @@
[http2-websocket.sub.h2.any.html]
[WSS over h2]
expected:
if product != "firefox": FAIL
[http2-websocket.sub.h2.any.worker.html]
[WSS over h2]
expected:
if product != "firefox": FAIL

View file

@ -0,0 +1,20 @@
function check(protocol, domain, port, done) {
var url = protocol + '://' + domain + ':' + port + '/echo';
var ws = new WebSocket(url);
ws.addEventListener('error', function() {
done(false);
});
ws.addEventListener('open', function() {
done(true);
});
}
async_test(function(t) {
check('wss', '{{browser_host}}', {{ports[h2][0]}}, t.step_func(function(result) {
assert_true(result);
t.done();
}));
}, 'WSS over h2');

View file

@ -0,0 +1,32 @@
<!doctype html>
<html>
<head>
<title>WPT Server checker</title>
<meta charset="utf-8" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<meta name="variant" content="">
<meta name="variant" content="?wpt_flags=h2">
<meta name="variant" content="?wpt_flags=https">
</head>
</body>
<body>
<script>
if (location.search == '?wpt_flags=h2') {
test(function() {
assert_equals(document.location.port, "{{ports[h2][0]}}");
}, "h2 port with wpt_flags=h2")
} else if (location.search == '?wpt_flags=https') {
test(function() {
assert_equals(document.location.port, "{{ports[https][0]}}");
}, "https port with wpt_flags=https")
} else {
test(function() {
assert_equals(document.location.port, "{{ports[http][0]}}");
}, "http port without flag")
}
</script>
</body>
</html>

View file

@ -1,4 +1,2 @@
from tests.support.inline import inline def test_load(session, inline):
def test_load(session):
inline("PASS") inline("PASS")

Some files were not shown because too many files have changed in this diff Show more