Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speculativly test :has-slotted() #47587

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions css/css-scoping/has-slotted-001.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(*)</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
keithamus marked this conversation as resolved.
Show resolved Hide resolved
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted(*) {
background-color: green;
}
</style>
<slot></slot>
</template>
<div></div>
</div>
21 changes: 21 additions & 0 deletions css/css-scoping/has-slotted-002.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(...) negative test: no children or white space</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host"><template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
:has-slotted(*),
:has-slotted {
background-color: red;
}
</style>
<slot></slot>
</template></div>
22 changes: 22 additions & 0 deletions css/css-scoping/has-slotted-003.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(...) negative test: no children, but whitespace present</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
:has-slotted(*) {
background-color: red;
}
</style>
<slot></slot>
</template>
</div>
23 changes: 23 additions & 0 deletions css/css-scoping/has-slotted-004.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(.class)</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted(.slotted-element) {
background-color: green;
}
</style>
<slot></slot>
</template>
<div class="slotted-element"></div>
</div>
23 changes: 23 additions & 0 deletions css/css-scoping/has-slotted-005.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(.class) negative test</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
:has-slotted(.not-slotted-element) {
background-color: red;
}
</style>
<slot></slot>
</template>
<div class="slotted-element"></div>
</div>
25 changes: 25 additions & 0 deletions css/css-scoping/has-slotted-006.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(el) + :has-slotted(el)</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
[name] {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted(div) + :has-slotted(div) {
background-color: green;
}
</style>
<slot></slot>
<slot name="after"></slot>
</template>
<div></div>
<div slot="after"></div>
</div>
22 changes: 22 additions & 0 deletions css/css-scoping/has-slotted-007.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted {
background-color: green;
}
</style>
<slot></slot>
</template>
</div>
28 changes: 28 additions & 0 deletions css/css-scoping/has-slotted-flattened-001.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(*) flattened through multiple slots</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="ancestor">
<template shadowrootmode="open">
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted(*) {
background-color: green;
}
</style>
<slot></slot>
</template>
<slot></slot>
</div>
</template>
<div></div>
</div>
23 changes: 23 additions & 0 deletions css/css-scoping/has-slotted-flattened-002.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(...) negative test: no children or white space</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="ancestor"><template shadowrootmode="open">
<div id="host"><template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
:has-slotted(*),
:has-slotted {
background-color: red;
}
</style>
<slot></slot>
</template><slot></slot></div>
</template></div>
27 changes: 27 additions & 0 deletions css/css-scoping/has-slotted-flattened-003.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(...) flatted through multiple slots, negative test: no children, but whitespace present</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="ancestor">
<template shadowrootmode="open">
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
:has-slotted(*) {
background-color: red;
}
</style>
<slot></slot>
</template>
</div>
<slot></slot>
</template>
</div>
28 changes: 28 additions & 0 deletions css/css-scoping/has-slotted-flattened-004.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(.class) flattened through multiple slots</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="ancestor">
<template shadowrootmode="open">
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted(.slotted-element) {
background-color: green;
}
</style>
<slot></slot>
</template>
<slot></slot>
</div>
</template>
<div class="slotted-element"></div>
</div>
28 changes: 28 additions & 0 deletions css/css-scoping/has-slotted-flattened-005.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(.class) flattened through multiple slots, negative test</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="ancestor">
<template shadowrootmode="open">
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
:has-slotted(.not-slotted-element) {
background-color: red;
}
</style>
<slot></slot>
</template>
<slot></slot>
</div>
</template>
<div class="slotted-element"></div>
</div>
31 changes: 31 additions & 0 deletions css/css-scoping/has-slotted-flattened-006.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted(el) + :has-slotted(el) flattened through multiple slots</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="ancestor">
<template shadowrootmode="open">
<div id="host">
<template shadowrootmode="open">
<style>
[name] {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted(div) + :has-slotted(div) {
background-color: green;
}
</style>
<slot></slot>
<slot name="after"></slot>
</template>
<slot></slot>
<slot name="after" slot="after"></slot>
</div>
</template>
<div></div>
<div slot="after"></div>
</div>
24 changes: 24 additions & 0 deletions css/css-scoping/has-slotted-flattened-007.tentative.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted flattened through multiple slots</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="ancestor">
<template shadowrootmode="open">
<div id="host"><template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
:has-slotted {
background-color: green;
}
</style>
<slot></slot>
</template><slot></slot></div>
</template>
</div>
Loading