mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #23563 - servo-wpt-sync:wpt_update_13-06-2019, r=servo-wpt-sync
Sync WPT with upstream (13-06-2019) Automated downstream sync of changes from upstream as of 13-06-2019. [no-wpt-sync] <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23563) <!-- Reviewable:end -->
This commit is contained in:
commit
631f6bef8d
108 changed files with 3217 additions and 530 deletions
|
@ -14,9 +14,6 @@
|
|||
[Revoke blob URL after creating Request, will fetch]
|
||||
expected: FAIL
|
||||
|
||||
[Revoke blob URL after calling fetch, fetch should succeed]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[url-with-fetch.any.html]
|
||||
[Untitled]
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,13 @@
|
|||
[animation-timing-function-computed.html]
|
||||
[Property animation-timing-function value 'steps(2, jump-both)' computes to 'steps(2, jump-both)']
|
||||
expected: FAIL
|
||||
|
||||
[Property animation-timing-function value 'steps(2, jump-none)' computes to 'steps(2, jump-none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property animation-timing-function value 'steps(2, jump-start)' computes to 'steps(2, jump-start)']
|
||||
expected: FAIL
|
||||
|
||||
[Property animation-timing-function value 'steps(2, jump-end)' computes to 'steps(2)']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[transition-timing-function-computed.html]
|
||||
[Property transition-timing-function value 'steps(2, jump-none)' computes to 'steps(2, jump-none)']
|
||||
expected: FAIL
|
||||
|
||||
[Property transition-timing-function value 'steps(2, jump-start)' computes to 'steps(2, jump-start)']
|
||||
expected: FAIL
|
||||
|
||||
[Property transition-timing-function value 'steps(2, jump-end)' computes to 'steps(2)']
|
||||
expected: FAIL
|
||||
|
||||
[Property transition-timing-function value 'steps(2, jump-both)' computes to 'steps(2, jump-both)']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[border-color-computed.html]
|
||||
[Property border-color value 'red yellow' computes to 'rgb(255, 0, 0) rgb(255, 255, 0)']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-color value 'red yellow currentcolor' computes to 'rgb(255, 0, 0) rgb(255, 255, 0) rgb(0, 255, 0)']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-color value 'currentcolor' computes to 'rgb(0, 255, 0)']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-color value 'red yellow green blue' computes to 'rgb(255, 0, 0) rgb(255, 255, 0) rgb(0, 128, 0) rgb(0, 0, 255)']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[border-style-computed.html]
|
||||
[Property border-style value 'none' computes to 'none']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-style value 'hidden dotted dashed' computes to 'hidden dotted dashed']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-style value 'inset outset' computes to 'inset outset']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-style value 'solid double groove ridge' computes to 'solid double groove ridge']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
[border-width-computed.html]
|
||||
[Property border-width value '1px 2px 3px 4px' computes to '1px 2px 3px 4px']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-width value '0.5em' computes to '20px']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-width value '1px' computes to '1px']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-width value '1px 2px 3px' computes to '1px 2px 3px']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-width value '1px 2px' computes to '1px 2px']
|
||||
expected: FAIL
|
||||
|
||||
[Property border-width value '2px thin medium thick' computes to '2px 1px 3px 5px']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
[hyphens-computed.html]
|
||||
[Property hyphens value 'none' computes to 'none']
|
||||
expected: FAIL
|
||||
|
||||
[Property hyphens value 'manual' computes to 'manual']
|
||||
expected: FAIL
|
||||
|
||||
[Property hyphens value 'auto' computes to 'auto']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[letter-spacing-computed.html]
|
||||
[Property letter-spacing value 'normal' computes to '0px']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
[line-break-computed.html]
|
||||
[Property line-break value 'strict' computes to 'strict']
|
||||
expected: FAIL
|
||||
|
||||
[Property line-break value 'loose' computes to 'loose']
|
||||
expected: FAIL
|
||||
|
||||
[Property line-break value 'anywhere' computes to 'anywhere']
|
||||
expected: FAIL
|
||||
|
||||
[Property line-break value 'normal' computes to 'normal']
|
||||
expected: FAIL
|
||||
|
||||
[Property line-break value 'auto' computes to 'auto']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
[tab-size-computed.html]
|
||||
[Property tab-size value '2.5' computes to '2.5']
|
||||
expected: FAIL
|
||||
|
||||
[Property tab-size value '10px' computes to '10px']
|
||||
expected: FAIL
|
||||
|
||||
[Property tab-size value '4' computes to '4']
|
||||
expected: FAIL
|
||||
|
||||
[Property tab-size value '0px' computes to '0px']
|
||||
expected: FAIL
|
||||
|
||||
[Property tab-size value 'calc(10px - 0.5em)' computes to '0px']
|
||||
expected: FAIL
|
||||
|
||||
[Property tab-size value '0' computes to '0']
|
||||
expected: FAIL
|
||||
|
||||
[Property tab-size value '16' computes to '16']
|
||||
expected: FAIL
|
||||
|
||||
[Property tab-size value 'calc(10px + 0.5em)' computes to '30px']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
[text-align-last-computed.html]
|
||||
[Property text-align-last value 'justify' computes to 'justify']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-align-last value 'auto' computes to 'auto']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-align-last value 'end' computes to 'end']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-align-last value 'center' computes to 'center']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-align-last value 'start' computes to 'start']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-align-last value 'match-parent' computes to 'match-parent']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-align-last value 'right' computes to 'right']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-align-last value 'left' computes to 'left']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
[text-indent-computed.html]
|
||||
[Property text-indent value '10px hanging' computes to '10px hanging']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-indent value 'each-line hanging calc(10px + 0.5em)' computes to '30px hanging each-line']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-indent value '20% each-line' computes to '20% each-line']
|
||||
expected: FAIL
|
||||
|
||||
[Property text-indent value 'calc(50% + 60px) hanging each-line' computes to 'calc(50% + 60px) hanging each-line']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[text-justify-computed.html]
|
||||
[Property text-justify value 'inter-character' computes to 'inter-character']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[white-space-computed.html]
|
||||
[Property white-space value 'break-spaces' computes to 'break-spaces']
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[word-break-computed.html]
|
||||
[Property word-break value 'break-word' computes to 'break-word']
|
||||
expected: FAIL
|
||||
|
|
@ -315,21 +315,24 @@
|
|||
[<iframe>: combined response Content-Type: text/html;" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html */*]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html */*;charset=gbk]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: text/html;charset=gbk text/plain text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: separate response Content-Type: */* text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;x=" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: */* text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html */*]
|
||||
expected: FAIL
|
||||
|
||||
[<iframe>: combined response Content-Type: text/html;" \\" text/plain]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -11,6 +11,3 @@
|
|||
[X-Content-Type-Options%3A%20nosniff%0C]
|
||||
expected: FAIL
|
||||
|
||||
[X-Content-Type-Options%3A%20%22nosniFF%22]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[traverse_the_history_4.html]
|
||||
[traverse_the_history_5.html]
|
||||
[Multiple history traversals, last would be aborted]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
[anonymous.tentative.html]
|
||||
[Top-level with anonymous policy: navigating a frame to a null policy should fail.]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level with anonymous policy: creating a noopener popup with null policy should work.]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level popup with anonymous policy: Navigating the popup to a null policy should fail. (even opener window is closed)]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level popup with anonymous policy: Navigating the popup to a null policy should fail. (even when we clear the opener)]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level popup with anonymous policy: Navigating the popup to a null policy should fail.]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level noopener with anonymous policy: navigating to a different policy should work]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level with anonymous policy: creating a popup with null policy should fail.]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level with anonymous policy: navigating a frame from an anonymous policy to a null policy should fail.]
|
||||
expected: FAIL
|
||||
|
||||
[Fetch policy: anonymous policy no-cors fetches should be changed to cors]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level with anonymous policy: navigating a frame from a use-credentials policy to a null policy should fail.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[null.tentative.html]
|
||||
[Top-level noopener popup with use-credentials policy: navigating to a different (null) policy should work]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
[usecredentials.tentative.html]
|
||||
[Top-level with use-credentials policy: navigating a frame from a use-credentials policy to a null policy should fail]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level with use-credentials policy: navigating a frame to a null policy should fail.]
|
||||
expected: FAIL
|
||||
|
||||
[Top-level with use-credentials policy: navigating a frame from an anonymous policy to a null policy should fail.]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
[non-active-document.html]
|
||||
[DOMParser]
|
||||
expected: FAIL
|
||||
|
||||
[createHTMLDocument]
|
||||
expected: FAIL
|
||||
|
||||
[<template>]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
[realtimeanalyser-fft-scaling.html]
|
||||
expected: TIMEOUT
|
||||
[X 2048-point FFT peak position is not equal to 64. Got 0.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[active-processing.https.html]
|
||||
expected: ERROR
|
|
@ -0,0 +1,2 @@
|
|||
[Worker-constructor.html]
|
||||
expected: ERROR
|
|
@ -12,10 +12,10 @@
|
|||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/beacon/headers/header-referrer.js"></script>
|
||||
<script>
|
||||
var testBase = get_host_info().HTTPS_ORIGIN + RESOURCES_DIR;
|
||||
var testBase = get_host_info().HTTPS_REMOTE_ORIGIN + RESOURCES_DIR;
|
||||
testReferrerHeader(testBase, referrerOrigin);
|
||||
testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
|
||||
testReferrerHeader(testBase, "");
|
||||
testBase = get_host_info().HTTP_REMOTE_ORIGIN + RESOURCES_DIR;
|
||||
testReferrerHeader(testBase, "", true);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
var testBase = get_host_info().HTTPS_ORIGIN + RESOURCES_DIR;
|
||||
testReferrerHeader(testBase, referrerOrigin);
|
||||
testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
|
||||
testReferrerHeader(testBase, "");
|
||||
testReferrerHeader(testBase, "", true);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/beacon/headers/header-referrer.js"></script>
|
||||
<script>
|
||||
var testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
|
||||
var testBase = get_host_info().HTTPS_ORIGIN + RESOURCES_DIR;
|
||||
testReferrerHeader(testBase, referrerUrl);
|
||||
testBase = get_host_info().HTTP_ORIGIN + RESOURCES_DIR;
|
||||
testReferrerHeader(testBase, referrerUrl, true);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,12 +3,15 @@ var RESOURCES_DIR = "/beacon/resources/";
|
|||
var referrerOrigin = self.location.origin + '/';
|
||||
var referrerUrl = self.location.href;
|
||||
|
||||
function testReferrerHeader(testBase, expectedReferrer) {
|
||||
function testReferrerHeader(testBase, expectedReferrer, mayBeBlockedAsMixedContent = false) {
|
||||
var id = self.token();
|
||||
var testUrl = testBase + "inspect-header.py?header=referer&cmd=put&id=" + id;
|
||||
|
||||
promise_test(function(test) {
|
||||
assert_true(navigator.sendBeacon(testUrl), "SendBeacon Succeeded");
|
||||
const sentBeacon = navigator.sendBeacon(testUrl);
|
||||
if (mayBeBlockedAsMixedContent && !sentBeacon)
|
||||
return Promise.resolve();
|
||||
assert_true(sentBeacon, "SendBeacon Succeeded");
|
||||
return pollResult(expectedReferrer, id) .then(result => {
|
||||
assert_equals(result, expectedReferrer, "Correct referrer header result");
|
||||
});
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Animations: getComputedValue().animationTimingFunction</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-animations/#propdef-animation-timing-function">
|
||||
<meta name="assert" content="animation-timing-function computed value is a computed <easing-function> list.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("animation-timing-function", "linear");
|
||||
|
||||
test_computed_value("animation-timing-function", "ease");
|
||||
test_computed_value("animation-timing-function", "ease-in");
|
||||
test_computed_value("animation-timing-function", "ease-out");
|
||||
test_computed_value("animation-timing-function", "ease-in-out");
|
||||
test_computed_value("animation-timing-function", "cubic-bezier(0.1, 0.2, 0.8, 0.9)");
|
||||
test_computed_value("animation-timing-function", "cubic-bezier(0, -2, 1, 3)");
|
||||
test_computed_value("animation-timing-function", "cubic-bezier(0, 0.7, 1, 1.3)");
|
||||
|
||||
|
||||
test_computed_value("animation-timing-function", "steps(4, start)");
|
||||
test_computed_value("animation-timing-function", "steps(2, end)", "steps(2)");
|
||||
test_computed_value("animation-timing-function", "steps(2, jump-start)");
|
||||
test_computed_value("animation-timing-function", "steps(2, jump-end)", "steps(2)");
|
||||
test_computed_value("animation-timing-function", "steps(2, jump-both)");
|
||||
test_computed_value("animation-timing-function", "steps(2, jump-none)");
|
||||
|
||||
test_computed_value("animation-timing-function", "linear, ease, linear");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Animations: getComputedValue().transitionTimingFunction</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function">
|
||||
<meta name="assert" content="transition-timing-function computed value is a computed <easing-function> list.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("transition-timing-function", "linear");
|
||||
|
||||
test_computed_value("transition-timing-function", "ease");
|
||||
test_computed_value("transition-timing-function", "ease-in");
|
||||
test_computed_value("transition-timing-function", "ease-out");
|
||||
test_computed_value("transition-timing-function", "ease-in-out");
|
||||
test_computed_value("transition-timing-function", "cubic-bezier(0.1, 0.2, 0.8, 0.9)");
|
||||
test_computed_value("transition-timing-function", "cubic-bezier(0, -2, 1, 3)");
|
||||
test_computed_value("transition-timing-function", "cubic-bezier(0, 0.7, 1, 1.3)");
|
||||
|
||||
|
||||
test_computed_value("transition-timing-function", "steps(4, start)");
|
||||
test_computed_value("transition-timing-function", "steps(2, end)", "steps(2)");
|
||||
test_computed_value("transition-timing-function", "steps(2, jump-start)");
|
||||
test_computed_value("transition-timing-function", "steps(2, jump-end)", "steps(2)");
|
||||
test_computed_value("transition-timing-function", "steps(2, jump-both)");
|
||||
test_computed_value("transition-timing-function", "steps(2, jump-none)");
|
||||
|
||||
test_computed_value("transition-timing-function", "linear, ease, linear");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderColor</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-color">
|
||||
<meta name="assert" content="border-color computed value is the computed colors.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
color: lime;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
const currentColor = "rgb(0, 255, 0)";
|
||||
const red = "rgb(255, 0, 0)";
|
||||
const yellow = "rgb(255, 255, 0)";
|
||||
const green = "rgb(0, 128, 0)";
|
||||
const blue = "rgb(0, 0, 255)";
|
||||
|
||||
test_computed_value("border-color", "currentcolor", currentColor);
|
||||
test_computed_value("border-color", "red yellow", red + " " + yellow);
|
||||
test_computed_value("border-color", "red yellow currentcolor", red + " " + yellow + " " + currentColor);
|
||||
test_computed_value("border-color", "red yellow green blue", red + " " + yellow + " " + green + " " + blue);
|
||||
|
||||
test_computed_value("border-top-color", "red", red);
|
||||
test_computed_value("border-right-color", "yellow", yellow);
|
||||
test_computed_value("border-bottom-color", "green", green);
|
||||
test_computed_value("border-left-color", "blue", blue);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderImageOutset</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-image-outset">
|
||||
<meta name="assert" content="border-image-outset computed value is four values, each a number or absolute length.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("border-image-outset", "1px");
|
||||
test_computed_value("border-image-outset", "1px 2");
|
||||
test_computed_value("border-image-outset", "1px 2 3px");
|
||||
test_computed_value("border-image-outset", "1px 2 3px 4");
|
||||
test_computed_value("border-image-outset", "0 calc(0.5em + 10px) 3 calc(-0.5em + 10px)", "0 30px 3 0px");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderImageRepeat</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-image-repeat">
|
||||
<meta name="assert" content="border-image-repeat computed value is specified keywords.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("border-image-repeat", "round");
|
||||
test_computed_value("border-image-repeat", "stretch repeat");
|
||||
test_computed_value("border-image-repeat", "round space");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderImageSlice</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-image-slice">
|
||||
<meta name="assert" content="border-image-slice computed value is four values, each either a number or percentage; plus a fill keyword if specified.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("border-image-slice", "1");
|
||||
test_computed_value("border-image-slice", "1 2%");
|
||||
test_computed_value("border-image-slice", "1 2% 3");
|
||||
test_computed_value("border-image-slice", "1 2% 3 4%");
|
||||
|
||||
test_computed_value("border-image-slice", "1% 2 3% 4 fill");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderImageSource</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-image-source">
|
||||
<meta name="assert" content="border-image-source computed value is the keyword none or the specified image with URIs made absolute.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("border-image-source", "none");
|
||||
test_computed_value("border-image-source", 'url("http://www.example.com/")');
|
||||
|
||||
test(() => {
|
||||
const target = document.getElementById('target');
|
||||
target.style['border-image-source'] = 'url("a.b#c")';
|
||||
const result = getComputedStyle(target)['border-image-source'];
|
||||
const resolved = new URL("a.b#c", document.URL).href;
|
||||
assert_equals(result, 'url("' + resolved + '")');
|
||||
}, 'url values are made absolute');
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderImageWidth</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-image-width">
|
||||
<meta name="assert" content="border-image-width computed value is four values, each either a number, the keyword auto, or a computed length-percentage value.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("border-image-width", "1");
|
||||
test_computed_value("border-image-width", "auto");
|
||||
test_computed_value("border-image-width", "10px");
|
||||
test_computed_value("border-image-width", "20%");
|
||||
test_computed_value("border-image-width", "calc(20% + 10px)");
|
||||
test_computed_value("border-image-width", "calc(-0.5em + 10px)", "0px");
|
||||
test_computed_value("border-image-width", "calc(0.5em + 10px)", "30px");
|
||||
test_computed_value("border-image-width", "1 auto");
|
||||
test_computed_value("border-image-width", "1 auto 10px");
|
||||
test_computed_value("border-image-width", "1 auto 10px 20%");
|
||||
test_computed_value("border-image-width", "20% 10px auto 1");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderStyle</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-style">
|
||||
<meta name="assert" content="border-style computed value is the specified keywords.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("border-style", "none");
|
||||
test_computed_value("border-style", "inset outset");
|
||||
test_computed_value("border-style", "hidden dotted dashed");
|
||||
test_computed_value("border-style", "solid double groove ridge");
|
||||
|
||||
test_computed_value("border-top-style", "solid");
|
||||
test_computed_value("border-right-style", "double");
|
||||
test_computed_value("border-bottom-style", "groove");
|
||||
test_computed_value("border-left-style", "ridge");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,57 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Backgrounds and Borders: getComputedValue().borderWidth</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-width">
|
||||
<meta name="assert" content="border-width computed value is the absolute length; zero if the border style is none or hidden.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#box {
|
||||
border-style: dotted; /* Avoid border-*-width computed style 0 */
|
||||
border-top-width: thin;
|
||||
border-right-width: medium;
|
||||
border-bottom-width: thick;
|
||||
}
|
||||
#target {
|
||||
border-style: dotted; /* Avoid border-*-width computed style 0 */
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="box"></div>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
const box = document.getElementById('box');
|
||||
const thinWidth = getComputedStyle(box).borderTopWidth;
|
||||
const mediumWidth = getComputedStyle(box).borderRightWidth;
|
||||
const thickWidth = getComputedStyle(box).borderBottomWidth;
|
||||
|
||||
test_computed_value("border-width", "1px");
|
||||
test_computed_value("border-width", "1px 2px");
|
||||
test_computed_value("border-width", "1px 2px 3px");
|
||||
test_computed_value("border-width", "1px 2px 3px 4px");
|
||||
|
||||
test_computed_value("border-width", "0.5em", "20px");
|
||||
test_computed_value("border-width", "2px thin medium thick", "2px " + thinWidth + " " + mediumWidth + " " + thickWidth);
|
||||
|
||||
test_computed_value("border-top-width", "0px");
|
||||
test_computed_value("border-right-width", "10px");
|
||||
test_computed_value("border-bottom-width", "calc(-0.5em + 10px)", "0px");
|
||||
test_computed_value("border-left-width", "calc(0.5em + 10px)", "30px");
|
||||
|
||||
test(() => {
|
||||
const thin = Number(thinWidth.replace("px", ""));
|
||||
const medium = Number(mediumWidth.replace("px", ""));
|
||||
const thick = Number(thickWidth.replace("px", ""));
|
||||
assert_less_than_equal(0, thin);
|
||||
assert_less_than_equal(thin, medium);
|
||||
assert_less_than_equal(medium, thick);
|
||||
}, "thin ≤ medium ≤ thick");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Containment Test: Size containment on fieldset</title>
|
||||
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-contain-1/#containment-size">
|
||||
<link rel="match" href="reference/contain-size-fieldset-002-ref.html">
|
||||
<meta name=assert content="Size containment does apply to fieldsets, thus their size is the same than if they don't have contents.">
|
||||
<style>
|
||||
#border {
|
||||
border: 1px solid black;
|
||||
width: min-content;
|
||||
}
|
||||
fieldset {
|
||||
contain: size;
|
||||
visibility: hidden;
|
||||
height: 1px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test passes if it has the same output as the reference. You should see a black border box below.</p>
|
||||
<div id="border">
|
||||
<fieldset>
|
||||
<legend>legend</legend>
|
||||
Fieldset contents are here.
|
||||
</fieldset>
|
||||
</div>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Containment Test: Reference file</title>
|
||||
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
|
||||
<style>
|
||||
#border {
|
||||
border: 1px solid black;
|
||||
width: min-content;
|
||||
}
|
||||
fieldset {
|
||||
visibility: hidden;
|
||||
height: 1px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>This test passes if it has the same output as the reference. You should see a black border box below.</p>
|
||||
<div id="border">
|
||||
<fieldset></fieldset>
|
||||
</div>
|
|
@ -0,0 +1,51 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<title>Tests that we consider main axis sizes to be definite in column flexboxes
|
||||
when the height is an explicit definite height, even if the container does
|
||||
not have a definite main axis size.</title>
|
||||
<link rel="author" title="Google LLC" href="https://www.google.com/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#algo-main-item">
|
||||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
|
||||
|
||||
<style>
|
||||
/* Make it possible for red to appear in webkit/blink browsers. But the test
|
||||
* still works in other browsers, you'll just get a grey scrollbar that
|
||||
* shouldn't be there.
|
||||
*/
|
||||
::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb, ::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
background: red;
|
||||
}
|
||||
|
||||
#flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#item {
|
||||
height: 300px;
|
||||
overflow: auto;
|
||||
scrollbar-color: red;
|
||||
}
|
||||
|
||||
#child {
|
||||
height: 600px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
|
||||
|
||||
<div style="width: 100px; height: 100px; background: green;"></div>
|
||||
|
||||
<div id="flex">
|
||||
<div id="item">
|
||||
<div id="child">
|
||||
Text
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var item = document.getElementById('item');
|
||||
item.offsetHeight;
|
||||
item.style.width = 0;
|
||||
</script>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<title>CSS Font Loading test: Load Document FontFaceSet font without documentElement</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-font-loading/#font-face-set-load">
|
||||
<link rel="help" href="https://crbug.com/971035">
|
||||
<script>
|
||||
test(() => {
|
||||
document.documentElement.remove();
|
||||
var face = new FontFace("Ahem", "url(/fonts/Ahem.ttf)");
|
||||
document.fonts.add(face);
|
||||
document.fonts.load("12px Ahem");
|
||||
}, "Trigger font load after removing documentElement. Should not crash.");
|
||||
</script>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Multi-column Layout Test Reference: Test a bidi-override multi-column container with a dir=rtl column-span:all child</title>
|
||||
<link rel="author" title="Ting-Yu Lin" href="tlin@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
|
||||
<style>
|
||||
article {
|
||||
column-count: 1;
|
||||
column-rule: 6px solid;
|
||||
width: 400px;
|
||||
outline: 1px solid black;
|
||||
}
|
||||
h3 {
|
||||
/* "column-count: 1" makes this behave like a real spanner. */
|
||||
outline: 1px solid blue;
|
||||
}
|
||||
</style>
|
||||
|
||||
<article>
|
||||
<div>before</div><h3 dir="rtl">spanner</h3><div>after</div>
|
||||
</article>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Multi-column Layout Test: Test a bidi-override multi-column container with a dir=rtl column-span:all child</title>
|
||||
<link rel="author" title="Ting-Yu Lin" href="tlin@mozilla.com">
|
||||
<link rel="author" title="Mozilla" href="http://www.mozilla.org/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-multicol-1/#column-span">
|
||||
<link rel="match" href="multicol-span-all-011-ref.html">
|
||||
<meta name="assert" content="This test checks that the text is correctly split by 'dir=rtl' column-span:all child in a bidi-override multi-column container.">
|
||||
|
||||
<style>
|
||||
article {
|
||||
column-count: 2;
|
||||
column-rule: 6px solid;
|
||||
width: 400px;
|
||||
outline: 1px solid black;
|
||||
unicode-bidi: bidi-override; /* Needed to trigger bidi resolution. */
|
||||
}
|
||||
h3 {
|
||||
column-span: all;
|
||||
outline: 1px solid blue;
|
||||
}
|
||||
</style>
|
||||
|
||||
<article>
|
||||
<div>before<h3 dir="rtl">spanner</h3>after</div>
|
||||
</article>
|
||||
</html>
|
|
@ -0,0 +1,58 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-position-3/#def-cb">
|
||||
<link rel="help" href="https://crbug.com/970171">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
#container {
|
||||
position: relative;
|
||||
border: 1px solid black;
|
||||
}
|
||||
.narrow {
|
||||
width: 200px;
|
||||
height: 300px;
|
||||
}
|
||||
.wide {
|
||||
width: 300px;
|
||||
height: 200px;
|
||||
}
|
||||
#target {
|
||||
background: green;
|
||||
position: absolute;
|
||||
width: 50px;
|
||||
height: 30px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -25px;
|
||||
margin-top: -15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="container" class="narrow">
|
||||
<button id="target"></button>
|
||||
</div>
|
||||
<script>
|
||||
test( t => {
|
||||
let container = document.querySelector("#container");
|
||||
let target = document.querySelector("#target");
|
||||
document.body.offsetTop;
|
||||
// start off narrow
|
||||
let narrow_left = target.offsetLeft;
|
||||
let narrow_top = target.offsetTop;
|
||||
// make it wide
|
||||
container.classList.toggle("narrow");
|
||||
container.classList.toggle("wide");
|
||||
document.body.offsetTop;
|
||||
// make it narrow again
|
||||
container.classList.toggle("narrow");
|
||||
container.classList.toggle("wide");
|
||||
document.body.offsetTop;
|
||||
assert_equals(target.offsetLeft, narrow_left);
|
||||
assert_equals(target.offsetTop, narrow_top);
|
||||
}, "absolute positioned button with percentage top gets positioned");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().hyphens</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-hyphens">
|
||||
<meta name="assert" content="hyphens computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("hyphens", "none");
|
||||
test_computed_value("hyphens", "manual");
|
||||
test_computed_value("hyphens", "auto");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().letterSpacing</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-letter-spacing">
|
||||
<meta name="assert" content="letter-spacing computed value is an absolute length.">
|
||||
<meta name="assert" content="'normal' computes to zero.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("letter-spacing", "normal", "0px");
|
||||
|
||||
test_computed_value("letter-spacing", "10px");
|
||||
test_computed_value("letter-spacing", "-20px");
|
||||
test_computed_value("letter-spacing", "calc(10px - 0.5em)", "-10px");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().lineBreak</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-line-break">
|
||||
<meta name="assert" content="line-break computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("line-break", "auto");
|
||||
test_computed_value("line-break", "loose");
|
||||
test_computed_value("line-break", "normal");
|
||||
test_computed_value("line-break", "strict");
|
||||
test_computed_value("line-break", "anywhere");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().overflowWrap</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-overflow-wrap">
|
||||
<meta name="assert" content="overflow-wrap computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("overflow-wrap", "normal");
|
||||
test_computed_value("overflow-wrap", "break-word");
|
||||
test_computed_value("overflow-wrap", "anywhere");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().tabSize</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-tab-size">
|
||||
<meta name="assert" content="tab-size computed value is the specified number or an absolute length.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("tab-size", "0");
|
||||
test_computed_value("tab-size", "16");
|
||||
test_computed_value("tab-size", "4");
|
||||
test_computed_value("tab-size", "2.5");
|
||||
|
||||
test_computed_value("tab-size", "0px");
|
||||
test_computed_value("tab-size", "10px");
|
||||
test_computed_value("tab-size", "calc(10px + 0.5em)", "30px");
|
||||
test_computed_value("tab-size", "calc(10px - 0.5em)", "0px");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textAlignLast</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-align-last">
|
||||
<meta name="assert" content="text-align-last computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("text-align-last", "auto");
|
||||
test_computed_value("text-align-last", "start");
|
||||
test_computed_value("text-align-last", "end");
|
||||
test_computed_value("text-align-last", "left");
|
||||
test_computed_value("text-align-last", "right");
|
||||
test_computed_value("text-align-last", "center");
|
||||
test_computed_value("text-align-last", "justify");
|
||||
test_computed_value("text-align-last", "match-parent");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textIndent</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-indent">
|
||||
<meta name="assert" content="text-indent computed value is computed <length-percentage> value, plus any specified keywords.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("text-indent", "10px");
|
||||
test_computed_value("text-indent", "20%");
|
||||
test_computed_value("text-indent", "calc(50% + 60px)");
|
||||
test_computed_value("text-indent", "-30px");
|
||||
test_computed_value("text-indent", "-40%");
|
||||
test_computed_value("text-indent", "calc(10px - 0.5em)", "-10px");
|
||||
|
||||
test_computed_value("text-indent", "10px hanging");
|
||||
test_computed_value("text-indent", "20% each-line");
|
||||
test_computed_value("text-indent", "calc(50% + 60px) hanging each-line");
|
||||
test_computed_value("text-indent", "each-line hanging calc(10px + 0.5em)", "30px hanging each-line");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textJustify</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-justify">
|
||||
<meta name="assert" content="text-justify computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("text-justify", "auto");
|
||||
test_computed_value("text-justify", "none");
|
||||
test_computed_value("text-justify", "inter-word");
|
||||
test_computed_value("text-justify", "inter-character");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().textTransform</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-text-transform">
|
||||
<meta name="assert" content="text-transform computed value is specified keywords.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("text-transform", "none");
|
||||
|
||||
test_computed_value("text-transform", "capitalize");
|
||||
test_computed_value("text-transform", "uppercase");
|
||||
test_computed_value("text-transform", "lowercase");
|
||||
test_computed_value("text-transform", "full-width");
|
||||
test_computed_value("text-transform", "full-size-kana");
|
||||
|
||||
test_computed_value("text-transform", "capitalize full-width");
|
||||
test_computed_value("text-transform", "full-width full-size-kana");
|
||||
|
||||
test_computed_value("text-transform", "uppercase full-width full-size-kana");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().whiteSpace</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-white-space">
|
||||
<meta name="assert" content="white-space computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("white-space", "normal");
|
||||
test_computed_value("white-space", "pre");
|
||||
test_computed_value("white-space", "nowrap");
|
||||
test_computed_value("white-space", "pre-wrap");
|
||||
test_computed_value("white-space", "break-spaces");
|
||||
test_computed_value("white-space", "pre-line");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().wordBreak</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-break">
|
||||
<meta name="assert" content="word-break computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("word-break", "normal");
|
||||
test_computed_value("word-break", "keep-all");
|
||||
test_computed_value("word-break", "break-all");
|
||||
test_computed_value("word-break", "break-word");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().wordSpacing</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-spacing">
|
||||
<meta name="assert" content="word-spacing computed value is an absolute length.">
|
||||
<meta name="assert" content="'normal' computes to zero.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
<style>
|
||||
#target {
|
||||
font-size: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("word-spacing", "normal", "0px");
|
||||
|
||||
test_computed_value("word-spacing", "10px");
|
||||
test_computed_value("word-spacing", "-20px");
|
||||
test_computed_value("word-spacing", "calc(10px - 0.5em)", "-10px");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>CSS Text: getComputedValue().wordWrap</title>
|
||||
<link rel="help" href="https://www.w3.org/TR/css-text-3/#propdef-word-wrap">
|
||||
<meta name="assert" content="word-wrap computed value is specified keyword.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/css/support/computed-testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="target"></div>
|
||||
<script>
|
||||
test_computed_value("word-wrap", "normal");
|
||||
test_computed_value("word-wrap", "break-word");
|
||||
test_computed_value("word-wrap", "anywhere");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Test float + nbsp + break-word does not freeze</title>
|
||||
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=972421">
|
||||
<link rel="author" title="Koji Ishii" href="mailto:kojii@chromium.org">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
div {
|
||||
font-size: 10px;
|
||||
width: 10ch;
|
||||
border: 2px solid blue;
|
||||
}
|
||||
float {
|
||||
float: left;
|
||||
}
|
||||
.nowrap > div {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.break-word {
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<section>
|
||||
<div>123456<float></float>654321</div>
|
||||
<div>123456<float></float> 654321</div>
|
||||
</section>
|
||||
<section class="nowrap">
|
||||
<div>123456<float></float>654321</div>
|
||||
<div>123456<float></float> 654321</div>
|
||||
</section>
|
||||
<section class="break-word">
|
||||
<div>123456<float></float>654321</div>
|
||||
<div>123456<float></float> 654321</div>
|
||||
</section>
|
||||
<script>test(() => {
|
||||
document.body.offsetTop; // layout should not freeze.
|
||||
});</script>
|
||||
</body>
|
|
@ -0,0 +1,219 @@
|
|||
<!doctype html>
|
||||
<meta name="timeout" content="long">
|
||||
<title>Cross-Origin header and nested navigable resource without such header</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
t.step_timeout(() => {
|
||||
// Make sure the iframe didn't load.
|
||||
assert_equals(frame.contentDocument, null);
|
||||
t.done();
|
||||
}, 500);
|
||||
frame.src = "/common/blank.html";
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with anonymous policy: navigating a frame to a null policy should fail.");
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
|
||||
const CHANNEL_NAME = "frame-anon-to-blank";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
bc.onmessage = t.step_func((event) => {
|
||||
assert_not_equals(frame.contentDocument, null);
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
t.step_timeout(() => {
|
||||
assert_equals(frame.contentDocument, null, "Navigation to null policy should fail");
|
||||
t.done();
|
||||
}, 1500);
|
||||
});
|
||||
|
||||
frame.src = `resources/navigate_anonymous.sub.html?channelName=${CHANNEL_NAME}&to=/common/blank.html`;
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with anonymous policy: navigating a frame from an anonymous policy to a null policy should fail.");
|
||||
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
|
||||
const CHANNEL_NAME = "frame-usecredentials-to-blank";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
bc.onmessage = t.step_func((event) => {
|
||||
assert_not_equals(frame.contentDocument, null);
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
t.step_timeout(() => {
|
||||
assert_equals(frame.contentDocument, null, "Navigation to null policy should fail");
|
||||
t.done();
|
||||
}, 1500);
|
||||
});
|
||||
frame.src = `resources/navigate_usecredentials.sub.html?channelName=${CHANNEL_NAME}&to=/common/blank.html`;
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with anonymous policy: navigating a frame from a use-credentials policy to a null policy should fail.");
|
||||
|
||||
async_test(t => {
|
||||
let pageLoaded = false;
|
||||
const CHANNEL_NAME = "anon-null-window-noopener";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
let finished = false;
|
||||
bc.onmessage = t.step_func((event) => {
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
pageLoaded = true;
|
||||
});
|
||||
|
||||
const SECOND_CHANNEL = "anon-null-window-noopener-second";
|
||||
let bc2 = new BroadcastChannel(SECOND_CHANNEL);
|
||||
bc2.onmessage = t.step_func_done((event) => {
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
assert_equals(pageLoaded, true, "Opening a null window (noopener) from anon window should work");
|
||||
});
|
||||
|
||||
let win = window.open(`resources/navigate_null.sub.html?channelName=${CHANNEL_NAME}&to=navigate_null.sub.html?channelName=${SECOND_CHANNEL}`, "_blank", "noopener");
|
||||
}, "Top-level with anonymous policy: creating a noopener popup with null policy should work.");
|
||||
|
||||
async_test(t => {
|
||||
let pageLoaded = false;
|
||||
const CHANNEL_NAME = "anon-null-window";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
bc.onmessage = t.step_func_done((event) => {
|
||||
pageLoaded = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
let win = window.open(`resources/navigate_null.sub.html?channelName=${CHANNEL_NAME}&to=/common/blank.html`, "_blank");
|
||||
t.add_cleanup(() => win.close());
|
||||
t.step_timeout(() => {
|
||||
assert_equals(pageLoaded, false, "Opening a null window from anon window should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
}, "Top-level with anonymous policy: creating a popup with null policy should fail.");
|
||||
|
||||
async_test(t => {
|
||||
let pageLoaded = false;
|
||||
const CHANNEL_NAME = "anon-null-top-navigation";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
bc.onmessage = t.step_func((event) => {
|
||||
pageLoaded = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
const SECOND_CHANNEL = "anon-null-top-navigation-final";
|
||||
let bc2 = new BroadcastChannel(SECOND_CHANNEL);
|
||||
bc2.onmessage = t.step_func_done((event) => {
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
assert_equals(pageLoaded, true, "Opening a null window (noopener) from anon window should work");
|
||||
});
|
||||
|
||||
let win = window.open(`resources/navigate_anonymous.sub.html?channelName=${CHANNEL_NAME}&to=navigate_null.sub.html?channelName=${SECOND_CHANNEL}`, "_blank", "noopener");
|
||||
|
||||
}, "Top-level noopener with anonymous policy: navigating to a different policy should work");
|
||||
|
||||
promise_test(t => {
|
||||
let host_info = get_host_info();
|
||||
return fetch(host_info.HTTP_REMOTE_ORIGIN+"/html/cross-origin/resources/nothing.txt",
|
||||
{"mode": "no-cors", "method": "GET", "headers":{}}).then(r => {
|
||||
assert_equals(r.type, "cors", "type should have been changed to cors");
|
||||
});
|
||||
}, "Fetch policy: anonymous policy no-cors fetches should be changed to cors");
|
||||
|
||||
|
||||
async_test(t => {
|
||||
let pageLoaded = false;
|
||||
const CHANNEL_NAME = "anon-null-window";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
bc.onmessage = t.step_func_done((event) => {
|
||||
pageLoaded = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
const SECOND_CHANNEL = "anon-null-window-second";
|
||||
let navigated = false;
|
||||
let bc2 = new BroadcastChannel(SECOND_CHANNEL);
|
||||
bc2.onmessage = t.step_func((event) => {
|
||||
navigated = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
let win = window.open(`resources/navigate_anonymous.sub.html?channelName=${CHANNEL_NAME}&to=navigate_null.sub.html?channelName=${SECOND_CHANNEL}`, "_blank");
|
||||
t.add_cleanup(() => win.close());
|
||||
t.step_timeout(() => {
|
||||
assert_equals(pageLoaded, true, "Opening the popup window from anon window should work");
|
||||
assert_equals(navigated, false, "Navigating the popup to a null policy should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
}, "Top-level popup with anonymous policy: Navigating the popup to a null policy should fail.");
|
||||
|
||||
async_test(t => {
|
||||
let pageLoaded = false;
|
||||
const CHANNEL_NAME = "anon-null-window";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
bc.onmessage = t.step_func_done((event) => {
|
||||
pageLoaded = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
const SECOND_CHANNEL = "anon-null-window-second";
|
||||
let navigated = false;
|
||||
let bc2 = new BroadcastChannel(SECOND_CHANNEL);
|
||||
bc2.onmessage = t.step_func((event) => {
|
||||
navigated = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
let win = window.open(`resources/navigate_anonymous.sub.html?clearOpener=true&channelName=${CHANNEL_NAME}&to=navigate_null.sub.html?channelName=${SECOND_CHANNEL}`, "_blank");
|
||||
t.add_cleanup(() => win.close());
|
||||
t.step_timeout(() => {
|
||||
assert_equals(pageLoaded, true, "Opening the popup window from anon window should work");
|
||||
assert_equals(navigated, false, "Navigating the popup to a null policy should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
}, "Top-level popup with anonymous policy: Navigating the popup to a null policy should fail. (even when we clear the opener)");
|
||||
|
||||
async_test(t => {
|
||||
let popupLoaded = false;
|
||||
const CHANNEL_NAME = "anon-null-window-no-opener";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
bc.onmessage = t.step_func_done((event) => {
|
||||
let payload = event.data;
|
||||
if (payload == "loaded") {
|
||||
t.step_timeout(() => {
|
||||
assert_equals(popupLoaded, true, "Opening the popup window (noopener) from anon window should work");
|
||||
assert_equals(navigated, false, "Navigating the popup to a null policy should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
} else if (payload == "popup-loaded") {
|
||||
popupLoaded = true;
|
||||
} else {
|
||||
assert_unreached(`unexpected payload ${payload}`);
|
||||
}
|
||||
});
|
||||
|
||||
const SECOND_CHANNEL = "anon-null-window-second-popup";
|
||||
let navigated = false;
|
||||
let bc2 = new BroadcastChannel(SECOND_CHANNEL);
|
||||
bc2.onmessage = t.step_func((event) => {
|
||||
navigated = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
let win = window.open(`resources/popup_and_close.sub.html?channelName=${CHANNEL_NAME}&to=navigate_null.sub.html?channelName=${SECOND_CHANNEL}`, "_blank", "noopener");
|
||||
}, "Top-level popup with anonymous policy: Navigating the popup to a null policy should fail. (even opener window is closed)");
|
||||
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Cross-Origin: anonymous
|
|
@ -0,0 +1,103 @@
|
|||
<!doctype html>
|
||||
<meta name="timeout" content="long">
|
||||
<title>Cross-Origin header and nested navigable resource without such header</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
frame.onload = t.step_func_done(() => {
|
||||
assert_not_equals(frame.contentDocument, null, "The frame should actually load");
|
||||
});
|
||||
frame.src = "/common/blank.html";
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with null policy: navigating a frame to a null policy should work.");
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
let firstNavOk = false;
|
||||
frame.onload = t.step_func(() => {
|
||||
assert_not_equals(frame.contentDocument, null);
|
||||
firstNavOk = true;
|
||||
});
|
||||
t.step_timeout(() => {
|
||||
assert_equals(firstNavOk, true, "The initial load should work");
|
||||
assert_not_equals(frame.contentDocument, null, "Navigation to null policy should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
frame.src = "resources/navigate_anonymous.sub.html?to=/common/blank.html";
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with null policy: parent policy should apply to frame navigation from use-credentials policy to a null. Should succeed.");
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
let firstNavOk = false;
|
||||
frame.onload = t.step_func(() => {
|
||||
assert_not_equals(frame.contentDocument, null);
|
||||
firstNavOk = true;
|
||||
});
|
||||
t.step_timeout(() => {
|
||||
assert_equals(firstNavOk, true, "The initial load should work");
|
||||
assert_not_equals(frame.contentDocument, null, "Navigation to null policy should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
frame.src = "resources/navigate_anonymous.sub.html?to=/common/blank.html";
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with null policy: parent policy should apply to frame navigation from anonymous policy to a null. Should succeed.");
|
||||
|
||||
async_test(t => {
|
||||
let w = window.open(`resources/navigate_null.sub.html?to=navigate_anonymous.sub.html`, "window_name");
|
||||
|
||||
t.add_cleanup(() => w.close());
|
||||
|
||||
t.step_timeout(() => {
|
||||
w.history.back();
|
||||
t.step_timeout(() => {
|
||||
assert_not_equals(w.document, null);
|
||||
t.done();
|
||||
}, 500);
|
||||
}, 500);
|
||||
}, "Top-level with null policy: navigating a frame back from a blocked page should work.");
|
||||
|
||||
async_test(t => {
|
||||
let pageLoaded = false;
|
||||
const CHANNEL_NAME = "usecredentials-null-top-navigation";
|
||||
let bc = new BroadcastChannel(CHANNEL_NAME);
|
||||
let finished = false;
|
||||
bc.onmessage = t.step_func((event) => {
|
||||
pageLoaded = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
const SECOND_CHANNEL = "usecredentials-null-top-navigation-final";
|
||||
let bc2 = new BroadcastChannel(SECOND_CHANNEL);
|
||||
bc2.onmessage = t.step_func((event) => {
|
||||
finished = true;
|
||||
let payload = event.data;
|
||||
assert_equals(payload, "loaded");
|
||||
});
|
||||
|
||||
let win = window.open(`resources/navigate_usecredentials.sub.html?channelName=${CHANNEL_NAME}&to=navigate_null.sub.html?channelName=${SECOND_CHANNEL}`, "_blank", "noopener");
|
||||
|
||||
t.step_timeout(() => {
|
||||
assert_equals(pageLoaded, true, "Opening a null window (noopener) from usecredentials window should work");
|
||||
assert_equals(finished, true, "Navigating a top level window out of an usecredentials policy should work");
|
||||
t.done();
|
||||
}, 500);
|
||||
}, "Top-level noopener popup with use-credentials policy: navigating to a different (null) policy should work");
|
||||
|
||||
promise_test(t => {
|
||||
let host_info = get_host_info();
|
||||
return fetch(host_info.HTTP_REMOTE_ORIGIN+"/html/cross-origin/resources/nothing.txt",
|
||||
{"mode": "no-cors", "method": "GET", "headers":{}}).then(r => {
|
||||
assert_equals(r.type, "opaque", "type should be opaque for cross origin fetch");
|
||||
});
|
||||
}, "Fetch policy: null policy should not affect the no-cors mode");
|
||||
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Cross-Origin: unknown-should-be-parsed-as-null
|
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<script>
|
||||
let current = new URL(window.location.href);
|
||||
let navigateTo = current.searchParams.get("to");
|
||||
let channelName = current.searchParams.get("channelName");
|
||||
let clearOpener = current.searchParams.get("clearOpener");
|
||||
|
||||
if (clearOpener) {
|
||||
window.opener = null;
|
||||
}
|
||||
|
||||
current.search = "";
|
||||
if (navigateTo) {
|
||||
let next = new URL(navigateTo, current);
|
||||
setTimeout(() => {
|
||||
window.location = next.href;
|
||||
}, 50);
|
||||
}
|
||||
|
||||
if (channelName) {
|
||||
let bc = new BroadcastChannel(channelName);
|
||||
bc.postMessage("loaded");
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Cross-Origin: anonymous
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<script>
|
||||
let current = new URL(window.location.href);
|
||||
let navigateTo = current.searchParams.get("to");
|
||||
let channelName = current.searchParams.get("channelName");
|
||||
current.search = "";
|
||||
if (navigateTo) {
|
||||
let next = new URL(navigateTo, current);
|
||||
setTimeout(() => {
|
||||
window.location = next.href;
|
||||
}, 50);
|
||||
}
|
||||
|
||||
if (channelName) {
|
||||
let bc = new BroadcastChannel(channelName);
|
||||
bc.postMessage("loaded");
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<script>
|
||||
let current = new URL(window.location.href);
|
||||
let navigateTo = current.searchParams.get("to");
|
||||
let channelName = current.searchParams.get("channelName");
|
||||
current.search = "";
|
||||
if (navigateTo) {
|
||||
let next = new URL(navigateTo, current);
|
||||
setTimeout(() => {
|
||||
window.location = next.href;
|
||||
}, 50);
|
||||
}
|
||||
|
||||
if (channelName) {
|
||||
let bc = new BroadcastChannel(channelName);
|
||||
bc.postMessage("loaded");
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Cross-Origin: use-credentials
|
|
@ -0,0 +1 @@
|
|||
nothing
|
|
@ -0,0 +1 @@
|
|||
Access-Control-Allow-Origin: *
|
|
@ -0,0 +1,18 @@
|
|||
<!doctype html>
|
||||
<script>
|
||||
let current = new URL(window.location.href);
|
||||
let navigateTo = current.searchParams.get("to");
|
||||
let channelName = current.searchParams.get("channelName");
|
||||
let secondChannel = current.searchParams.get("secondChannel");
|
||||
|
||||
if (channelName) {
|
||||
let bc = new BroadcastChannel(channelName);
|
||||
bc.postMessage("popup-loaded");
|
||||
}
|
||||
|
||||
let win = window.open(`navigate_anonymous.sub.html?channelName=${channelName}&to=navigate_null.sub.html?channelName=${secondChannel}`, "_blank");
|
||||
|
||||
setTimeout(() => {
|
||||
window.close();
|
||||
}, 10);
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Cross-Origin: anonymous
|
|
@ -0,0 +1,54 @@
|
|||
<!doctype html>
|
||||
<meta name="timeout" content="long">
|
||||
<title>Cross-Origin header and nested navigable resource without such header</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
t.step_timeout(() => {
|
||||
// Make sure the iframe didn't load.
|
||||
assert_equals(frame.contentDocument, null);
|
||||
t.done();
|
||||
}, 500);
|
||||
frame.src = "/common/blank.html";
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with use-credentials policy: navigating a frame to a null policy should fail.");
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
let firstNavOk = false;
|
||||
frame.onload = t.step_func(() => {
|
||||
assert_not_equals(frame.contentDocument, null);
|
||||
firstNavOk = true;
|
||||
});
|
||||
t.step_timeout(() => {
|
||||
assert_equals(firstNavOk, true, "The initial load should work");
|
||||
assert_equals(frame.contentDocument, null, "Navigation to null policy should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
frame.src = "resources/navigate_usecredentials.sub.html?to=/common/blank.html";
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with use-credentials policy: navigating a frame from a use-credentials policy to a null policy should fail");
|
||||
|
||||
async_test(t => {
|
||||
const frame = document.createElement("iframe");
|
||||
let firstNavOk = false;
|
||||
frame.onload = t.step_func(() => {
|
||||
assert_not_equals(frame.contentDocument, null);
|
||||
firstNavOk = true;
|
||||
});
|
||||
t.step_timeout(() => {
|
||||
assert_equals(firstNavOk, true, "The initial load should work");
|
||||
assert_equals(frame.contentDocument, null, "Navigation to null policy should fail");
|
||||
t.done();
|
||||
}, 500);
|
||||
frame.src = "resources/navigate_anonymous.sub.html?to=/common/blank.html";
|
||||
document.body.append(frame);
|
||||
assert_equals(frame.contentDocument.body.localName, "body");
|
||||
}, "Top-level with use-credentials policy: navigating a frame from an anonymous policy to a null policy should fail.");
|
||||
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
Cross-Origin: use-credentials
|
|
@ -0,0 +1,19 @@
|
|||
<!doctype html>
|
||||
<img usemap="#map" src="data:image/gif;base64,R0lGODlhAQABAIAAAOTm7AAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" width="1000" height="1000" style="border: 1px solid black;">
|
||||
<map name="map">
|
||||
<area id="clickable-area" shape="rect" coords="0,0,500,500" href="#" role="img">
|
||||
<area id="nonclickable-area" shape="rect" coords="500,500,1000,1000" role="img"><!-- No href attribute.-->
|
||||
</map>
|
||||
|
||||
<p>An unclickable (non-link) area should not show the link cursor when hovered.</p>
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
test(function() {
|
||||
let clickable = window.getComputedStyle(document.getElementById('clickable-area'));
|
||||
let nonclickable = window.getComputedStyle(document.getElementById('nonclickable-area'));
|
||||
assert_equals(clickable.getPropertyValue('cursor'), 'pointer');
|
||||
assert_not_equals(nonclickable.getPropertyValue('cursor'), 'pointer');
|
||||
}, 'Only clickable areas should show the link cursor.');
|
||||
</script>
|
|
@ -4,7 +4,7 @@
|
|||
// Source: Page Visibility Level 2 (https://w3c.github.io/page-visibility/)
|
||||
|
||||
enum VisibilityState {
|
||||
"hidden", "visible", "prerender"
|
||||
"hidden", "visible"
|
||||
};
|
||||
|
||||
partial interface Document {
|
||||
|
|
|
@ -26,7 +26,7 @@ interface PerformanceObserver {
|
|||
void observe(optional PerformanceObserverInit options);
|
||||
void disconnect();
|
||||
PerformanceEntryList takeRecords();
|
||||
static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
|
||||
[SameObject] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
|
||||
};
|
||||
|
||||
dictionary PerformanceObserverInit {
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
// Source: Web NFC API (https://w3c.github.io/web-nfc/)
|
||||
|
||||
dictionary NDEFMessage {
|
||||
DOMString? serialNumber;
|
||||
sequence<NDEFRecord> records;
|
||||
USVString url;
|
||||
sequence<NDEFRecord> records;
|
||||
};
|
||||
|
||||
typedef (DOMString or unrestricted double or ArrayBuffer or Dictionary) NDEFRecordData;
|
||||
|
@ -43,10 +42,12 @@ interface NFCReader : EventTarget {
|
|||
|
||||
[Constructor(DOMString type, NFCReadingEventInit readingEventInitDict), SecureContext, Exposed=Window]
|
||||
interface NFCReadingEvent : Event {
|
||||
readonly attribute DOMString serialNumber;
|
||||
readonly attribute NDEFMessage message;
|
||||
};
|
||||
|
||||
dictionary NFCReadingEventInit : EventInit {
|
||||
DOMString? serialNumber = "";
|
||||
required NDEFMessage message;
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<!doctype html>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
|
||||
<link rel="author" title="Mozilla" href="https://mozilla.org">
|
||||
<link rel="help" href="https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-rootmargin">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1553673">
|
||||
<style>
|
||||
html { width: 100vw; height: 100vh }
|
||||
</style>
|
||||
<script>
|
||||
const t = async_test("IntersectionObserver root margin cannot end up with negative rect (and thus non-intersecting) due to rounding");
|
||||
|
||||
let remainingTests = 100;
|
||||
|
||||
// This is just a best-effort test to catch issues.
|
||||
for (let i = 0; i < 100; ++i) {
|
||||
let offset = i / 100;
|
||||
let observer;
|
||||
observer = new IntersectionObserver(t.step_func(function(entries) {
|
||||
assert_equals(entries.length, 1);
|
||||
assert_equals(entries[0].target, document.documentElement);
|
||||
assert_true(entries[0].isIntersecting, "should be intersecting at " + offset);
|
||||
if (!--remainingTests)
|
||||
t.done();
|
||||
observer.disconnect();
|
||||
}), { rootMargin: `${-100 * (1 - offset)}% 0px ${-100 * offset}%` });
|
||||
observer.observe(document.documentElement);
|
||||
}
|
||||
</script>
|
|
@ -168,6 +168,7 @@ SET TIMEOUT: html/browsers/history/the-location-interface/*
|
|||
SET TIMEOUT: html/browsers/history/the-session-history-of-browsing-contexts/*
|
||||
SET TIMEOUT: html/browsers/offline/*
|
||||
SET TIMEOUT: html/browsers/the-window-object/*
|
||||
SET TIMEOUT: html/cross-origin/resources/*
|
||||
SET TIMEOUT: html/editing/dnd/*
|
||||
SET TIMEOUT: html/semantics/embedded-content/the-iframe-element/*
|
||||
SET TIMEOUT: html/semantics/embedded-content/the-img-element/*
|
||||
|
@ -670,6 +671,8 @@ CSS-COLLIDING-REF-NAME: css/vendor-imports/mozilla/mozilla-central-reftests/cont
|
|||
CSS-COLLIDING-SUPPORT-NAME: css/css-backgrounds/support/red.png
|
||||
CSS-COLLIDING-REF-NAME: css/css-contain/reference/contain-size-fieldset-001-ref.html
|
||||
CSS-COLLIDING-REF-NAME: css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-size-fieldset-001-ref.html
|
||||
CSS-COLLIDING-REF-NAME: css/css-contain/reference/contain-size-fieldset-002-ref.html
|
||||
CSS-COLLIDING-REF-NAME: css/vendor-imports/mozilla/mozilla-central-reftests/contain/contain-size-fieldset-002-ref.html
|
||||
CSS-COLLIDING-SUPPORT-NAME: css/compositing/mix-blend-mode/support/red.png
|
||||
CSS-COLLIDING-SUPPORT-NAME: css/compositing/background-blending/support/red.png
|
||||
CSS-COLLIDING-SUPPORT-NAME: css/CSS2/normal-flow/support/replaced-min-max-3.png
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>MathML lengths (reference)</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if there is a green square and no red.</p>
|
||||
<div>
|
||||
<div id="red" style="position: absolute; width: 200px; height: 200px; background: green;">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,122 +1,159 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta charset="utf-8">
|
||||
<title>MathML lengths</title>
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#cssstyling"/>
|
||||
<link rel="match" href="lengths-2-ref.html"/>
|
||||
<meta name="assert" content="Verify whether the different namedspaces are accepted for MathML lengths.">
|
||||
<meta name="assert" content="Verify various cases of the MathML length syntax.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: TestFont;
|
||||
src: url("/fonts/math/xheight500.woff");
|
||||
}
|
||||
mpadded {
|
||||
math {
|
||||
font-family: TestFont;
|
||||
font-size: 200px; /* 1em = 200px */
|
||||
}
|
||||
div {
|
||||
position: absolute;
|
||||
}
|
||||
#red mspace {
|
||||
background: red;
|
||||
}
|
||||
#green mspace {
|
||||
background: green;
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var epsilon = .5;
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
setup({ explicit_done: true });
|
||||
window.addEventListener("load", function() {
|
||||
// Delay the check to workaround WebKit's bug https://webkit.org/b/174030.
|
||||
requestAnimationFrame(() => { document.fonts.ready.then(runTests); });
|
||||
});
|
||||
|
||||
function runTests() {
|
||||
test(function() {
|
||||
assert_equals(getBox("unitCm").width, 96, "cm");
|
||||
assert_equals(getBox("unitEm").width, 120, "em");
|
||||
assert_equals(getBox("unitEx").width, 500, "ex");
|
||||
assert_equals(getBox("unitIn").width, 288, "in");
|
||||
assert_equals(getBox("unitNamed").width, 700, "namedspace");
|
||||
assert_equals(getBox("unitMm").width, 576, "mm");
|
||||
assert_equals(getBox("unitPc").width, 96, "pc");
|
||||
assert_equals(getBox("unitPercentage").width, 60, "%");
|
||||
assert_equals(getBox("unitPt").width, 96, "pt");
|
||||
assert_equals(getBox("unitPx").width, 123, "px");
|
||||
assert_equals(getBox("unitNone").width, 150, "Unitless");
|
||||
}, "Units");
|
||||
|
||||
test(function() {
|
||||
assert_equals(getBox("spaceCm").width, 96, "cm");
|
||||
assert_equals(getBox("spaceEm").width, 120, "em");
|
||||
assert_equals(getBox("spaceEx").width, 500, "ex");
|
||||
assert_equals(getBox("spaceIn").width, 288, "in");
|
||||
assert_equals(getBox("spaceNamed").width, 700, "namedspace");
|
||||
assert_equals(getBox("spaceMm").width, 576, "mm");
|
||||
assert_equals(getBox("spacePc").width, 96, "pc");
|
||||
assert_equals(getBox("spacePercentage").width, 60, "%");
|
||||
assert_equals(getBox("spacePt").width, 96, "pt");
|
||||
assert_equals(getBox("spacePx").width, 123, "px");
|
||||
assert_equals(getBox("spaceNone").width, 150, "Unitless");
|
||||
}, "Trimming of space");
|
||||
|
||||
test(function() {
|
||||
assert_approx_equals(getBox("n0").width, 0, epsilon, "n0");
|
||||
assert_approx_equals(getBox("n1").width, 90, epsilon, "n1");
|
||||
assert_approx_equals(getBox("n2").width, 8, epsilon, "n2");
|
||||
assert_approx_equals(getBox("n3").width, 70, epsilon, "n3");
|
||||
assert_approx_equals(getBox("n4").width, 650, epsilon, "n4");
|
||||
assert_approx_equals(getBox("n5").width, 4320, epsilon, "n5");
|
||||
assert_approx_equals(getBox("n6").width, 1, epsilon, "n6");
|
||||
assert_approx_equals(getBox("n7").width, 8, epsilon, "n7");
|
||||
assert_approx_equals(getBox("n8").width, 65, epsilon, "n8");
|
||||
assert_approx_equals(getBox("n9").width, 432, epsilon, "n9");
|
||||
assert_approx_equals(getBox("n10").width, 123, epsilon, "n10");
|
||||
}, "Non-negative numbers");
|
||||
|
||||
test(function() {
|
||||
var topRef = getBox("ref").top;
|
||||
assert_approx_equals(getBox("N0").top - topRef, -0, epsilon, "N0");
|
||||
assert_approx_equals(topRef - getBox("N1").top, -90, epsilon, "N1");
|
||||
assert_approx_equals(topRef - getBox("N2").top, -8, epsilon, "N2");
|
||||
assert_approx_equals(topRef - getBox("N3").top, -70, epsilon, "N3");
|
||||
assert_approx_equals(topRef - getBox("N4").top, -650, epsilon, "N4");
|
||||
assert_approx_equals(topRef - getBox("N5").top, -4320, epsilon, "N5");
|
||||
assert_approx_equals(topRef - getBox("N6").top, -1, epsilon, "N6");
|
||||
assert_approx_equals(topRef - getBox("N7").top, -8, epsilon, "N7");
|
||||
assert_approx_equals(topRef - getBox("N8").top, -65, epsilon, "N8");
|
||||
assert_approx_equals(topRef - getBox("N9").top, -432, epsilon, "N9");
|
||||
assert_approx_equals(topRef - getBox("N10").top, -123, epsilon, "N10");
|
||||
}, "Non-positive numbers");
|
||||
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test passes if there is a green square and no red.</p>
|
||||
<div>
|
||||
<div id="red" style="position: absolute; width: 200px; height: 200px; background: green;">
|
||||
<!-- veryverythinmathspace -->
|
||||
<div style="left: 0px;"><math><mpadded height="100px" depth="100px" voffset="1veryverythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 10px;"><math><mpadded height="100px" depth="100px" voffset="0.05555555555555556em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- verythinmathspace -->
|
||||
<div style="left: 20px;"><math><mpadded height="100px" depth="100px" voffset="1verythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 30px;"><math><mpadded height="100px" depth="100px" voffset="0.1111111111111111em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- thinmathspace -->
|
||||
<div style="left: 40px;"><math><mpadded height="100px" depth="100px" voffset="1thinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 50px;"><math><mpadded height="100px" depth="100px" voffset="0.1666666666666667em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- mediummathspace -->
|
||||
<div style="left: 60px;"><math><mpadded height="100px" depth="100px" voffset="1mediummathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 70px;"><math><mpadded height="100px" depth="100px" voffset="0.2222222222222222em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- thickmathspace -->
|
||||
<div style="left: 80px;"><math><mpadded height="100px" depth="100px" voffset="1thickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 90px;"><math><mpadded height="100px" depth="100px" voffset="0.2777777777777778em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- verythickmathspace -->
|
||||
<div style="left: 100px;"><math><mpadded height="100px" depth="100px" voffset="1verythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 110px;"><math><mpadded height="100px" depth="100px" voffset="0.3333333333333333em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- veryverythickmathspace -->
|
||||
<div style="left: 120px;"><math><mpadded height="100px" depth="100px" voffset="1veryverythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 130px;"><math><mpadded height="100px" depth="100px" voffset="0.3888888888888889em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeveryverythinmathspace -->
|
||||
<div style="left: 0px;"><math><mpadded height="100px" depth="100px" voffset="1negativeveryverythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 10px;"><math><mpadded height="100px" depth="100px" voffset="-0.05555555555555556em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeverythinmathspace -->
|
||||
<div style="left: 20px;"><math><mpadded height="100px" depth="100px" voffset="1negativeverythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 30px;"><math><mpadded height="100px" depth="100px" voffset="-0.1111111111111111em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativethinmathspace -->
|
||||
<div style="left: 40px;"><math><mpadded height="100px" depth="100px" voffset="1negativethinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 50px;"><math><mpadded height="100px" depth="100px" voffset="-0.1666666666666667em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativemediummathspace -->
|
||||
<div style="left: 60px;"><math><mpadded height="100px" depth="100px" voffset="1negativemediummathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 70px;"><math><mpadded height="100px" depth="100px" voffset="-0.2222222222222222em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativethickmathspace -->
|
||||
<div style="left: 80px;"><math><mpadded height="100px" depth="100px" voffset="1negativethickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 90px;"><math><mpadded height="100px" depth="100px" voffset="-0.2777777777777778em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeverythickmathspace -->
|
||||
<div style="left: 100px;"><math><mpadded height="100px" depth="100px" voffset="1negativeverythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 110px;"><math><mpadded height="100px" depth="100px" voffset="-0.3333333333333333em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeveryverythickmathspace -->
|
||||
<div style="left: 120px;"><math><mpadded height="100px" depth="100px" voffset="1negativeveryverythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 130px;"><math><mpadded height="100px" depth="100px" voffset="-0.3888888888888889em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
</div>
|
||||
<div id="green" style="position: absolute; width: 200px; height: 200px;">
|
||||
<!-- veryverythinmathspace -->
|
||||
<div style="left: 10px;"><math><mpadded height="100px" depth="100px" voffset="1veryverythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 0px;"><math><mpadded height="100px" depth="100px" voffset="0.05555555555555556em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- verythinmathspace -->
|
||||
<div style="left: 30px;"><math><mpadded height="100px" depth="100px" voffset="1verythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 20px;"><math><mpadded height="100px" depth="100px" voffset="0.1111111111111111em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- thinmathspace -->
|
||||
<div style="left: 50px;"><math><mpadded height="100px" depth="100px" voffset="1thinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 40px;"><math><mpadded height="100px" depth="100px" voffset="0.1666666666666667em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- mediummathspace -->
|
||||
<div style="left: 70px;"><math><mpadded height="100px" depth="100px" voffset="1mediummathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 60px;"><math><mpadded height="100px" depth="100px" voffset="0.2222222222222222em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- thickmathspace -->
|
||||
<div style="left: 90px;"><math><mpadded height="100px" depth="100px" voffset="1thickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 80px;"><math><mpadded height="100px" depth="100px" voffset="0.2777777777777778em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- verythickmathspace -->
|
||||
<div style="left: 110px;"><math><mpadded height="100px" depth="100px" voffset="1verythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 100px;"><math><mpadded height="100px" depth="100px" voffset="0.3333333333333333em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- veryverythickmathspace -->
|
||||
<div style="left: 130px;"><math><mpadded height="100px" depth="100px" voffset="1veryverythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 120px;"><math><mpadded height="100px" depth="100px" voffset="0.3888888888888889em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeveryverythinmathspace -->
|
||||
<div style="left: 10px;"><math><mpadded height="100px" depth="100px" voffset="1negativeveryverythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 0px;"><math><mpadded height="100px" depth="100px" voffset="-0.05555555555555556em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeverythinmathspace -->
|
||||
<div style="left: 30px;"><math><mpadded height="100px" depth="100px" voffset="1negativeverythinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 20px;"><math><mpadded height="100px" depth="100px" voffset="-0.1111111111111111em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativethinmathspace -->
|
||||
<div style="left: 50px;"><math><mpadded height="100px" depth="100px" voffset="1negativethinmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 40px;"><math><mpadded height="100px" depth="100px" voffset="-0.1666666666666667em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativemediummathspace -->
|
||||
<div style="left: 70px;"><math><mpadded height="100px" depth="100px" voffset="1negativemediummathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 60px;"><math><mpadded height="100px" depth="100px" voffset="-0.2222222222222222em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativethickmathspace -->
|
||||
<div style="left: 90px;"><math><mpadded height="100px" depth="100px" voffset="1negativethickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 80px;"><math><mpadded height="100px" depth="100px" voffset="-0.2777777777777778em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeverythickmathspace -->
|
||||
<div style="left: 110px;"><math><mpadded height="100px" depth="100px" voffset="1negativeverythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 100px;"><math><mpadded height="100px" depth="100px" voffset="-0.3333333333333333em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<!-- negativeveryverythickmathspace -->
|
||||
<div style="left: 130px;"><math><mpadded height="100px" depth="100px" voffset="1negativeveryverythickmathspace"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
<div style="left: 120px;"><math><mpadded height="100px" depth="100px" voffset="-0.3888888888888889em"><mspace width="10px" height="10px"/></mpadded></math></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="log"></div>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="unitCm" width="2.54cm"/>
|
||||
<mspace id="unitEm" width="12em"/>
|
||||
<mspace id="unitEx" width="100ex"/>
|
||||
<mspace id="unitIn" width="3in"/>
|
||||
<mspace style="font-size: 1800px" id="unitNamed" width="veryverythickmathspace"/>
|
||||
<mspace id="unitMm" width="152.4mm"/>
|
||||
<mspace id="unitPc" width="6pc"/>
|
||||
<mstyle mathsize="200%"><mspace id="unitPercentage" width="3em"/></mstyle>
|
||||
<mspace id="unitPt" width="72pt"/>
|
||||
<mspace id="unitPx" width="123px"/>
|
||||
<mstyle mathsize="5"><mspace id="unitNone" width="3em"/></mstyle>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="spaceCm" width=" 	

 	

2.54cm 	

 	

"/>
|
||||
<mspace id="spaceEm" width=" 	

 	

12em 	

 	

"/>
|
||||
<mspace id="spaceEx" width=" 	

 	

100ex 	

 	

"/>
|
||||
<mspace id="spaceIn" width=" 	

 	

3in 	

 	

"/>
|
||||
<mspace style="font-size: 1800px" id="spaceNamed" width=" 	

 	

veryverythickmathspace 	

 	

"/>
|
||||
<mspace id="spaceMm" width=" 	

 	

152.4mm 	

 	

"/>
|
||||
<mspace id="spacePc" width=" 	

 	

6pc 	

 	

"/>
|
||||
<mstyle mathsize="200%"><mspace id="spacePercentage" width=" 	

 	

3em 	

 	

"/></mstyle>
|
||||
<mspace id="spacePt" width=" 	

 	

72pt 	

 	

"/>
|
||||
<mspace id="spacePx" width=" 	

 	

123px 	

 	

"/>
|
||||
<mstyle mathsize="5"><mspace id="spaceNone" width=" 	

 	

3em 	

 	

"/></mstyle>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="n0" width="0em"/>
|
||||
<mspace id="n1" width="9em"/>
|
||||
<mspace id="n2" width=".8em"/>
|
||||
<mspace id="n3" width="7.em"/>
|
||||
<mspace id="n4" width="65em"/>
|
||||
<mspace id="n5" width="432em"/>
|
||||
<mspace id="n6" width=".10em"/>
|
||||
<mspace id="n7" width=".789em"/>
|
||||
<mspace id="n8" width="6.5em"/>
|
||||
<mspace id="n9" width="43.21em"/>
|
||||
<mspace id="n10" width="012.345em"/>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="ref"></mspace>
|
||||
<mpadded voffset="-0em"><mspace id="N0"/></mpadded>
|
||||
<mpadded voffset="-9em"><mspace id="N1"/></mpadded>
|
||||
<mpadded voffset="-.8em"><mspace id="N2"/></mpadded>
|
||||
<mpadded voffset="-7.em"><mspace id="N3"/></mpadded>
|
||||
<mpadded voffset="-65em"><mspace id="N4"/></mpadded>
|
||||
<mpadded voffset="-432em"><mspace id="N5"/></mpadded>
|
||||
<mpadded voffset="-.10em"><mspace id="N6"/></mpadded>
|
||||
<mpadded voffset="-.789em"><mspace id="N7"/></mpadded>
|
||||
<mpadded voffset="-6.5em"><mspace id="N8"/></mpadded>
|
||||
<mpadded voffset="-43.21em"><mspace id="N9"/></mpadded>
|
||||
<mpadded voffset="-012.345em"><mspace id="N10"/></mpadded>
|
||||
</math>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,159 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>MathML lengths</title>
|
||||
<link rel="help" href="https://mathml-refresh.github.io/mathml-core/#cssstyling"/>
|
||||
<meta name="assert" content="Verify various cases of the MathML length syntax.">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: TestFont;
|
||||
src: url("/fonts/math/xheight500.woff");
|
||||
}
|
||||
math {
|
||||
font-family: TestFont;
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var epsilon = .5;
|
||||
|
||||
function getBox(aId) {
|
||||
return document.getElementById(aId).getBoundingClientRect();
|
||||
}
|
||||
|
||||
setup({ explicit_done: true });
|
||||
window.addEventListener("load", function() {
|
||||
// Delay the check to workaround WebKit's bug https://webkit.org/b/174030.
|
||||
requestAnimationFrame(() => { document.fonts.ready.then(runTests); });
|
||||
});
|
||||
|
||||
function runTests() {
|
||||
test(function() {
|
||||
assert_equals(getBox("unitCm").width, 96, "cm");
|
||||
assert_equals(getBox("unitEm").width, 120, "em");
|
||||
assert_equals(getBox("unitEx").width, 500, "ex");
|
||||
assert_equals(getBox("unitIn").width, 288, "in");
|
||||
assert_equals(getBox("unitNamed").width, 700, "namedspace");
|
||||
assert_equals(getBox("unitMm").width, 576, "mm");
|
||||
assert_equals(getBox("unitPc").width, 96, "pc");
|
||||
assert_equals(getBox("unitPercentage").width, 60, "%");
|
||||
assert_equals(getBox("unitPt").width, 96, "pt");
|
||||
assert_equals(getBox("unitPx").width, 123, "px");
|
||||
assert_equals(getBox("unitNone").width, 150, "Unitless");
|
||||
}, "Units");
|
||||
|
||||
test(function() {
|
||||
assert_equals(getBox("spaceCm").width, 96, "cm");
|
||||
assert_equals(getBox("spaceEm").width, 120, "em");
|
||||
assert_equals(getBox("spaceEx").width, 500, "ex");
|
||||
assert_equals(getBox("spaceIn").width, 288, "in");
|
||||
assert_equals(getBox("spaceNamed").width, 700, "namedspace");
|
||||
assert_equals(getBox("spaceMm").width, 576, "mm");
|
||||
assert_equals(getBox("spacePc").width, 96, "pc");
|
||||
assert_equals(getBox("spacePercentage").width, 60, "%");
|
||||
assert_equals(getBox("spacePt").width, 96, "pt");
|
||||
assert_equals(getBox("spacePx").width, 123, "px");
|
||||
assert_equals(getBox("spaceNone").width, 150, "Unitless");
|
||||
}, "Trimming of space");
|
||||
|
||||
test(function() {
|
||||
assert_approx_equals(getBox("n0").width, 0, epsilon, "n0");
|
||||
assert_approx_equals(getBox("n1").width, 90, epsilon, "n1");
|
||||
assert_approx_equals(getBox("n2").width, 8, epsilon, "n2");
|
||||
assert_approx_equals(getBox("n3").width, 70, epsilon, "n3");
|
||||
assert_approx_equals(getBox("n4").width, 650, epsilon, "n4");
|
||||
assert_approx_equals(getBox("n5").width, 4320, epsilon, "n5");
|
||||
assert_approx_equals(getBox("n6").width, 1, epsilon, "n6");
|
||||
assert_approx_equals(getBox("n7").width, 8, epsilon, "n7");
|
||||
assert_approx_equals(getBox("n8").width, 65, epsilon, "n8");
|
||||
assert_approx_equals(getBox("n9").width, 432, epsilon, "n9");
|
||||
assert_approx_equals(getBox("n10").width, 123, epsilon, "n10");
|
||||
}, "Non-negative numbers");
|
||||
|
||||
test(function() {
|
||||
var topRef = getBox("ref").top;
|
||||
assert_approx_equals(getBox("N0").top - topRef, -0, epsilon, "N0");
|
||||
assert_approx_equals(topRef - getBox("N1").top, -90, epsilon, "N1");
|
||||
assert_approx_equals(topRef - getBox("N2").top, -8, epsilon, "N2");
|
||||
assert_approx_equals(topRef - getBox("N3").top, -70, epsilon, "N3");
|
||||
assert_approx_equals(topRef - getBox("N4").top, -650, epsilon, "N4");
|
||||
assert_approx_equals(topRef - getBox("N5").top, -4320, epsilon, "N5");
|
||||
assert_approx_equals(topRef - getBox("N6").top, -1, epsilon, "N6");
|
||||
assert_approx_equals(topRef - getBox("N7").top, -8, epsilon, "N7");
|
||||
assert_approx_equals(topRef - getBox("N8").top, -65, epsilon, "N8");
|
||||
assert_approx_equals(topRef - getBox("N9").top, -432, epsilon, "N9");
|
||||
assert_approx_equals(topRef - getBox("N10").top, -123, epsilon, "N10");
|
||||
}, "Non-positive numbers");
|
||||
|
||||
done();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="unitCm" width="2.54cm"/>
|
||||
<mspace id="unitEm" width="12em"/>
|
||||
<mspace id="unitEx" width="100ex"/>
|
||||
<mspace id="unitIn" width="3in"/>
|
||||
<mspace style="font-size: 1800px" id="unitNamed" width="veryverythickmathspace"/>
|
||||
<mspace id="unitMm" width="152.4mm"/>
|
||||
<mspace id="unitPc" width="6pc"/>
|
||||
<mstyle mathsize="200%"><mspace id="unitPercentage" width="3em"/></mstyle>
|
||||
<mspace id="unitPt" width="72pt"/>
|
||||
<mspace id="unitPx" width="123px"/>
|
||||
<mstyle mathsize="5"><mspace id="unitNone" width="3em"/></mstyle>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="spaceCm" width=" 	

 	

2.54cm 	

 	

"/>
|
||||
<mspace id="spaceEm" width=" 	

 	

12em 	

 	

"/>
|
||||
<mspace id="spaceEx" width=" 	

 	

100ex 	

 	

"/>
|
||||
<mspace id="spaceIn" width=" 	

 	

3in 	

 	

"/>
|
||||
<mspace style="font-size: 1800px" id="spaceNamed" width=" 	

 	

veryverythickmathspace 	

 	

"/>
|
||||
<mspace id="spaceMm" width=" 	

 	

152.4mm 	

 	

"/>
|
||||
<mspace id="spacePc" width=" 	

 	

6pc 	

 	

"/>
|
||||
<mstyle mathsize="200%"><mspace id="spacePercentage" width=" 	

 	

3em 	

 	

"/></mstyle>
|
||||
<mspace id="spacePt" width=" 	

 	

72pt 	

 	

"/>
|
||||
<mspace id="spacePx" width=" 	

 	

123px 	

 	

"/>
|
||||
<mstyle mathsize="5"><mspace id="spaceNone" width=" 	

 	

3em 	

 	

"/></mstyle>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="n0" width="0em"/>
|
||||
<mspace id="n1" width="9em"/>
|
||||
<mspace id="n2" width=".8em"/>
|
||||
<mspace id="n3" width="7.em"/>
|
||||
<mspace id="n4" width="65em"/>
|
||||
<mspace id="n5" width="432em"/>
|
||||
<mspace id="n6" width=".10em"/>
|
||||
<mspace id="n7" width=".789em"/>
|
||||
<mspace id="n8" width="6.5em"/>
|
||||
<mspace id="n9" width="43.21em"/>
|
||||
<mspace id="n10" width="012.345em"/>
|
||||
</math>
|
||||
</p>
|
||||
<p>
|
||||
<math>
|
||||
<mspace id="ref"></mspace>
|
||||
<mpadded voffset="-0em"><mspace id="N0"/></mpadded>
|
||||
<mpadded voffset="-9em"><mspace id="N1"/></mpadded>
|
||||
<mpadded voffset="-.8em"><mspace id="N2"/></mpadded>
|
||||
<mpadded voffset="-7.em"><mspace id="N3"/></mpadded>
|
||||
<mpadded voffset="-65em"><mspace id="N4"/></mpadded>
|
||||
<mpadded voffset="-432em"><mspace id="N5"/></mpadded>
|
||||
<mpadded voffset="-.10em"><mspace id="N6"/></mpadded>
|
||||
<mpadded voffset="-.789em"><mspace id="N7"/></mpadded>
|
||||
<mpadded voffset="-6.5em"><mspace id="N8"/></mpadded>
|
||||
<mpadded voffset="-43.21em"><mspace id="N9"/></mpadded>
|
||||
<mpadded voffset="-012.345em"><mspace id="N10"/></mpadded>
|
||||
</math>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,99 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Assigning a MediaStream to a media element and not playing it results in rendering a first frame</title>
|
||||
</head>
|
||||
<body>
|
||||
<p class="instructions">When prompted, accept to share your video stream.</p>
|
||||
<h1 class="instructions">Description</h1>
|
||||
<p class="instructions">This test checks that a HTMLMediaElement with an
|
||||
assigned MediaStream with a video track fires the appropriate events to reach
|
||||
the "canplay" event and readyState HAVE_ENOUGH_DATA even when not playing or
|
||||
autoplaying.</p>
|
||||
<video id="vid"></video>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script>
|
||||
'use strict';
|
||||
const vid = document.getElementById("vid");
|
||||
|
||||
promise_test(async t => {
|
||||
const wait = ms => new Promise(r => t.step_timeout(r, ms));
|
||||
const timeout = (promise, time, msg) => Promise.race([
|
||||
promise,
|
||||
wait(time).then(() => Promise.reject(new Error(msg)))
|
||||
]);
|
||||
const stream = await navigator.mediaDevices.getUserMedia({video: true});
|
||||
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
|
||||
vid.srcObject = stream;
|
||||
|
||||
await timeout(new Promise(r => vid.oncanplay = r), 8000, "canplay timeout");
|
||||
assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA,
|
||||
"readyState is HAVE_ENOUGH_DATA after \"canplay\"");
|
||||
}, "Tests that loading a MediaStream in a media element eventually results in \"canplay\" even when not playing or autoplaying");
|
||||
|
||||
promise_test(async t => {
|
||||
const wait = ms => new Promise(r => t.step_timeout(r, ms));
|
||||
const timeout = (promise, time, msg) => Promise.race([
|
||||
promise,
|
||||
wait(time).then(() => Promise.reject(new Error(msg)))
|
||||
]);
|
||||
const unexpected = e => { throw new Error(`Got unexpected event ${e.name}`); };
|
||||
const stream = await navigator.mediaDevices.getUserMedia({video: true});
|
||||
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
|
||||
vid.srcObject = stream;
|
||||
|
||||
vid.onloadstart = unexpected;
|
||||
vid.ondurationchange = unexpected;
|
||||
vid.onresize = unexpected;
|
||||
vid.onloadedmetadata = unexpected;
|
||||
vid.onloadeddata = unexpected;
|
||||
vid.oncanplay = unexpected;
|
||||
vid.oncanplaythrough = unexpected;
|
||||
|
||||
await timeout(new Promise(r => vid.onloadstart = r), 8000,
|
||||
"loadstart timeout");
|
||||
vid.onloadstart = unexpected;
|
||||
|
||||
await timeout(new Promise(r => vid.ondurationchange = r), 8000,
|
||||
"durationchange timeout");
|
||||
vid.ondurationchange = unexpected;
|
||||
assert_equals(vid.duration, Infinity, "duration changes to Infinity");
|
||||
|
||||
await timeout(new Promise(r => vid.onresize = r), 8000,
|
||||
"resize timeout");
|
||||
vid.onresize = unexpected;
|
||||
assert_not_equals(vid.videoWidth, 0,
|
||||
"videoWidth is something after \"resize\"");
|
||||
assert_not_equals(vid.videoHeight, 0,
|
||||
"videoHeight is something after \"resize\"");
|
||||
|
||||
await timeout(new Promise(r => vid.onloadedmetadata = r), 8000,
|
||||
"loadedmetadata timeout");
|
||||
vid.onloadedmetadata = unexpected;
|
||||
assert_greater_than_equal(vid.readyState, vid.HAVE_METADATA,
|
||||
"readyState is at least HAVE_METADATA after \"loadedmetadata\"");
|
||||
|
||||
await timeout(new Promise(r => vid.onloadeddata = r), 8000,
|
||||
"loadeddata timeout");
|
||||
vid.onloadeddata = unexpected;
|
||||
assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA,
|
||||
"readyState is HAVE_ENOUGH_DATA after \"loadeddata\" since there's no buffering");
|
||||
|
||||
await timeout(new Promise(r => vid.oncanplay = r), 8000, "canplay timeout");
|
||||
vid.oncanplay = unexpected;
|
||||
assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA,
|
||||
"readyState is HAVE_ENOUGH_DATA after \"canplay\" since there's no buffering");
|
||||
|
||||
await timeout(new Promise(r => vid.oncanplaythrough = r), 8000,
|
||||
"canplaythrough timeout");
|
||||
vid.oncanplaythrough = unexpected;
|
||||
assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA,
|
||||
"readyState is HAVE_ENOUGH_DATA after \"canplaythrough\"");
|
||||
|
||||
// Crank the event loop to see whether any more events are fired.
|
||||
await wait(100);
|
||||
}, "Tests that loading a MediaStream in a media element sees all the expected (deterministic) events even when not playing or autoplaying");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,29 +1,19 @@
|
|||
self.onmessage = function (evt) {
|
||||
if (evt.data == "xhr") {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "synthesized-response.txt", true);
|
||||
xhr.responseType = "text";
|
||||
xhr.send();
|
||||
xhr.onload = function (evt) {
|
||||
postMessage(xhr.responseText);
|
||||
};
|
||||
xhr.onerror = function() {
|
||||
postMessage("XHR failed!");
|
||||
};
|
||||
} else if (evt.data == "fetch") {
|
||||
fetch("synthesized-response.txt")
|
||||
.then(function(response) {
|
||||
return response.text();
|
||||
})
|
||||
.then(function(data) {
|
||||
postMessage(data);
|
||||
})
|
||||
.catch(function(error) {
|
||||
postMessage("Fetch failed!");
|
||||
});
|
||||
} else if (evt.data == "importScripts") {
|
||||
importScripts("synthesized-response.js");
|
||||
} else {
|
||||
throw "Unexpected message! " + evt.data;
|
||||
}
|
||||
self.onmessage = evt => {
|
||||
if (evt.data == "xhr") {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "synthesized-response.txt", true);
|
||||
xhr.responseType = "text";
|
||||
xhr.send();
|
||||
xhr.onload = evt => postMessage(xhr.responseText);
|
||||
xhr.onerror = () => postMessage("XHR failed!");
|
||||
} else if (evt.data == "fetch") {
|
||||
fetch("synthesized-response.txt")
|
||||
.then(response => response.text())
|
||||
.then(data => postMessage(data))
|
||||
.catch(error => postMessage("Fetch failed!"));
|
||||
} else if (evt.data == "importScripts") {
|
||||
importScripts("synthesized-response.js");
|
||||
} else {
|
||||
postMessage("Unexpected message! " + evt.data);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,55 +1,51 @@
|
|||
<script src="/common/get-host-info.sub.js"></script>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="test-helpers.sub.js?pipe=sub"></script>
|
||||
<script>
|
||||
var host_info = get_host_info();
|
||||
|
||||
function boilerplate_test(url, msg) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var worker = new Worker(url);
|
||||
worker.onmessage = function(e) { resolve(e.data) };
|
||||
worker.onerror = function(e) { reject(e) };
|
||||
worker.postMessage(msg);
|
||||
})
|
||||
.then(function(data) {
|
||||
assert_equals(data, "This load was successfully intercepted.");
|
||||
});
|
||||
async function boilerplate_test(url, msg) {
|
||||
const worker = new Worker(url);
|
||||
const data = await new Promise((resolve, reject) => {
|
||||
worker.onmessage = e => resolve(e.data);
|
||||
worker.onerror = e =>reject(e);
|
||||
worker.postMessage(msg);
|
||||
});
|
||||
assert_equals(data, "This load was successfully intercepted.");
|
||||
}
|
||||
|
||||
function xhr_test() {
|
||||
return boilerplate_test("load_worker.js", "xhr");
|
||||
return boilerplate_test("load_worker.js", "xhr");
|
||||
}
|
||||
|
||||
function fetch_test() {
|
||||
return boilerplate_test("load_worker.js", "fetch");
|
||||
return boilerplate_test("load_worker.js", "fetch");
|
||||
}
|
||||
|
||||
function importScripts_test() {
|
||||
return boilerplate_test("load_worker.js", "importScripts");
|
||||
return boilerplate_test("load_worker.js", "importScripts");
|
||||
}
|
||||
|
||||
function nested_worker_xhr_test() {
|
||||
return boilerplate_test("nested_load_worker.js", "xhr");
|
||||
return boilerplate_test("nested_load_worker.js", "xhr");
|
||||
}
|
||||
|
||||
function nested_worker_fetch_test() {
|
||||
return boilerplate_test("nested_load_worker.js", "fetch");
|
||||
return boilerplate_test("nested_load_worker.js", "fetch");
|
||||
}
|
||||
|
||||
function nested_worker_importScripts_test() {
|
||||
return boilerplate_test("nested_load_worker.js", "importScripts");
|
||||
return boilerplate_test("nested_load_worker.js", "importScripts");
|
||||
}
|
||||
|
||||
window.addEventListener('message', function(evt) {
|
||||
var port = evt.ports[0];
|
||||
xhr_test()
|
||||
window.addEventListener('message', evt => {
|
||||
const port = evt.ports[0];
|
||||
xhr_test()
|
||||
.then(fetch_test)
|
||||
.then(importScripts_test)
|
||||
.then(nested_worker_xhr_test)
|
||||
.then(nested_worker_fetch_test)
|
||||
.then(nested_worker_importScripts_test)
|
||||
.then(function() { port.postMessage({results: 'finish'}); })
|
||||
.catch(function(e) { port.postMessage({results: 'failure:' + e}); });
|
||||
});
|
||||
.then(() => port.postMessage({results: 'finish'}))
|
||||
.catch(e => port.postMessage({results: 'failure:' + e}));
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -5,131 +5,81 @@
|
|||
<script src="resources/test-helpers.sub.js"></script>
|
||||
<body>
|
||||
<script>
|
||||
promise_test(function(t) {
|
||||
var worker_url = 'resources/dummy-synthesized-worker.js';
|
||||
var service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
var scope = worker_url;
|
||||
|
||||
return service_worker_unregister_and_register(t, service_worker, scope)
|
||||
.then(function(r) {
|
||||
t.add_cleanup(function() {
|
||||
return service_worker_unregister(t, scope);
|
||||
});
|
||||
async function setup_service_worker(t, script_url, scope) {
|
||||
const r =
|
||||
await service_worker_unregister_and_register(t, script_url, scope);
|
||||
t.add_cleanup(() => service_worker_unregister(t, scope));
|
||||
await wait_for_state(t, r.installing, 'activated');
|
||||
}
|
||||
|
||||
return wait_for_state(t, r.installing, 'activated');
|
||||
})
|
||||
.then(function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var w = new Worker(worker_url);
|
||||
w.onmessage = function(e) {
|
||||
resolve(e.data);
|
||||
}
|
||||
promise_test(async t => {
|
||||
const worker_url = 'resources/dummy-synthesized-worker.js';
|
||||
const service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
const scope = worker_url;
|
||||
|
||||
w.onerror = function(e) {
|
||||
reject(e.message);
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(function(data) {
|
||||
assert_equals(data, 'worker loading intercepted by service worker');
|
||||
});
|
||||
}, 'Verify worker script from uncontrolled document is intercepted by Service Worker');
|
||||
await setup_service_worker(t, service_worker, scope);
|
||||
const w = new Worker(worker_url);
|
||||
const data = await new Promise((resolve, reject) => {
|
||||
w.onmessage = e => resolve(e.data);
|
||||
w.onerror = e => reject(e.message);
|
||||
});
|
||||
assert_equals(data, 'worker loading intercepted by service worker');
|
||||
}, 'Verify worker script from uncontrolled document is intercepted by ' +
|
||||
'Service Worker');
|
||||
|
||||
promise_test(function(t) {
|
||||
var worker_url = 'resources/dummy-same-origin-worker.js';
|
||||
var service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
var scope = worker_url;
|
||||
promise_test(async t => {
|
||||
const worker_url = 'resources/dummy-same-origin-worker.js';
|
||||
const service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
const scope = worker_url;
|
||||
|
||||
return service_worker_unregister_and_register(t, service_worker, scope)
|
||||
.then(function(r) {
|
||||
t.add_cleanup(function() {
|
||||
return service_worker_unregister(t, scope);
|
||||
});
|
||||
await setup_service_worker(t, service_worker, scope);
|
||||
const w = new Worker(worker_url);
|
||||
const data = await new Promise((resolve, reject) => {
|
||||
w.onmessage = e => resolve(e.data);
|
||||
w.onerror = e => reject(e.message);
|
||||
});
|
||||
assert_equals(data, 'dummy-worker-script loaded');
|
||||
}, 'Verify worker script intercepted by same-origin response succeeds');
|
||||
|
||||
return wait_for_state(t, r.installing, 'activated');
|
||||
})
|
||||
.then(function() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var w = new Worker(worker_url);
|
||||
w.onmessage = function(e) {
|
||||
resolve(e.data);
|
||||
}
|
||||
promise_test(async t => {
|
||||
const worker_url = 'resources/dummy-cors-worker.js';
|
||||
const service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
const scope = worker_url;
|
||||
|
||||
w.onerror = function(e) {
|
||||
reject(e.message);
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(function(data) {
|
||||
assert_equals(data, 'dummy-worker-script loaded');
|
||||
});
|
||||
}, 'Verify worker script intercepted by same-origin response succeeds');
|
||||
await setup_service_worker(t, service_worker, scope);
|
||||
const w = new Worker(worker_url);
|
||||
const watcher = new EventWatcher(t, w, ['message', 'error']);
|
||||
await watcher.wait_for('error');
|
||||
}, 'Verify worker script intercepted by cors response fails');
|
||||
|
||||
promise_test(function(t) {
|
||||
var worker_url = 'resources/dummy-cors-worker.js';
|
||||
var service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
var scope = worker_url;
|
||||
promise_test(async t => {
|
||||
const worker_url = 'resources/dummy-no-cors-worker.js';
|
||||
const service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
const scope = worker_url;
|
||||
|
||||
return service_worker_unregister_and_register(t, service_worker, scope)
|
||||
.then(function(r) {
|
||||
return wait_for_state(t, r.installing, 'activated');
|
||||
})
|
||||
.then(function() {
|
||||
var w = new Worker(worker_url);
|
||||
var watcher = new EventWatcher(t, w, ['message', 'error']);
|
||||
return watcher.wait_for('error');
|
||||
});
|
||||
}, 'Verify worker script intercepted by cors response fails');
|
||||
await setup_service_worker(t, service_worker, scope);
|
||||
const w = new Worker(worker_url);
|
||||
const watcher = new EventWatcher(t, w, ['message', 'error']);
|
||||
await watcher.wait_for('error');
|
||||
}, 'Verify worker script intercepted by no-cors cross-origin response fails');
|
||||
|
||||
promise_test(function(t) {
|
||||
var worker_url = 'resources/dummy-no-cors-worker.js';
|
||||
var service_worker = 'resources/dummy-worker-interceptor.js';
|
||||
var scope = worker_url;
|
||||
promise_test(async t => {
|
||||
const subdoc_url = 'resources/worker-interception-iframe.https.html?bypass';
|
||||
const service_worker = 'resources/worker-load-interceptor.js';
|
||||
const scope = 'resources/';
|
||||
|
||||
return service_worker_unregister_and_register(t, service_worker, scope)
|
||||
.then(function(r) {
|
||||
t.add_cleanup(function() {
|
||||
return service_worker_unregister(t, scope);
|
||||
});
|
||||
|
||||
return wait_for_state(t, r.installing, 'activated');
|
||||
})
|
||||
.then(function() {
|
||||
var w = new Worker(worker_url);
|
||||
var watcher = new EventWatcher(t, w, ['message', 'error']);
|
||||
return watcher.wait_for('error');
|
||||
});
|
||||
}, 'Verify worker script intercepted by no-cors cross-origin response fails');
|
||||
|
||||
promise_test(function(t) {
|
||||
var subdoc_url = 'resources/worker-interception-iframe.https.html?bypass';
|
||||
var service_worker = 'resources/worker-load-interceptor.js';
|
||||
var scope = 'resources/';
|
||||
|
||||
return service_worker_unregister_and_register(t, service_worker, scope)
|
||||
.then(function(r) {
|
||||
t.add_cleanup(function() {
|
||||
return service_worker_unregister(t, scope);
|
||||
});
|
||||
|
||||
return wait_for_state(t, r.installing, 'activated');
|
||||
})
|
||||
.then(function() { return with_iframe(subdoc_url); })
|
||||
.then(function(frame) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
var channel = new MessageChannel();
|
||||
channel.port1.onmessage = function(e) {
|
||||
frame.remove();
|
||||
resolve(e.data);
|
||||
}
|
||||
|
||||
frame.contentWindow.postMessage("GO", "*", [channel.port2]);
|
||||
});
|
||||
})
|
||||
.then(function(data) {
|
||||
assert_equals(data.results, 'finish');
|
||||
});
|
||||
}, 'Verify worker loads from controlled document are intercepted by Service Worker');
|
||||
await setup_service_worker(t, service_worker, scope);
|
||||
const frame = await with_iframe(subdoc_url);
|
||||
t.add_cleanup(() => frame.remove());
|
||||
const data = await new Promise((resolve, reject) => {
|
||||
const channel = new MessageChannel();
|
||||
channel.port1.onmessage = e => resolve(e.data);
|
||||
frame.contentWindow.postMessage("GO", "*", [channel.port2]);
|
||||
});
|
||||
assert_equals(data.results, 'finish');
|
||||
}, 'Verify worker loads from controlled document are intercepted by Service ' +
|
||||
'Worker');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
|
||||
<title>SVG Reference</title>
|
||||
<text x="50" y="50" font-family="monospace">Some  Text</text>
|
||||
</svg>
|
After Width: | Height: | Size: 231 B |
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml">
|
||||
<title>SVG Test: Behavior of xml:space="preserve"</title>
|
||||
<h:link rel="help" href="https://svgwg.org/svg2-draft/styling.html#UAStyleSheet"/>
|
||||
<h:link rel="match" href="text-xml-space-001-ref.svg"/>
|
||||
<g xml:space="preserve">
|
||||
<text x="50" y="50" font-family="monospace">Some Text</text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 429 B |
|
@ -0,0 +1,6 @@
|
|||
spec: https://w3c.github.io/navigation-timing/
|
||||
suggested_reviewers:
|
||||
- plehegar
|
||||
- igrigorik
|
||||
- toddreifsteck
|
||||
- yoavweiss
|
|
@ -0,0 +1,25 @@
|
|||
// META: script=resources/utils.js
|
||||
|
||||
test(() => {
|
||||
assert_true(!!self.PerformanceObserver, "PerformanceObserver");
|
||||
assert_true(!!self.PerformanceObserver.supportedEntryTypes,
|
||||
"PerformanceObserver.supportedEntryTypes");
|
||||
}, "PerformanceObserver.supportedEntryTypes exists");
|
||||
|
||||
// UPDATE HERE if new entry
|
||||
[
|
||||
[ "mark", "PerformanceMark" ],
|
||||
[ "measure", "PerformanceMeasure" ],
|
||||
[ "resource", "PerformanceResourceTiming" ],
|
||||
].forEach(test_support);
|
||||
|
||||
// UPDATE BELOW to ensure the entry gets created
|
||||
|
||||
// mark
|
||||
self.performance.mark('mymark');
|
||||
|
||||
// measure
|
||||
self.performance.measure('mymeasure');
|
||||
|
||||
// resource
|
||||
fetch(self.location.href + "?" + Math.random());
|
|
@ -0,0 +1,33 @@
|
|||
// META: script=resources/utils.js
|
||||
|
||||
test(() => {
|
||||
assert_true(!!self.PerformanceObserver, "PerformanceObserver");
|
||||
assert_true(!!self.PerformanceObserver.supportedEntryTypes,
|
||||
"PerformanceObserver.supportedEntryTypes");
|
||||
}, "PerformanceObserver.supportedEntryTypes exists");
|
||||
|
||||
// UPDATE HERE if new entry
|
||||
[
|
||||
[ "navigation", "PerformanceNavigationTiming" ],
|
||||
[ "paint", "PerformancePaintTiming" ],
|
||||
[ "longtask", "PerformanceLongTaskTiming" ],
|
||||
].forEach(test_support);
|
||||
|
||||
// UPDATE BELOW to ensure the entry gets created
|
||||
|
||||
// paint
|
||||
if (self.document) document.head.parentNode.appendChild(document.createTextNode('text inserted on purpose'));
|
||||
|
||||
// longtask
|
||||
function syncWait(waitDuration) {
|
||||
if (waitDuration <= 0)
|
||||
return;
|
||||
|
||||
const startTime = performance.now();
|
||||
let unused = '';
|
||||
for (let i = 0; i < 10000; i++)
|
||||
unused += '' + Math.random();
|
||||
|
||||
return syncWait(waitDuration - (performance.now() - startTime));
|
||||
}
|
||||
syncWait(50);
|
|
@ -0,0 +1,29 @@
|
|||
const STEPS = {};
|
||||
|
||||
const types = (self.PerformanceObserver
|
||||
&& self.PerformanceObserver.supportedEntryTypes)?
|
||||
self.PerformanceObserver.supportedEntryTypes
|
||||
: undefined;
|
||||
|
||||
if (types) {
|
||||
// we observe everything as soon as possible
|
||||
new PerformanceObserver(function (list, observer) {
|
||||
for (const entry of list.getEntries())
|
||||
if (STEPS[entry.entryType]) STEPS[entry.entryType](entry);
|
||||
}).observe({entryTypes: self.PerformanceObserver.supportedEntryTypes});
|
||||
}
|
||||
|
||||
function test_support(def) {
|
||||
if (!types || !types.includes(def[0])) {
|
||||
return;
|
||||
}
|
||||
const desc = `'${def[0]}' entries should be observable`;
|
||||
const t = async_test(desc);
|
||||
|
||||
STEPS[def[0]] = (entry) => {
|
||||
t.step(() => assert_equals(Object.prototype.toString.call(entry),
|
||||
`[object ${def[1]}]`,
|
||||
`Class name of entry should be ${def[1]}.`));
|
||||
t.done();
|
||||
}
|
||||
}
|
|
@ -5,7 +5,13 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/user-timing-helper.js"></script>
|
||||
<script>
|
||||
function cleanupPerformanceTimeline() {
|
||||
performance.clearMarks();
|
||||
performance.clearMeasures();
|
||||
}
|
||||
|
||||
async_test(function (t) {
|
||||
this.add_cleanup(cleanupPerformanceTimeline);
|
||||
let measureEntries = [];
|
||||
const timeStamp1 = 784.4;
|
||||
const timeStamp2 = 1234.5;
|
||||
|
@ -40,8 +46,6 @@
|
|||
}
|
||||
})
|
||||
);
|
||||
self.performance.clearMarks();
|
||||
self.performance.clearMeasures();
|
||||
observer.observe({ entryTypes: ["measure"] });
|
||||
self.performance.mark("mark1", { detail: { randomInfo: 3 }, startTime: timeStamp1 });
|
||||
self.performance.mark("mark2", { startTime: timeStamp2 });
|
||||
|
@ -80,10 +84,16 @@
|
|||
checkEntries(returnedEntries, expectedEntries);
|
||||
}, "measure entries' detail and start/end are customizable");
|
||||
|
||||
async_test(function (t) {
|
||||
assert_throws("SyntaxError", function() {
|
||||
test(function () {
|
||||
this.add_cleanup(cleanupPerformanceTimeline);
|
||||
assert_throws(new TypeError(), function() {
|
||||
self.performance.measure("wrongUsage1", {}, 12);
|
||||
});
|
||||
t.done();
|
||||
}, "measure should throw exception when passing option object and end at the same time");
|
||||
}, "measure should throw a TypeError when passed an options object and an end time");
|
||||
assert_throws(new TypeError(), function() {
|
||||
self.performance.measure("wrongUsage2", {'startTime': 2}, 12);
|
||||
}, "measure should throw a TypeError when passed an options object and an end time");
|
||||
assert_throws(new TypeError(), function() {
|
||||
self.performance.measure("wrongUsage3", {'startTime': 2}, 'mark1');
|
||||
}, "measure should throw a TypeError when passed an options object and an end mark");
|
||||
}, "measure should throw a TypeError when passed an invalid argument combination");
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
Test Active Processing for ChannelMergerNode
|
||||
</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/webaudio/resources/audit-util.js"></script>
|
||||
<script src="/webaudio/resources/audit.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script id="layout-test-code">
|
||||
let audit = Audit.createTaskRunner();
|
||||
|
||||
// The sample rate MUST be a power of two to eliminate round-off when
|
||||
// computing render boundaries but is otherwise arbitrary. And we only new
|
||||
// a few blocks for rendering to see if things are working.
|
||||
let sampleRate = 8192;
|
||||
let renderLength = 10 * RENDER_QUANTUM_FRAMES;
|
||||
|
||||
// Number of inputs for the ChannelMergerNode. Pretty arbitrary, but
|
||||
// should not be 1.
|
||||
let numberOfInputs = 7;
|
||||
|
||||
// How many frames the source should run. Arbitrary but should be more
|
||||
// than a render quantum.
|
||||
let sourceDurationFrames = 131;
|
||||
|
||||
// Frame at which to connect the source to the merger
|
||||
let connectFrame = 2 * RENDER_QUANTUM_FRAMES;
|
||||
|
||||
// AudioProcessor that counts the number of channels on its single input.
|
||||
let filePath =
|
||||
'../the-audioworklet-interface/processors/input-count-processor.js';
|
||||
|
||||
audit.define(
|
||||
{
|
||||
label: 'Test',
|
||||
description: 'Active processing for ChannelMergerNode'
|
||||
},
|
||||
async (task, should) => {
|
||||
const context = new OfflineAudioContext({
|
||||
numberOfChannels: numberOfInputs,
|
||||
length: renderLength,
|
||||
sampleRate: sampleRate
|
||||
});
|
||||
|
||||
// Don't mix the inputs to the destination!
|
||||
context.destination.channelInterpretation = 'discrete';
|
||||
|
||||
await context.audioWorklet.addModule(filePath);
|
||||
|
||||
let src = new ConstantSourceNode(context);
|
||||
let merger = new ChannelMergerNode(
|
||||
context, {numberOfInputs: numberOfInputs});
|
||||
let counter = new AudioWorkletNode(context, 'counter');
|
||||
|
||||
// Just to print a message that we created the graph with a
|
||||
// convolver in it.
|
||||
should(
|
||||
() => {
|
||||
merger.connect(counter).connect(context.destination);
|
||||
},
|
||||
`Construction of graph with ChannelMergerNode with ${
|
||||
merger.numberOfInputs} inputs`)
|
||||
.notThrow()
|
||||
|
||||
// Connect the source now and start it and let it run for
|
||||
// |sourceDurationFrames| frames.
|
||||
context.suspend(connectFrame / context.sampleRate)
|
||||
.then(() => {
|
||||
src.connect(merger, 0, 0);
|
||||
src.start();
|
||||
src.stop(
|
||||
context.currentTime +
|
||||
sourceDurationFrames / context.sampleRate);
|
||||
})
|
||||
.then(() => context.resume());
|
||||
|
||||
const renderedBuffer = await context.startRendering();
|
||||
// The expected output is something like:
|
||||
//
|
||||
// 1, 1, 1,..., 7, 7, 7.,,,, 1, 1, 1
|
||||
//
|
||||
// When the merger has no inputs, it's not actively processing
|
||||
// so it must output mono silence. After connecting a source,
|
||||
// the number of channels of the output should be the same as
|
||||
// the number of inputs to the merger. Finally, when the
|
||||
// source stops, the merger is not actively processing anymore
|
||||
// and should output mono silence again. For this test, we
|
||||
// don't care too much how many different values there are.
|
||||
// There just has to be at least one of each value, in the
|
||||
// order given.
|
||||
const output = renderedBuffer.getChannelData(0);
|
||||
|
||||
should(output, 'Number of output channels').containValues([
|
||||
1, numberOfInputs, 1
|
||||
]);
|
||||
|
||||
task.done();
|
||||
});
|
||||
|
||||
audit.run();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -168,9 +168,10 @@ def current_session():
|
|||
|
||||
@pytest.fixture
|
||||
def url(server_config):
|
||||
def inner(path, protocol="http", query="", fragment=""):
|
||||
def inner(path, protocol="http", subdomain="", query="", fragment=""):
|
||||
domain = server_config["domains"][""][subdomain]
|
||||
port = server_config["ports"][protocol][0]
|
||||
host = "%s:%s" % (server_config["browser_host"], port)
|
||||
host = "%s:%s" % (domain, port)
|
||||
return urlparse.urlunsplit((protocol, host, path, query, fragment))
|
||||
|
||||
inner.__name__ = "url"
|
||||
|
|
|
@ -142,6 +142,15 @@ def document_hidden(session):
|
|||
return Poll(session, timeout=3, raises=None).until(hidden)
|
||||
|
||||
|
||||
def document_location(session):
|
||||
"""
|
||||
Unlike ``webdriver.Session#url``, which always returns
|
||||
the top-level browsing context's URL, this returns
|
||||
the current browsing context's active document's URL.
|
||||
"""
|
||||
return session.execute_script("return document.location.href")
|
||||
|
||||
|
||||
def element_rect(session, element):
|
||||
return session.execute_script("""
|
||||
let element = arguments[0];
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import urllib
|
||||
|
||||
|
||||
def inline(doc, doctype="html", mime="text/html;charset=utf-8", protocol="http"):
|
||||
def inline(doc,
|
||||
doctype="html",
|
||||
mime="text/html;charset=utf-8",
|
||||
**kwargs):
|
||||
from .fixtures import server_config, url
|
||||
build_url = url(server_config())
|
||||
|
||||
|
@ -30,11 +33,11 @@ def inline(doc, doctype="html", mime="text/html;charset=utf-8", protocol="http")
|
|||
|
||||
return build_url("/webdriver/tests/support/inline.py",
|
||||
query=urllib.urlencode(query),
|
||||
protocol=protocol)
|
||||
**kwargs)
|
||||
|
||||
|
||||
def iframe(doc):
|
||||
return "<iframe src='%s'></iframe>" % inline(doc)
|
||||
def iframe(doc, **kwargs):
|
||||
return "<iframe src='%s'></iframe>" % inline(doc, **kwargs)
|
||||
|
||||
|
||||
def main(request, response):
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue