mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-20 00:08:55 +00:00
Tests: Import a couple of CSS nesting tests from WPT
This is partly to check that importing ref tests works, and that I didn't break the text-test import.
This commit is contained in:
parent
7a5b38d577
commit
f5d67cefc1
Notes:
github-actions[bot]
2024-11-05 17:59:20 +00:00
Author: https://github.com/AtkinsSJ
Commit: f5d67cefc1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2179
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 353 additions and 0 deletions
|
@ -0,0 +1,112 @@
|
|||
<!DOCTYPE html>
|
||||
<title>Basic nesting</title>
|
||||
<link rel="author" title="Adam Argyle" href="mailto:argyle@google.com">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/">
|
||||
<link rel="match" href="../../../../expected/wpt-import/css/css-nesting/nesting-basic-ref.html">
|
||||
<style>
|
||||
.test {
|
||||
background-color: red;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.test-1 {
|
||||
& > div {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
|
||||
.test-2 {
|
||||
& > div {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
|
||||
.test-3 {
|
||||
& .test-3-child {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
|
||||
span > b {
|
||||
.test-4 section & {
|
||||
display: inline-block;
|
||||
background-color: green;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.test-4 section > & {
|
||||
background-color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.test-6 {
|
||||
&.test {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
|
||||
.test-7, .t7- {
|
||||
& + .test-7-child, &.t7-- {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
|
||||
.test-8 {
|
||||
& {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
|
||||
.test-9 {
|
||||
&:is(.t9-, &.t9--) {
|
||||
background-color: green;
|
||||
}
|
||||
}
|
||||
|
||||
.test-10 {
|
||||
& {
|
||||
background-color: red;
|
||||
}
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.test-11 {
|
||||
& {
|
||||
background-color: red;
|
||||
}
|
||||
background-color: green !important;
|
||||
}
|
||||
|
||||
/* & at top level counts as :scope, i.e. the root element here */
|
||||
& .test-12 {
|
||||
background-color: green;
|
||||
}
|
||||
& > .test-12 {
|
||||
background-color: red !important;
|
||||
}
|
||||
|
||||
body * + * {
|
||||
margin-top: 8px;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<p>Tests pass if <strong>block is green</strong></p>
|
||||
<div class="test test-1"><div></div></div>
|
||||
<div class="test test-2"><div></div></div>
|
||||
<div class="test test-3"><div class="test-3-child"></div></div>
|
||||
<div class="test test-4">
|
||||
<section>
|
||||
<span><b></b></span>
|
||||
</section>
|
||||
</div>
|
||||
<div class="test test-6"><div></div></div>
|
||||
<div class="test t7- t7--"><div class="test-7-child"></div></div>
|
||||
<div class="test test-8"><div></div></div>
|
||||
<div class="test test-9 t9-- t9-"><div></div></div>
|
||||
<div class="test test-10"><div></div></div>
|
||||
<div class="test test-11"><div></div></div>
|
||||
<div class="test test-12"></div>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue