Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'

This commit is contained in:
WPT Sync Bot 2021-09-07 11:16:33 +00:00 committed by cybai
parent 35e95f55a1
commit 58e8ee674b
9438 changed files with 266112 additions and 106976 deletions

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Test parsing of the host-context() pseudo-classes</title>
<link rel="help" href="https://drafts.csswg.org/css-scoping/#selectordef-host-context">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
test_valid_selector(':host-context(.a)');
test_valid_selector(':host-context(div.a)');
test_invalid_selector(':host-context');
test_invalid_selector(':host-context()');
test_invalid_selector(':host-context(.a, .b)');
test_invalid_selector(':host-context(.a + .b)');
test_invalid_selector(':host-context(.a + .b, #c > #d)');
</script>

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<title>Test parsing of the :host/host() pseudo-classes</title>
<link rel="help" href="https://drafts.csswg.org/css-scoping/#selectordef-host-function">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/parsing-testcommon.js"></script>
<script>
test_valid_selector(':host');
test_valid_selector(':host(.a)');
test_valid_selector(':host(div.a)');
test_invalid_selector(':host()');
test_invalid_selector(':host(.a, .b)');
test_invalid_selector(':host(.a + .b)');
test_invalid_selector(':host(.a + .b, #c > #d)');
</script>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Shared style invalidation with removals</title>
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1707116">
<link rel="help" href="https://drafts.csswg.org/css-scoping/">
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="host-1"></div>
<div id="host-2"></div>
<script>
const INITIALLY_COMMON_STYLE = `<style>:host { background-color: red !important }</style>`;
let helper = document.querySelector("#host-1");
let host = document.querySelector("#host-2");
test(function() {
helper.attachShadow({ mode: "open" }).innerHTML = INITIALLY_COMMON_STYLE;
assert_equals(getComputedStyle(helper).backgroundColor, "rgb(255, 0, 0)", "Common style should apply to helper");
host.attachShadow({ mode: "open" }).innerHTML = INITIALLY_COMMON_STYLE;
assert_equals(getComputedStyle(host).backgroundColor, "rgb(255, 0, 0)", "Common style should apply to host");
host.shadowRoot.innerHTML = `<style>:host { background-color: lime; width: 100px; height: 100px; }</style>`;
assert_equals(getComputedStyle(host).backgroundColor, "rgb(0, 255, 0)", "Common style should no longer apply to host");
});
</script>

View file

@ -17,10 +17,6 @@
test_invalid_selector("::slotted(*):host");
test_invalid_selector("::slotted(*):host(div)");
test_invalid_selector("::slotted(*):hover");
test_invalid_selector("::slotted(*):is(:hover)");
test_invalid_selector("::slotted(*):where(:hover)");
test_invalid_selector("::slotted(*):is(#id)");
test_invalid_selector("::slotted(*):where(#id)");
test_invalid_selector("::slotted(*):read-only");
test_invalid_selector("::slotted(*)::slotted(*)");
test_invalid_selector("::slotted(*)::before::slotted(*)");
@ -31,6 +27,14 @@
test_valid_selector("::slotted([attr]:hover)");
test_valid_selector("::slotted(:not(.a))");
test_valid_selector("::slotted(*):is()");
test_valid_selector("::slotted(*):is(:hover)", "::slotted(*):is()");
test_valid_selector("::slotted(*):is(#id)", "::slotted(*):is()");
test_valid_selector("::slotted(*):where()");
test_valid_selector("::slotted(*):where(:hover)", "::slotted(*):where()");
test_valid_selector("::slotted(*):where(#id)", "::slotted(*):where()");
// Allow tree-abiding pseudo elements after ::slotted
test_valid_selector("::slotted(*)::before");
test_valid_selector("::slotted(*)::after");

View file

@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: slotted selectors are compared correctly for specificity</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo">
<link rel="help" href="https://bugs.webkit.org/show_bug.cgi?id=229438">
<link rel="match" href="reference/green-box.html">
<p>Test passes if you see a single 100px by 100px green box below.</p>
<div id="host"><div></div></div>
<script>
host.attachShadow({ mode: 'open' }).innerHTML = `
<style>
:host ::slotted(*) {
width: 100px;
height: 100px;
background: green;
}
::slotted(*) {
background: red;
}
</style>
<slot></slot>
`;
</script>