Update web-platform-tests to revision b'b6cddc4617fedeed0db493b3ba9283148797447f' (#30021)

This commit is contained in:
Servo WPT Sync 2023-07-25 07:49:20 -04:00 committed by GitHub
parent f7fcc6e900
commit 8d32ec89eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
147 changed files with 4072 additions and 497 deletions

File diff suppressed because it is too large Load diff

View file

@ -8,8 +8,5 @@
[[data-expected-height\] 3]
expected: FAIL
[[data-expected-height\] 1]
expected: FAIL
[[data-expected-height\] 2]
[[data-expected-height\] 4]
expected: FAIL

View file

@ -1,2 +0,0 @@
[segment-break-transformation-unremovable-4.html]
expected: FAIL

View file

@ -0,0 +1,15 @@
[text-autospace-computed.html]
[Property text-autospace value 'normal']
expected: FAIL
[Property text-autospace value 'no-autospace']
expected: FAIL
[Property text-autospace value 'auto']
expected: FAIL
[Property text-autospace value 'ideograph-alpha']
expected: FAIL
[Property text-autospace value 'ideograph-numeric']
expected: FAIL

View file

@ -0,0 +1,30 @@
[text-autospace-valid.html]
[e.style['text-autospace'\] = "normal" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "no-autospace" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "auto" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "ideograph-alpha" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "ideograph-numeric" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "ideograph-alpha ideograph-numeric" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "punctuation" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "punctuation normal" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "punctuation ideograph-alpha" should set the property value]
expected: FAIL
[e.style['text-autospace'\] = "punctuation ideograph-alpha ideograph-numeric" should set the property value]
expected: FAIL

View file

@ -0,0 +1,2 @@
[ElementInternals-setFormValue-nullish-value.html]
expected: ERROR

View file

@ -1,4 +1,5 @@
[redirect-keepalive.any.html]
expected: TIMEOUT
[[keepalive\][new window\][unload\] same-origin redirect]
expected: FAIL

View file

@ -146,3 +146,9 @@
[list-style-image sec-fetch-site - HTTPS downgrade-upgrade]
expected: FAIL
[background-image sec-fetch-user - Not sent to non-trustworthy same-origin destination]
expected: TIMEOUT
[border-image sec-fetch-user - Not sent to non-trustworthy same-origin destination]
expected: FAIL

View file

@ -0,0 +1,27 @@
[worker-fetch.tentative.https.window.html]
[private to local: failed preflight.]
expected: FAIL
[private to local: success.]
expected: FAIL
[public to local: failed preflight.]
expected: FAIL
[public to local: success.]
expected: FAIL
[public to private: failed preflight.]
expected: FAIL
[public to private: success.]
expected: FAIL
[treat-as-public to local: failed preflight.]
expected: FAIL
[treat-as-public to private: failed preflight.]
expected: FAIL
[treat-as-public to private: success.]
expected: FAIL

View file

@ -13,3 +13,9 @@
[0080 00FF 0100 set in href="" targeting a frame and clicked]
expected: FAIL
[D83D DE0D set in href="" targeting a frame and clicked]
expected: FAIL
[DE0D 0041 set in href="" targeting a frame and clicked]
expected: FAIL

View file

@ -1,3 +0,0 @@
[navigation-unload-same-origin-fragment.html]
[Tests that a fragment navigation in the unload handler will not block the initial navigation]
expected: FAIL

View file

@ -1,4 +1,3 @@
[form-requestsubmit.html]
expected: TIMEOUT
[Replace before load, triggered by formElement.requestSubmit()]
expected: TIMEOUT
expected: FAIL

View file

@ -1,4 +1,3 @@
[form-submit-button-click.html]
expected: TIMEOUT
[Replace before load, triggered by submitButton.click()]
expected: TIMEOUT
expected: FAIL

View file

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

View file

@ -1,5 +1,4 @@
[cross-origin-objects.html]
expected: TIMEOUT
[Basic sanity-checking (cross-origin)]
expected: FAIL

View file

@ -1,3 +0,0 @@
[creating_browsing_context_test_01.html]
[first argument: absolute url]
expected: FAIL

View file

@ -1,2 +1,2 @@
[canvas.2d.disconnected.html]
expected: TIMEOUT
expected: FAIL

View file

@ -0,0 +1,6 @@
[nontraditional-about-srcdoc.html]
[about:srcdoc navigated via a `javascript:` URL is treated like a normal about:srcdoc document]
expected: FAIL
[about:srcdoc with URL changed by history.replaceState() is treated like a normal about:srcdoc document]
expected: FAIL

View file

@ -1,7 +1,6 @@
[autofocus-dialog.html]
expected: TIMEOUT
[<dialog> can contain autofocus, without stopping page autofocus content from working]
expected: FAIL
[<dialog>-contained autofocus element gets focused when the dialog is shown]
expected: TIMEOUT
expected: FAIL

View file

@ -1,4 +0,0 @@
[skip-another-top-level-browsing-context.html]
expected: TIMEOUT
[Autofocus elements queued in another top-level browsing context's documents should be skipped.]
expected: TIMEOUT

View file

@ -0,0 +1,3 @@
[media_fragment_seek.html]
[Video should seek to time specified in media fragment syntax]
expected: FAIL

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_escaping-1.html]
type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: FAIL
expected: TIMEOUT

View file

@ -1,5 +1,4 @@
[iframe_sandbox_popups_escaping-3.html]
type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe escape the sandbox if\n allow-popups-to-escape-sandbox is used]
expected: TIMEOUT
expected: FAIL

View file

@ -1,4 +1,5 @@
[iframe_sandbox_popups_nonescaping-1.html]
type: testharness
expected: TIMEOUT
[Check that popups from a sandboxed iframe do not escape the sandbox]
expected: FAIL
expected: NOTRUN

View file

@ -164,9 +164,6 @@
[text/plain: backslash in name (formdata event)]
expected: FAIL
[text/plain: Basic test (formdata event)]
expected: FAIL
[text/plain: 0x00 in name (formdata event)]
expected: FAIL
@ -181,3 +178,6 @@
[text/plain: Basic File test (formdata event)]
expected: FAIL
[text/plain: 0x00 in name (normal form)]
expected: FAIL

View file

@ -1,3 +0,0 @@
[historical.html]
[<input name=isindex> should not be supported]
expected: FAIL

View file

@ -1,4 +1,5 @@
[promise-job-entry-different-function-realm.html]
expected: TIMEOUT
[Fulfillment handler on fulfilled promise]
expected: FAIL
@ -12,4 +13,4 @@
expected: FAIL
[Fulfillment handler on pending-then-fulfilled promise]
expected: FAIL
expected: TIMEOUT

View file

@ -1,9 +1,10 @@
[promise-job-entry.html]
expected: TIMEOUT
[Fulfillment handler on fulfilled promise]
expected: FAIL
[Rejection handler on pending-then-rejected promise]
expected: FAIL
expected: TIMEOUT
[Sanity check: this all works as expected with no promises involved]
expected: FAIL
@ -15,4 +16,4 @@
expected: FAIL
[Fulfillment handler on pending-then-fulfilled promise]
expected: FAIL
expected: TIMEOUT

View file

@ -1,6 +1,7 @@
[promise-rejection-events.html]
expected: TIMEOUT
[delayed handling: delaying handling rejected promise created from createImageBitmap will cause both events to fire]
expected: FAIL
expected: TIMEOUT
[unhandledrejection: from createImageBitmap which is UA triggered]
expected: FAIL

View file

@ -94,10 +94,10 @@
expected: FAIL
[mime-type 16 : text/html;charset=\x0bgbk]
expected: FAIL
expected: TIMEOUT
[mime-type 17 : text/html;charset=\x0cgbk]
expected: TIMEOUT
expected: NOTRUN
[mime-type 18 : text/html;\x0bcharset=gbk]
expected: NOTRUN

View file

@ -17,3 +17,6 @@
[A ResourceTiming entry should be created for network error of type too many redirects]
expected: NOTRUN
[A ResourceTiming entry should be created for network error of type network error for ORB-blocked response]
expected: NOTRUN

View file

@ -1,5 +1,5 @@
[cross-partition.https.tentative.html]
expected: CRASH
expected: TIMEOUT
[BroadcastChannel messages aren't received from a cross-partition iframe]
expected: FAIL

View file

@ -1,4 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

View file

@ -1,4 +0,0 @@
[017.html]
expected: TIMEOUT
[origin of the script that invoked the method, about:blank]
expected: TIMEOUT

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,6 @@
[scroll-behavior-smooth-navigation.html]
[Instant scrolling while doing history navigation.]
expected: FAIL
[Smooth scrolling while doing history navigation.]
expected: FAIL

View file

@ -25,6 +25,10 @@ def main(request, response):
return (533, [], "Should not have Referer")
if request.headers.get(b"Origin"):
return (534, [], "Should not have Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (535, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"cross-site":
return (536, [], "Wrong Sec-Fetch-Site header")
response.headers.set(b"Content-Type", b"application/json")

View file

@ -12,6 +12,9 @@
cloningTest('large typed array', [
{ type: 'buffer', size: wrapThreshold, seed: 1 },
// This test uses non-random data to test that compression doesn't
// break functionality.
{ type: 'buffer', size: wrapThreshold, seed: 0 },
])
cloningTestWithKeyGenerator('blob with large typed array', [

View file

@ -296,12 +296,17 @@ function checkTitleIndexContents(testCase, index, errorMessage) {
});
}
// Returns an Uint8Array with pseudorandom data.
//
// Returns an Uint8Array.
// When `seed` is non-zero, the data is pseudo-random, otherwise it is repetitive.
// The PRNG should be sufficient to defeat compression schemes, but it is not
// cryptographically strong.
function largeValue(size, seed) {
const buffer = new Uint8Array(size);
// Fill with a lot of the same byte.
if (seed == 0) {
buffer.fill(0x11, 0, size - 1);
return buffer;
}
// 32-bit xorshift - the seed can't be zero
let state = 1000 + seed;

View file

@ -9,6 +9,10 @@ def main(request, response):
return (533, [], "Should not have Referer")
if request.headers.get(b"Origin"):
return (534, [], "Should not have Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (535, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"none":
return (536, [], "Wrong Sec-Fetch-Site header")
response.headers.set(b"Content-Type", b"application/json")

View file

@ -14,6 +14,10 @@ def main(request, response):
return (533, [], "Should not have Referer")
if not request.headers.get(b"Origin"):
return (534, [], "Missing Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (535, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"cross-site":
return (536, [], "Wrong Sec-Fetch-Site header")
counter = request.server.stash.take(keys.CLIENT_METADATA_COUNTER_KEY)
try:

View file

@ -9,6 +9,10 @@ def main(request, response):
return (533, [], "Should not have Referer")
if request.headers.get(b"Origin"):
return (534, [], "Should not have Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (535, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"cross-site":
return (536, [], "Wrong Sec-Fetch-Site header")
response.headers.set(b"Content-Type", b"application/json")

View file

@ -9,6 +9,10 @@ def main(request, response):
return (533, [], "Should not have Referer")
if request.headers.get(b"Origin"):
return (534, [], "Should not have Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (535, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"none":
return (536, [], "Wrong Sec-Fetch-Site header")
response.headers.set(b"Content-Type", b"application/json")

View file

@ -13,6 +13,10 @@ def main(request, response):
return (534, [], "Should not have Referer")
if not request.headers.get(b"Origin"):
return (535, [], "Missing Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (539, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"none":
return (540, [], "Wrong Sec-Fetch-Site header")
if not request.POST.get(b"client_id"):
return (536, [], "Missing 'client_id' POST parameter")

View file

@ -13,6 +13,10 @@ def main(request, response):
return (534, [], "Should not have Referer")
if not request.headers.get(b"Origin"):
return (535, [], "Missing Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (539, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"none":
return (540, [], "Wrong Sec-Fetch-Site header")
if not request.POST.get(b"client_id"):
return (536, [], "Missing 'client_id' POST parameter")

View file

@ -9,6 +9,10 @@ def main(request, response):
return (533, [], "Should not have Referer")
if request.headers.get(b"Origin"):
return (534, [], "Should not have Origin")
if request.headers.get(b"Sec-Fetch-Mode") != b"no-cors":
return (535, [], "Wrong Sec-Fetch-Mode header")
if request.headers.get(b"Sec-Fetch-Site") != b"none":
return (536, [], "Wrong Sec-Fetch-Site header")
response.headers.set(b"Content-Type", b"application/json")

View file

@ -0,0 +1,23 @@
<!doctype html>
<title>CSS Test Reference</title>
<style>
div {
border-width: 5px;
border-color: green;
color: green;
margin-bottom: 2px;
}
</style>
<p>Test passes if all the border colors are green</p>
<div style="border-style: inset">
inset
</div>
<div style="border-style: outset">
outset
</div>
<div style="border-style: ridge">
ridge
</div>
<div style="border-style: groove">
groove
</div>

View file

@ -0,0 +1,26 @@
<!doctype html>
<title>`border-color: currentColor` resolves to `color` value</title>
<link rel=help href="https://www.w3.org/TR/css-color-3/#currentcolor">
<link rel=author title="Vitaly Dyachkov" href="mailto:vitaly@igalia.com">
<link rel=match href="border-color-currentcolor-ref.html">
<style>
div {
border-width: 5px;
border-color: currentColor;
color: green;
margin-bottom: 2px;
}
</style>
<p>Test passes if all the border colors are green</p>
<div style="border-style: inset">
inset
</div>
<div style="border-style: outset">
outset
</div>
<div style="border-style: ridge">
ridge
</div>
<div style="border-style: groove">
groove
</div>

View file

@ -40,6 +40,7 @@ tests = [
["rgba(0%)", "The rgba function requires 3 or 4 arguments"],
["rgba(0%, 0%)", "The rgba function requires 3 or 4 arguments"],
["rgba(0%, 0%, 0%, 0%, 0%)", "The rgba function requires 3 or 4 arguments"],
["rgb(257, 0, 5 / 0)", "Cannot mix legacy and non-legacy formats"],
];
for (const test of tests) {

View file

@ -7,7 +7,7 @@
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/>
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/>
<html:link rel="match" href="reference/mask-content-clip-002-ref.svg" />
<html:meta name="fuzzy" content="0-38; 0-200"/>
<html:meta name="fuzzy" content="0-38; 0-268"/>
<metadata class="flags">svg</metadata>
<desc class="assert">The mask element with
maskContentUnits="objectBoundingBox" gets clipped. The clipping path has a

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

@ -7,7 +7,7 @@
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/>
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/>
<html:link rel="match" href="reference/mask-content-clip-001-ref.svg" />
<html:meta name="fuzzy" content="0-38; 0-200"/>
<html:meta name="fuzzy" content="0-38; 0-376"/>
<metadata class="flags">svg</metadata>
<desc class="assert">The mask element with
maskContentUnits="objectBoundingBox" gets clipped. The clipping path has a

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

@ -7,7 +7,7 @@
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/>
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/>
<html:link rel="match" href="reference/mask-content-clip-002-ref.svg" />
<html:meta name="fuzzy" content="0-38; 0-200"/>
<html:meta name="fuzzy" content="0-38; 0-268"/>
<metadata class="flags">svg</metadata>
<desc class="assert">The mask element with
maskContentUnits="userSpaceOnUse" gets clipped. The clipping path has a

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

@ -7,7 +7,7 @@
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#svg-masks"/>
<html:link rel="help" href="http://www.w3.org/TR/css-masking-1/#MaskElement"/>
<html:link rel="match" href="reference/mask-content-clip-001-ref.svg" />
<html:meta name="fuzzy" content="0-38; 0-200"/>
<html:meta name="fuzzy" content="0-38; 0-376"/>
<metadata class="flags">svg</metadata>
<desc class="assert">The mask element with
maskContentUnits="userSpaceOnUse" gets clipped. The clipping path has a

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

@ -89,6 +89,7 @@ assert_valid("<image>", "linear-gradient(yellow, blue)");
assert_valid("<url>", "url(a)");
assert_valid("<color>+", "yellow blue");
assert_valid("<color>+", "yellow blue ");
assert_valid("<color>+ | <color>", "yellow blue");
assert_valid("<color> | <color>+", "yellow blue");
assert_valid("<color># | <color>", "yellow, blue");
@ -108,6 +109,7 @@ assert_valid("<transform-list> | <transform-function># ", "scale(2) rotate(90deg
assert_valid("<transform-function># | <transform-list>", "scale(2) rotate(90deg)");
assert_valid("<transform-list> | <transform-function># ", "scale(2), rotate(90deg)");
assert_valid("<transform-function># | <transform-list>", "scale(2), rotate(90deg)");
assert_valid("<transform-list>", "scale(2) rotate(90deg) ");
assert_valid("<integer>+ | <percentage>+ | <length>+ ", "1");
assert_valid("<integer>+ | <percentage>+ | <length>+ ", "1 1");
assert_valid("<integer>+ | <percentage>+ | <length>+ ", "1%");
@ -139,6 +141,7 @@ assert_valid("\\1F914 hmm", "🤔hmm");
assert_valid("\\1F914\\1F914", "🤔🤔");
// Invalid syntax
assert_invalid("<color>#", "yellow blue");
assert_invalid("banana,nya", "banana");
assert_invalid("<\\6c ength>", "10px");
assert_invalid("<banana>", "banana");
@ -156,6 +159,8 @@ assert_invalid("<length>##", "10px");
assert_invalid("<length>+#", "10px");
assert_invalid("<length>#+", "10px");
assert_invalid("<length> | *", "10px");
assert_invalid("<length>+", "2px,7px,calc(8px)");
assert_invalid("<length>#", "2px 7px calc(8px)");
assert_invalid("*|banana", "banana");
assert_invalid("|banana", "banana");
assert_invalid("*+", "banana");

View file

@ -0,0 +1,34 @@
<!doctype html>
<style>
:root {
color-scheme: dark;
}
body {
display: flex;
flex-wrap: wrap;
width: 200vw;
height: 200vh;
}
.container {
scrollbar-gutter: stable;
flex: 0 0;
overflow: auto;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
.content {
height: 300px;
width: 300px;
background: red;
}
</style>
<div class="container">
<div class="content"></div>
</div>

View file

@ -0,0 +1,46 @@
<!doctype html>
<html class="reftest-wait">
<title>Dynamically set color-scheme and ensure scrollbars update</title>
<link rel="author" title="Luke Warlow" href="mailto:luke@warlow.dev" />
<link rel="help" href="https://drafts.csswg.org/css-scrollbars/#valdef-scrollbar-color-auto" />
<link rel="match" href="scrollbar-color-scheme-dynamic-1-ref.html" />
<script src="/common/reftest-wait.js"></script>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
width: 200vw;
height: 200vh;
}
.container {
scrollbar-gutter: stable;
overflow: auto;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
.content {
height: 300px;
width: 300px;
background: red;
}
</style>
<div class="container">
<div class="content"></div>
</div>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.documentElement.style.colorScheme = 'dark';
takeScreenshot();
}));
</script>

View file

@ -0,0 +1,23 @@
<!doctype html>
<style>
:root {
color-scheme: dark;
}
body {
display: flex;
flex-wrap: wrap;
overflow: scroll;
}
.container {
scrollbar-gutter: stable;
overflow: scroll;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
</style>
<div class="container"></div>

View file

@ -0,0 +1,36 @@
<!doctype html>
<html class="reftest-wait">
<title>Dynamically set color-scheme and ensure viewport scrollbars update</title>
<link rel="author" title="Luke Warlow" href="mailto:luke@warlow.dev" />
<link rel="help" href="https://drafts.csswg.org/css-scrollbars/#valdef-scrollbar-color-auto" />
<link rel="match" href="scrollbar-color-scheme-dynamic-2-ref.html" />
<script src="/common/reftest-wait.js"></script>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
overflow: scroll;
}
.container {
scrollbar-gutter: stable;
overflow: scroll;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
</style>
<div class="container"></div>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.documentElement.style.colorScheme = 'dark';
takeScreenshot();
}));
</script>

View file

@ -0,0 +1,35 @@
<!doctype html>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
width: 200vw;
height: 200vh;
}
.container {
color-scheme: dark;
scrollbar-gutter: stable;
flex: 0 0;
overflow: auto;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
.content {
height: 300px;
width: 300px;
background: red;
}
</style>
<div class="container">
<div class="content"></div>
</div>

View file

@ -0,0 +1,46 @@
<!doctype html>
<html class="reftest-wait">
<title>Dynamically set color-scheme and ensure scrollbars update</title>
<link rel="author" title="Luke Warlow" href="mailto:luke@warlow.dev" />
<link rel="help" href="https://drafts.csswg.org/css-scrollbars/#valdef-scrollbar-color-auto" />
<link rel="match" href="scrollbar-color-scheme-dynamic-3-ref.html" />
<script src="/common/reftest-wait.js"></script>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
width: 200vw;
height: 200vh;
}
.container {
scrollbar-gutter: stable;
overflow: auto;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
.content {
height: 300px;
width: 300px;
background: red;
}
</style>
<div class="container">
<div class="content"></div>
</div>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.querySelector(".container").style.colorScheme = 'dark';
takeScreenshot();
}));
</script>

View file

@ -0,0 +1,24 @@
<!doctype html>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
overflow: scroll;
}
.container {
color-scheme: dark;
scrollbar-gutter: stable;
overflow: scroll;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
</style>
<div class="container"></div>

View file

@ -0,0 +1,36 @@
<!doctype html>
<html class="reftest-wait">
<title>Dynamically set color-scheme and ensure viewport scrollbars update</title>
<link rel="author" title="Luke Warlow" href="mailto:luke@warlow.dev" />
<link rel="help" href="https://drafts.csswg.org/css-scrollbars/#valdef-scrollbar-color-auto" />
<link rel="match" href="scrollbar-color-scheme-dynamic-4-ref.html" />
<script src="/common/reftest-wait.js"></script>
<style>
:root {
color-scheme: light;
}
body {
display: flex;
flex-wrap: wrap;
overflow: scroll;
}
.container {
scrollbar-gutter: stable;
overflow: scroll;
flex: 0 0;
height: 200px;
min-width: 200px;
margin: 1px;
padding: 0px;
border: none;
background: deepskyblue;
}
</style>
<div class="container"></div>
<script>
requestAnimationFrame(() => requestAnimationFrame(() => {
document.querySelector(".container").style.colorScheme = 'dark';
takeScreenshot();
}));
</script>

View file

@ -0,0 +1,94 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>contain-intrinsic-width: auto none in vertical writing mode</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override">
<meta name="assert" content="Tests that 'contain-intrinsic-width: auto none' respects the auto keyword in vertical writing mode">
<style>
#target {
width: max-content;
height: max-content;
}
.cis-auto {
contain-intrinsic-width: auto none;
}
.skip-contents {
content-visibility: hidden;
}
.size-100-50 {
inline-size: 100px;
block-size: 50px;
}
.size-75-25 {
inline-size: 75px;
block-size: 25px;
}
.vertical {
writing-mode: vertical-lr;
}
</style>
<div id="log"></div>
<div id="parent">
<div id="target">
<div id="contents"></div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const parent = document.getElementById("parent");
const target = document.getElementById("target");
const contents = document.getElementById("contents");
function checkSize(expectedWidth, expectedHeight, msg) {
assert_equals(target.clientWidth, expectedWidth, msg + " - clientWidth");
assert_equals(target.clientHeight, expectedHeight, msg + " - clientHeight");
}
function nextRendering() {
return new Promise(resolve => {
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
});
}
function cleanup() {
parent.className = "";
target.className = "";
contents.className = "";
checkSize(0, 0, "Sizing after cleanup");
}
promise_test(async function() {
this.add_cleanup(cleanup);
parent.classList.add("vertical");
target.className = "cis-auto skip-contents";
contents.classList.add("size-100-50");
checkSize(0, 0, "Size containment with no last remembered width");
target.classList.remove("skip-contents");
checkSize(50, 100, "Sizing normally");
await nextRendering();
target.classList.add("skip-contents");
checkSize(50, 0, "Using last remembered width");
contents.classList.remove("size-100-50");
contents.classList.add("size-75-25");
checkSize(50, 0, "Still using last remembered width");
target.classList.remove("skip-contents");
checkSize(25, 75, "Sizing normally with different size");
target.classList.add("skip-contents");
checkSize(50, 0, "Going back to last remembered width");
target.classList.remove("skip-contents");
await nextRendering();
target.classList.add("skip-contents");
checkSize(25, 0, "Using the new last remembered width");
}, "Basic usage");
</script>

View file

@ -0,0 +1,94 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>contain-intrinsic-height: auto none in vertical writing mode</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override">
<meta name="assert" content="Tests that 'contain-intrinsic-height: auto none' respects the auto keyword in vertical writing mode">
<style>
#target {
width: max-content;
height: max-content;
}
.cis-auto {
contain-intrinsic-height: auto none;
}
.skip-contents {
content-visibility: hidden;
}
.size-100-50 {
inline-size: 100px;
block-size: 50px;
}
.size-75-25 {
inline-size: 75px;
block-size: 25px;
}
.vertical {
writing-mode: vertical-lr;
}
</style>
<div id="log"></div>
<div id="parent">
<div id="target">
<div id="contents"></div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const parent = document.getElementById("parent");
const target = document.getElementById("target");
const contents = document.getElementById("contents");
function checkSize(expectedWidth, expectedHeight, msg) {
assert_equals(target.clientWidth, expectedWidth, msg + " - clientWidth");
assert_equals(target.clientHeight, expectedHeight, msg + " - clientHeight");
}
function nextRendering() {
return new Promise(resolve => {
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
});
}
function cleanup() {
parent.className = "";
target.className = "";
contents.className = "";
checkSize(0, 0, "Sizing after cleanup");
}
promise_test(async function() {
this.add_cleanup(cleanup);
parent.classList.add("vertical");
target.className = "cis-auto skip-contents";
contents.classList.add("size-100-50");
checkSize(0, 0, "Size containment with no last remembered heigth");
target.classList.remove("skip-contents");
checkSize(50, 100, "Sizing normally");
await nextRendering();
target.classList.add("skip-contents");
checkSize(0, 100, "Using last remembered heigth");
contents.classList.remove("size-100-50");
contents.classList.add("size-75-25");
checkSize(0, 100, "Still using last remembered heigth");
target.classList.remove("skip-contents");
checkSize(25, 75, "Sizing normally with different size");
target.classList.add("skip-contents");
checkSize(0, 100, "Going back to last remembered heigth");
target.classList.remove("skip-contents");
await nextRendering();
target.classList.add("skip-contents");
checkSize(0, 75, "Using the new last remembered heigth");
}, "Basic usage");
</script>

View file

@ -0,0 +1,94 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>contain-intrinsic-width: auto length in vertical writing mode</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override">
<meta name="assert" content="Tests that 'contain-intrinsic-width: auto length' respects the auto keyword in vertical writing mode">
<style>
#target {
width: max-content;
height: max-content;
}
.cis-auto {
contain-intrinsic-width: auto 2px;
}
.skip-contents {
content-visibility: hidden;
}
.size-100-50 {
inline-size: 100px;
block-size: 50px;
}
.size-75-25 {
inline-size: 75px;
block-size: 25px;
}
.vertical {
writing-mode: vertical-lr;
}
</style>
<div id="log"></div>
<div id="parent">
<div id="target">
<div id="contents"></div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const parent = document.getElementById("parent");
const target = document.getElementById("target");
const contents = document.getElementById("contents");
function checkSize(expectedWidth, expectedHeight, msg) {
assert_equals(target.clientWidth, expectedWidth, msg + " - clientWidth");
assert_equals(target.clientHeight, expectedHeight, msg + " - clientHeight");
}
function nextRendering() {
return new Promise(resolve => {
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
});
}
function cleanup() {
parent.className = "";
target.className = "";
contents.className = "";
checkSize(0, 0, "Sizing after cleanup");
}
promise_test(async function() {
this.add_cleanup(cleanup);
parent.classList.add("vertical");
target.className = "cis-auto skip-contents";
contents.classList.add("size-100-50");
checkSize(2, 0, "Size containment with no last remembered width");
target.classList.remove("skip-contents");
checkSize(50, 100, "Sizing normally");
await nextRendering();
target.classList.add("skip-contents");
checkSize(50, 0, "Using last remembered width");
contents.classList.remove("size-100-50");
contents.classList.add("size-75-25");
checkSize(50, 0, "Still using last remembered width");
target.classList.remove("skip-contents");
checkSize(25, 75, "Sizing normally with different size");
target.classList.add("skip-contents");
checkSize(50, 0, "Going back to last remembered width");
target.classList.remove("skip-contents");
await nextRendering();
target.classList.add("skip-contents");
checkSize(25, 0, "Using the new last remembered width");
}, "Basic usage");
</script>

View file

@ -0,0 +1,94 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>contain-intrinsic-height: auto length in vertical writing mode</title>
<link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override">
<meta name="assert" content="Tests that 'contain-intrinsic-height: auto length' respects the auto keyword in vertical writing mode">
<style>
#target {
width: max-content;
height: max-content;
}
.cis-auto {
contain-intrinsic-height: auto 2px;
}
.skip-contents {
content-visibility: hidden;
}
.size-100-50 {
inline-size: 100px;
block-size: 50px;
}
.size-75-25 {
inline-size: 75px;
block-size: 25px;
}
.vertical {
writing-mode: vertical-lr;
}
</style>
<div id="log"></div>
<div id="parent">
<div id="target">
<div id="contents"></div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const parent = document.getElementById("parent");
const target = document.getElementById("target");
const contents = document.getElementById("contents");
function checkSize(expectedWidth, expectedHeight, msg) {
assert_equals(target.clientWidth, expectedWidth, msg + " - clientWidth");
assert_equals(target.clientHeight, expectedHeight, msg + " - clientHeight");
}
function nextRendering() {
return new Promise(resolve => {
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
});
}
function cleanup() {
parent.className = "";
target.className = "";
contents.className = "";
checkSize(0, 0, "Sizing after cleanup");
}
promise_test(async function() {
this.add_cleanup(cleanup);
parent.classList.add("vertical");
target.className = "cis-auto skip-contents";
contents.classList.add("size-100-50");
checkSize(0, 2, "Size containment with no last remembered heigth");
target.classList.remove("skip-contents");
checkSize(50, 100, "Sizing normally");
await nextRendering();
target.classList.add("skip-contents");
checkSize(0, 100, "Using last remembered heigth");
contents.classList.remove("size-100-50");
contents.classList.add("size-75-25");
checkSize(0, 100, "Still using last remembered heigth");
target.classList.remove("skip-contents");
checkSize(25, 75, "Sizing normally with different size");
target.classList.add("skip-contents");
checkSize(0, 100, "Going back to last remembered heigth");
target.classList.remove("skip-contents");
await nextRendering();
target.classList.add("skip-contents");
checkSize(0, 75, "Using the new last remembered heigth");
}, "Basic usage");
</script>

View file

@ -14,7 +14,9 @@
</style>
</head>
<body>
<div id=target></div>
<div style="contain-intrinsic-size: 5px 5px">
<div id=target></div>
</div>
<div id=scratch></div>
<script>
@ -31,6 +33,7 @@ test_computed_value("contain-intrinsic-size", "1px auto 1px");
test_computed_value("contain-intrinsic-size", "2vw 3px", length_ref("2vw") + " 3px");
test_computed_value("contain-intrinsic-size", "2px 3vh", "2px " + length_ref("3vh"));
test_computed_value("contain-intrinsic-size", "5px 5px", "5px");
test_computed_value("contain-intrinsic-size", "inherit", "5px");
test_computed_value("contain-intrinsic-width", "none");
test_computed_value("contain-intrinsic-width", "1px");

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text: getComputedStyle().textAutospace</title>
<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-text-autospace">
<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-autospace", "normal");
test_computed_value("text-autospace", "no-autospace");
test_computed_value("text-autospace", "auto");
test_computed_value("text-autospace", "ideograph-alpha");
test_computed_value("text-autospace", "ideograph-numeric");
</script>
</body>
</html>

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text Module Test: parsing text-autospace with invalid values</title>
<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-text-autospace">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_invalid_value("text-autospace", "normal ideograph-alpha");
test_invalid_value("text-autospace", "normal ideograph-alpha ideograph-numeric");
test_invalid_value("text-autospace", "normal punctuation");
test_invalid_value("text-autospace", "auto ideograph-alpha");
test_invalid_value("text-autospace", "auto ideograph-alpha ideograph-numeric");
test_invalid_value("text-autospace", "auto punctuation");
test_invalid_value("text-autospace", "normal insert");
test_invalid_value("text-autospace", "normal replace");
test_invalid_value("text-autospace", "auto insert");
test_invalid_value("text-autospace", "auto replace");
</script>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Text Module Test: parsing text-autospace with valid values</title>
<link rel="help" href="https://drafts.csswg.org/css-text-4/#propdef-text-autospace">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
</head>
<body>
<script>
test_valid_value("text-autospace", "normal");
test_valid_value("text-autospace", "no-autospace");
test_valid_value("text-autospace", "auto");
test_valid_value("text-autospace", "ideograph-alpha");
test_valid_value("text-autospace", "ideograph-numeric");
test_valid_value("text-autospace", "ideograph-alpha ideograph-numeric");
test_valid_value("text-autospace", "punctuation");
test_valid_value("text-autospace", "punctuation normal");
test_valid_value("text-autospace", "punctuation ideograph-alpha");
test_valid_value("text-autospace", "punctuation ideograph-alpha ideograph-numeric");
</script>
</body>
</html>

View file

@ -21,7 +21,7 @@
<body>
<p>The test passes if there is a green square and no red.</p>
<svg>
<path d="M 4,3 101,99 296,197 200,101 Z" fill="red"/>
<path d="M 4,3 101,98 295,196 200,101 Z" fill="red"/>
<rect width="100" height="100" fill="green" transform="skewX(45) skewY(45)"/>
</svg>
</body>

View file

@ -0,0 +1,45 @@
<!DOCTYPE html>
<html>
<head>
<title>ElementInternals.setFormValue(nullish value) should clear submission value</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/custom-elements.html#dom-elementinternals-setformvalue">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
customElements.define("test-form-element", class extends HTMLElement {
static formAssociated = true;
constructor() {
super();
this.i = this.attachInternals();
}
});
</script>
</head>
<body>
<form id="form-null">
<test-form-element id="input-null" name="input-null"></test-form-element>
</form>
<form id="form-undefined">
<test-form-element id="input-undefined" name="input-undefined"></test-form-element>
</form>
<script>
test(() => {
const input = document.getElementById("input-null");
input.i.setFormValue("fail");
input.i.setFormValue(null);
const formData = new FormData(document.getElementById("form-null"));
assert_false(formData.has("input-null"));
}, "ElementInternals.setFormValue(null) clears submission value");
test(() => {
const input = document.getElementById("input-undefined");
input.i.setFormValue("fail");
input.i.setFormValue(undefined);
const formData = new FormData(document.getElementById("form-undefined"));
assert_false(formData.has("input-undefined"));
}, "ElementInternals.setFormValue(undefined) clears submission value");
</script>
</body>
</html>

View file

@ -0,0 +1,58 @@
<!DOCTYPE html>
<title>Test setReportEventDataForAutomaticBeacons called only once</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="resources/utils.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<body>
<script>
promise_test(async(t) => {
const actions = new test_driver.Actions();
const fencedframe = await attachFencedFrameContext(
{generator_api: 'fledge'});
const new_url = new URL("resources/dummy.html", location.href);
const beacon_data = "This is the beacon data!";
await fencedframe.execute((new_url, beacon_data) => {
let beacon_event = {
eventType: "reserved.top_navigation",
eventData: beacon_data,
destination: ["buyer"],
once: true,
}
window.fence.setReportEventDataForAutomaticBeacons(beacon_event);
addEventListener("click", (event) => {
window.open(new_url, "_blank");
});
}, [new_url, beacon_data]);
// The first click should trigger the automatic beacon and clear the beacon
// data.
await actions.pointerMove(0, 0, {origin: fencedframe.element})
.pointerDown()
.pointerUp()
.send();
const received_beacon_data_1 = await nextAutomaticBeacon();
assert_equals(received_beacon_data_1, beacon_data);
// The second click should not have any associated automatic beacon data, so
// no beacon should be sent.
await actions.pointerMove(0, 0, {origin: fencedframe.element})
.pointerDown()
.pointerUp()
.send();
// Set up a timeout to ensure that there's enough time to send any potential
// automatic beacons.
const timeout = new Promise(resolve => t.step_timeout(resolve, 1000));
const result = await Promise.race([nextAutomaticBeacon(), timeout]);
assert_true(typeof result === "undefined");
}, 'Set expiring automatic beacon but trigger two events in a click handler');
</script>
</body>

View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<title>Test setReportEventDataForAutomaticBeacons called only once</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="resources/utils.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<body>
<script>
promise_test(async(t) => {
const actions = new test_driver.Actions();
const fencedframe = await attachFencedFrameContext(
{generator_api: 'fledge'});
const new_url = new URL("resources/dummy.html", location.href);
const beacon_data = "This is the beacon data!";
await fencedframe.execute((new_url, beacon_data) => {
// `once` defaults to false.
let beacon_event = {
eventType: "reserved.top_navigation",
eventData: beacon_data,
destination: ["buyer"],
}
window.fence.setReportEventDataForAutomaticBeacons(beacon_event);
addEventListener("click", (event) => {
window.open(new_url, "_blank");
});
}, [new_url, beacon_data]);
// The first click should trigger the automatic beacon, but the beacon data
// should not be cleared out.
await actions.pointerMove(0, 0, {origin: fencedframe.element})
.pointerDown()
.pointerUp()
.send();
const received_beacon_data_1 = await nextAutomaticBeacon();
assert_equals(received_beacon_data_1, beacon_data);
// The second click should still have associated automatic beacon data, and a
// beacon should be sent.
await actions.pointerMove(0, 0, {origin: fencedframe.element})
.pointerDown()
.pointerUp()
.send();
const received_beacon_data_2 = await nextAutomaticBeacon();
assert_equals(received_beacon_data_2, beacon_data);
}, 'Set persisting automatic beacon but trigger two events in a click handler');
</script>
</body>

View file

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<title>focus() centers element outside displayport</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<style>
#container {
height: 25vh;
width: 100vw;
background: yellow;
overflow: auto;
white-space: nowrap;
}
.spacer {
width: 150vw;
height: 150vh;
background: green;
}
#target {
height: 5vh;
width: 5vw;
background: red;
margin: 0 auto;
}
#container > div {
display: inline-block;
}
</style>
</head>
<body>
<div id="container">
<div class="spacer"></div>
<!-- Center the target element -->
<div style="width: 5vw">
<div style="height: 70vh"></div>
<div tabindex=0 id="target"></div>
<div style="height: 70vh"></div>
</div>
<div class="spacer"></div>
</div>
</body>
<script>
function promiseFrame() {
return new Promise(resolve => {
requestAnimationFrame(() => requestAnimationFrame(() => resolve()));
});
}
promise_test(async (t) => {
let target = document.getElementById("target");
// Focus the element and record the scroll position
target.focus();
await promiseFrame();
let focusLeft = container.scrollLeft;
let focusTop = container.scrollTop;
container.scroll(0, 0);
// scrollIntoView the element and record the scroll position
target.scrollIntoView({block: "center", inline: "center"});
await promiseFrame();
let scrollLeft = container.scrollLeft;
let scrollTop = container.scrollTop;
// Ensure that both scroll positions are within +/- 1
assert_approx_equals(focusLeft, scrollLeft, 1.0,
"focus() inline direction is within +/- 1 of a centered scrollIntoView()");
assert_approx_equals(focusTop, scrollTop, 1.0,
"focus() block direction is within +/- 1 of a centered scrollIntoView()");
}, "Element.focus() center in both directions");
</script>
</html>

View file

@ -0,0 +1,106 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Non-traditional about:srcdoc documents</title>
<link rel="help" href="https://github.com/whatwg/html/issues/9514">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
promise_test(async t => {
const iframe = document.createElement('iframe');
const srcdocOpenPromise = new Promise(resolve => {
window.srcdocOpenResolve = resolve;
});
iframe.srcdoc = `
<body onload="document.open();window.parent.srcdocOpenResolve();"></body>`;
document.body.append(iframe);
await srcdocOpenPromise;
assert_equals(iframe.contentDocument.URL, 'about:srcdoc');
// Calling the `about:srcdoc` Window's `fetch()` like this uses that Window's
// environment settings object as the request's client, which is where the
// request's referrer comes from, per
// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer.
//
// If this `document.open()`d srcdoc document is considered a proper
// `about:srcdoc` document, the referrer will not be `about:srcdoc`, but will
// instead come from the parent document.
let referrer = await iframe.contentWindow.fetch('resources/echo-referrer-text.py');
referrer = await referrer.text();
assert_equals(referrer, location.href,
'The request referrer is retrieved from the parent document for ' +
'about:srcdoc documents');
// Observe that the "about base URL" is retrieved [1] for `document.baseURI`
// as well, indicating that the document is treated like a normal srcdoc
// document.
// [1]: https://html.spec.whatwg.org/#fallback-base-url
assert_equals(iframe.contentDocument.baseURI, location.href,
'The about base URL is retrieved as the base URL for srcdoc documents');
}, 'about:srcdoc with document.open() is treated like a normal about:srcdoc document');
promise_test(async t => {
const iframe = document.createElement('iframe');
const javascriptURLPromise = new Promise(resolve => {
window.javascriptURLResolve = resolve;
});
iframe.srcdoc = `
<script>
location.href = "javascript:'<body onload=window.parent.javascriptURLResolve();>Document contents here</body>'";
</scr`+`ipt>`;
document.body.append(iframe);
// This promise will resolve as a result of script running in the *new*
// document that gets created by the `javascript:` URL.
await javascriptURLPromise;
assert_equals(iframe.contentDocument.URL, 'about:srcdoc');
// See the first assertion in the first test in this file.
let referrer = await iframe.contentWindow.fetch('resources/echo-referrer-text.py');
referrer = await referrer.text();
assert_equals(referrer, location.href,
'The request referrer is retrieved from the parent document for ' +
'about:srcdoc documents');
// See the second assertion in the first test in this file.
assert_equals(iframe.contentDocument.baseURI, location.href,
'The about base URL is retrieved as the base URL for srcdoc documents');
}, 'about:srcdoc navigated via a `javascript:` URL is treated like a normal about:srcdoc document');
promise_test(async t => {
const iframe = document.createElement('iframe');
const srcdocLoadPromise = new Promise(resolve => {
iframe.onload = resolve;
});
iframe.srcdoc = `Document contents here`;
document.body.append(iframe);
await srcdocLoadPromise;
assert_equals(iframe.contentDocument.URL, 'about:srcdoc');
// Change the document's URL to `about:srcdoc#foo` and ensure that the
// observable behavior in that document is consistent with treating it as a
// normal `about:srcdoc` document.
iframe.contentWindow.history.replaceState(null, '', 'about:srcdoc#foo');
assert_equals(iframe.contentDocument.URL, 'about:srcdoc#foo');
// See the first assertion in the first test in this file.
let referrer = await iframe.contentWindow.fetch('resources/echo-referrer-text.py');
referrer = await referrer.text();
assert_equals(referrer, location.href,
'The request referrer is retrieved from the parent document for ' +
'about:srcdoc documents');
// See the second assertion in the first test in this file.
assert_equals(iframe.contentDocument.baseURI, location.href,
'The about base URL is retrieved as the base URL for srcdoc documents');
}, 'about:srcdoc with URL changed by history.replaceState() is treated like ' +
'a normal about:srcdoc document');
</script>
</body>

View file

@ -0,0 +1,4 @@
def main(request, response):
response_headers = [(b"Content-Type", b"text/plain")]
body = b"%s"% request.headers.get(b"referer", b"")
return (200, response_headers, body)

View file

@ -0,0 +1,42 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Form input type=number constraint validation</title>
<link rel="author" title="Adam Vandolder" href="mailto:avandolder@mozilla.com">
<link rel=help href="https://html.spec.whatwg.org/multipage/#number-state-(type=number)">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="log"></div>
<input type="number">
<script>
const input = document.querySelector("input");
const invalidInputNumber = "1.e";
const invalidSetNumber = "1.";
promise_test(async () => {
await test_driver.click(input);
await test_driver.send_keys(input, invalidInputNumber);
assert_equals(input.value.length, 0);
assert_true(input.validity.badInput);
}, "Unparsable number user input triggers sanitization and causes badInput to be set.");
promise_test(async () => {
input.value = invalidInputNumber;
assert_equals(input.value.length, 0);
assert_false(input.validity.badInput);
}, "Setting .value to an unparsable number triggers sanitization but doesn't set badInput.");
promise_test(async () => {
await test_driver.click(input);
await test_driver.send_keys(input, invalidSetNumber);
assert_equals(input.value, "1");
assert_false(input.validity.badInput);
}, "Users inputting a parsable but invalid floating point number doesn't trigger sanitization and doesn't set badInput.");
promise_test(async () => {
input.value = invalidSetNumber;
assert_equals(input.value.length, 0);
assert_false(input.validity.badInput);
}, "Setting .value to a parsable but invalid floating point number triggers sanitization but doesn't set badInput.");
</script>

View file

@ -324,6 +324,7 @@ window.onload = () => {
// handler should run, set a new type, and that type should end up
// as the final result.
assert_false(popover.matches(':popover-open'));
assert_true(gotEvent);
if (inEventType === undefined || (method ==="idl" && inEventType === null)) {
assert_throws_dom("NotSupportedError",() => popover.showPopover(),'We should have removed the popover attribute, so showPopover should throw');
} else {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,42 @@
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Largest Contentful Paint: Progressively Loaded Image</title>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/largest-contentful-paint-helpers.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script>
promise_test(async function (t) {
assert_implements(window.LargestContentfulPaint, "LargestContentfulPaint is not implemented");
const beforeLoad = performance.now();
const observer = new PerformanceObserver(
t.step_func_done(function(entryList) {
assert_equals(entryList.getEntries().length, 1);
const entry = entryList.getEntries()[0];
const imgElement = document.getElementById('image_id');
const imageSrc = imgElement.currentSrc;
const imageWidth = imgElement.naturalWidth;
const imageHeight = imgElement.naturalHeight;
const size = imageWidth * imageHeight;
const lcpLoadTime = entry.loadTime;
const lcpRenderTime = entry.renderTime;
const resLoadTime = calculateResourceLoadTime(imageSrc);
assert_greater_than_equal(lcpLoadTime,resLoadTime,'Load before LCP event fired');
assert_greater_than_equal(lcpRenderTime,resLoadTime,'Load before LCP event rendered');
checkImage(entry, imageSrc, 'image_id', size, beforeLoad);
})
);
observer.observe({type: 'largest-contentful-paint', buffered: true})
}, 'Ensure Progressive JPEG LCP load and render events occur after resource loading');
function calculateResourceLoadTime(imageSrc) {
const entries = performance.getEntriesByName(imageSrc);
const resourceEntry = entries[0];
assert_equals(entries.length, 1, 'No Resource timing entry found');
return resourceEntry.responseEnd;
}
</script>
<img src='/images/computer.jpg?pipe=trickle(982:d1)' id='image_id'/>
</body>
</html>

View file

@ -252,6 +252,9 @@ SET TIMEOUT: webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/me
SET TIMEOUT: webauthn/*timeout.https.html
SET TIMEOUT: webdriver/*
SET TIMEOUT: webmessaging/*
SET TIMEOUT: webrtc-encoded-transform/script-metadata-transform-worker.js
SET TIMEOUT: webrtc-encoded-transform/script-transform-generateKeyFrame.js
SET TIMEOUT: webrtc-encoded-transform/script-transform-sendKeyFrameRequest.js
SET TIMEOUT: webstorage/eventTestHarness.js
SET TIMEOUT: webvtt/*
SET TIMEOUT: workers/*

View file

@ -46,5 +46,28 @@ test_self_script_block(t => {
document.body.appendChild(script);
}, new URL("resources/busy.js?import", location.href).href, "execute-script");
const busy_wait_str = ` (function() {
const deadline = performance.now() + 365;
while (performance.now() < deadline) {}
})()
`;
const data_url = `data:text/javascript;charset=utf-8,${encodeURIComponent(busy_wait_str)}`;
test_self_script_block(t => {
const script = document.createElement("script");
script.src = data_url;
document.body.appendChild(script);
}, "data:", "classic-script");
const blob_url = URL.createObjectURL(new Blob([busy_wait_str], {type: "text/javascript"}));
test_self_script_block(t => {
const script = document.createElement("script");
script.src = blob_url;
document.body.appendChild(script);
}, blob_url, "classic-script");
</script>
</body>

View file

@ -11,6 +11,8 @@
<div id="log"></div>
<script>
const source_location_regex = /^([^@]+\@)?https?\:\/\/[^\/]+[^\:]+\:\d*$/;
promise_test(async t => {
const [entry, script] = await expect_long_frame_with_script(() => {
requestAnimationFrame(function non_bound_function() {
@ -18,6 +20,7 @@ promise_test(async t => {
});
}, script => script.name === "FrameRequestCallback", t);
assert_true(script.sourceLocation?.startsWith("non_bound_function"));
assert_regexp_match(script.sourceLocation, source_location_regex);
}, "Source location should be extracted from non-bound functions");
promise_test(async t => {
@ -28,6 +31,7 @@ promise_test(async t => {
}).bind(object));
}, script => script.name === "FrameRequestCallback", t);
assert_true(script.sourceLocation?.startsWith("my_bound_function"));
assert_regexp_match(script.sourceLocation, source_location_regex);
}, "Source location should be extracted from bound functions");
promise_test(async t => {
@ -37,6 +41,7 @@ promise_test(async t => {
});
}, script => script.name === "TimerHandler:setTimeout" && script.sourceLocation, t );
assert_true(script.sourceLocation.includes("testharness.js"));
assert_regexp_match(script.sourceLocation, source_location_regex);
}, "Source location should be extracted for setTimeout");
</script>

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Empty &lt;msqrt&gt; element (reference)</title>
</head>
<body>
<math><msqrt><mrow></mrow></msqrt></math>
</body>
</html>

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Empty &lt;msqrt&gt; element</title>
<link rel="help" href="https://w3c.github.io/mathml-core/#radicals-msqrt-mroot">
<meta name="assert" content="Empty msqrt should render as if it had a single empty mrow child.">
<link rel="match" href="empty-msqrt-ref.html">
</head>
<body>
<math><msqrt></msqrt></math>
<script src="/mathml/support/feature-detection.js"></script>
<script>MathMLFeatureDetection.ensure_for_match_reftest("has_msqrt");</script>
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MathML and size containment</title>
<link rel="help" href="https://w3c.github.io/mathml-core/#layout-algorithms">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/mathml/support/feature-detection.js"></script>
<script src="/mathml/support/mathml-fragments.js"></script>
<style>
/* Revert style specified in the UA style sheet that changes box size. */
merror { border: 0; }
mfrac { padding: 0; }
</style>
<script>
setup({ explicit_done: true });
window.addEventListener("load", runTests);
function runTests() {
for (tag in MathMLFragments) {
if (!FragmentHelper.isValidChildOfMrow(tag) ||
FragmentHelper.isEmpty(tag))
continue;
// TODO(https://github.com/w3c/mathml-core/issues/199): Check/decide how
// size containment behave for these cases:
// - table layout.
// - radical layout.
// - contain-intrinsic-block-size.
// - operators width special drawing (stretchy/largop).
if (tag == "mroot" || tag == "msqrt" || tag == "mtable") {
continue;
}
document.body.insertAdjacentHTML("beforeend", `<div style="position: absolute;">\
<div style="display: inline-block;"><math>${MathMLFragments[tag]}</math></div>\
</div>`);
let div = document.body.lastElementChild;
let elementContainer = div.firstElementChild;
let element = FragmentHelper.element(elementContainer);
FragmentHelper.forceNonEmptyDescendants(element);
const style = `contain: size; contain-intrinsic-inline-size: 111px;`;
element.setAttribute("style", style)
if (tag === "mo") {
element.setAttribute("lspace", "0");
element.setAttribute("rspace", "0");
}
const elementContainerWidth = elementContainer.getBoundingClientRect().width;
const elementBox = element.getBoundingClientRect();
test(function() {
assert_true(MathMLFeatureDetection[`has_${tag}`](), `${tag} is supported`);
assert_equals(elementContainerWidth, 111);
}, `intrinsic size of ${tag} with ${style}`);
test(function() {
assert_true(MathMLFeatureDetection[`has_${tag}`](), `${tag} is supported`);
assert_equals(elementBox.width, 111);
}, `inline-size of ${tag} with ${style}`);
div.style = "display: none;"; // Hide the div after measurement.
}
done();
}
</script>
</head>
<body>
<div id="log"></div>
</body>
</html>

View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>requireInteraction: true</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<p>
<button id="button">Push me to open a requireInteraction=true notification!</button>
<button id="finish">Push me if you are done</button>
</p>
Steps:
<ol>
<li>Make sure you didn't block the notification permission.</li>
<li>Allow the notification permission if the prompt opens.</li>
<li>Click the first button.</li>
<li>See whether the notification disappears from the screen without interaction. It must not.</li>
<li>If you are sure it's not disappearing, then click that second button.</li>
</ol>
Why this is manual? Because
<ol>
<li>
One need to wait for more than arbitrary platform-specific time to see
it really does not disappear automatically.
</li>
<li>There's simply no API to tell it's disappeared from the screen or not</li>
</ol>
<script>
setup({ explicit_timeout: true })
promise_test(async () => {
const permission = await Notification.requestPermission();
if (permission === "denied") {
throw new Error("Permission is denied, can't proceed");
}
await new Promise(r => button.onclick = r);
const n = new Notification("Test notification", { requireInteraction: true });
await new Promise((resolve, reject) => {
n.onshow = resolve;
n.onerror = () => reject(new Error(
"Notification failed, and there's no good error message. Maybe some permission issue?"
));
});
await Promise.race([
new Promise(r => finish.onclick = r),
new Promise((r, reject) => {
n.onclose = n.onclick = () => reject(new Error(
"Uh, you should finish the test before you interact with the notification."
));
}),
]);
});
</script>

View file

@ -35,12 +35,6 @@ const defaultDetails = Object.freeze({
},
});
promise_test(async (t) => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
const acceptPromise = request.show();
await promise_rejects_dom(t, "SecurityError", acceptPromise);
}, `Calling show() without being triggered by user interaction throws`);
promise_test(async (t) => {
const request = new PaymentRequest(defaultMethods, defaultDetails);
await promise_rejects_dom(t, "SecurityError", request.show());
@ -63,11 +57,8 @@ promise_test(async (t) => {
await test_driver.bless();
const acceptPromise1 = request1.show();
// User activation consumed, so...
const request2 = new PaymentRequest(defaultMethods, defaultDetails);
await promise_rejects_dom(t, "SecurityError", request2.show());
// Payment request already showing, so...
const request2 = new PaymentRequest(defaultMethods, defaultDetails);
await test_driver.bless();
await promise_rejects_dom(t, "AbortError", request2.show());

View file

@ -37,22 +37,16 @@
promise_test(async t => {
const pr = new PaymentRequest(defaultMethods, defaultDetails);
// Not activated by user gesture, so not allowed!
await promise_rejects_dom(t, "SecurityError", pr.show());
await test_driver.bless("Calls show() method");
// Activated by user gesture, so all good.
const showPromise = pr.show();
// The activation has been consumed, so calling show() again would require
// a new gesture.
await promise_rejects_dom(t, "InvalidStateError", pr.show());
// The activation has been consumed.
assert_false(navigator.userActivation.isActive);
// Abort the payment request
pr.abort()
await promise_rejects_dom(t, "AbortError", showPromise);
}, "Calling share consumes user activation");
}, "Calling show consumes user activation, if present");
</script>
</body>
</html>

View file

@ -45,9 +45,17 @@
pointercancel_event = event;
test_pointerEvent.step(function () {
assert_not_equals(pointerdown_event, null, "pointerdown was received: ");
assert_equals(event.pointerId, pointerdown_event.pointerId, "pointerId should be the same for pointerdown and pointercancel");
assert_equals(event.pointerType, pointerdown_event.pointerType, "pointerType should be the same for pointerdown and pointercancel");
assert_equals(event.isPrimary, pointerdown_event.isPrimary, "isPrimary should be the same for pointerdown and pointercancel");
const properties = [
"pointerId", "width", "height",
"pressure", "tangentialPressure", "tiltX", "tiltY",
"twist", "altitudeAngle", "azimuthAngle",
"pointerType", "isPrimary"
];
for (let property in properties) {
assert_equals(event[property],
pointerdown_event[property],
property + " should be the same for pointerdown and pointercancel");
}
});
test_pointerEvent.step(function () {
check_PointerEvent(event);

View file

@ -93,6 +93,12 @@ function check_PointerEvent(event, testNamePrefix) {
let expected = (event.type != 'pointerenter' && event.type != 'pointerleave');
assert_equals(event.bubbles, expected);
}, pointerTestName + ".bubbles value is valid");
test(function () {
let cancelable_events = [
'pointerdown', 'pointermove', 'pointerup', 'pointerover', 'pointerout'
];
assert_equals(event.cancelable, cancelable_events.includes(event.type));
}, pointerTestName + ".cancelable value is valid");
// Check the pressure value.
// https://w3c.github.io/pointerevents/#dom-pointerevent-pressure

View file

@ -30,6 +30,22 @@ network_error_entry_test('/common/dummy.xml', {cache: 'only-if-cached', mode: 's
network_error_entry_test(
`/element-timing/resources/multiple-redirects.py?redirect_count=22&final_resource=${validXmlUrl}`,
null, "too many redirects");
// ORB (https://github.com/whatwg/fetch/pull/1442) will return network errors
// for certain cross-origin fetches. This tests that the same rules apply to
// these fetches. Since ORB (at least as presently implemented) doesn't return
// network errors for fetches, we have to load this case using an <img> element.
//
// This emulates a case previously tested in service-workers/service-worker/resource-timing.sub.https.html
const orb_loader = (url, _) => new Promise(resolve => {
const img = document.createElement("img");
img.src = url;
img.onerror = resolve;
document.body.appendChild(img);
} );
network_error_entry_test(
'//{{hosts[alt][]}}:{{ports[https][0]}}/service-workers/service-worker/resources/missing.jpg',
null, "network error for ORB-blocked response", orb_loader);
</script>
</body>
</html>

View file

@ -488,11 +488,13 @@ const attribute_test_with_validator = (loader, path, validator, run_test, test_l
attribute_test_internal(loader, path, validator, run_test, test_label);
};
const network_error_entry_test = (originalURL, args, label) => {
const network_error_entry_test = (originalURL, args, label, loader) => {
const url = new URL(originalURL, location.href);
const search = new URLSearchParams(url.search.substr(1));
const timeBefore = performance.now();
loader = () => new Promise(resolve => fetch(url, args).catch(resolve));
// Load using `fetch()`, unless we're given a specific loader for this test.
loader ??= () => new Promise(resolve => fetch(url, args).catch(resolve));
attribute_test(
loader, url,

View file

@ -7,20 +7,24 @@
</head>
<style type="text/css">
@keyframes stroke {
from { stroke: blue; }
to { stroke: green; }
from { stroke: rgb(0, 0, 254); }
to { stroke: rgb(0, 128, 0); }
}
#line {
animation: stroke steps(2, jump-none) both;
animation: stroke auto linear both;
animation-timeline: view();
animation-range: exit-crossing entry-crossing;
animation-range: exit-crossing;
}
.spacer {
height: 100vh;
}
</style>
<body>
<svg width="100" height="3000" stroke="red" stroke-width="5">
<path id="line" d="M 50 0 V 3000"></path>
</svg>
<div class="spacer"></div>
</body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
@ -31,10 +35,11 @@
const target = document.getElementById('line');
const anim = target.getAnimations()[0];
await anim.ready;
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 0, 255)');
scroller.scrollTop = 2000;
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 0, 254)');
scroller.scrollTop =
0.5*(scroller.scrollHeight - scroller.clientHeight);
await waitForNextFrame();
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 128, 0)');
assert_equals(getComputedStyle(target).stroke, 'rgb(0, 64, 127)');
}, 'View timeline attached to SVG graphics element');
</script>
</html>

View file

@ -114,9 +114,9 @@ promise_test(async (t) => {
});
verify({
performance: performance,
resource: 'resources/missing.jpg',
resource: 'resources/missing.asis', // ORB-compatible 404 response.
mode: 'cross-origin',
description: 'Network fallback cross-origin load failure',
description: 'Network fallback cross-origin load failure (404 response)',
});
// Tests for respondWith(fetch()).
verify({

View file

@ -0,0 +1,4 @@
HTTP/1.1 404 Not Found
Content-Type: text/javascript
alert("hello");

View file

@ -5,6 +5,6 @@
<img src="square.png">
<img src="https://{{hosts[alt][]}}:{{ports[https][0]}}/service-workers/service-worker/resources/square.png">
<img src="missing.jpg">
<img src="https://{{hosts[alt][]}}:{{ports[https][0]}}/service-workers/service-worker/resources/missing.jpg">
<img src="https://{{hosts[alt][]}}:{{ports[https][0]}}/service-workers/service-worker/resources/missing.asis">
<img src='missing.jpg?SWRespondsWithFetch'>
<script src='empty-worker.js'></script>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<script type="module">
let a = new ReadableStream();
let b = self.open()
let f = new b.WritableStream();
a.pipeThrough(
{ "readable": a, "writable": f },
{ "signal": AbortSignal.abort() }
)
await new Promise(setTimeout);
structuredClone(undefined, { "transfer": [f] })
</script>

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