forked from LadybirdBrowser/ladybird
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Import all WPT css/css-nesting tests
A few are skipped for now: - A few ref tests fail - Crash tests are not supported by our runner and time out - top-level-is-scope.html crashes and needs further investigation
- Loading branch information
1 parent
7a958ec
commit 0494bf3
Showing
62 changed files
with
2,098 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
Tests/LibWeb/Ref/expected/wpt-import/css/css-nesting/conditional-properties-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<title>Properties in nested conditional rules</title> | ||
<link rel="author" title="Adam Argyle" href="mailto:argyle@google.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/"> | ||
<style> | ||
.test { | ||
background-color: red; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
@media (min-width: 50px) { | ||
.test-5 > div { | ||
background-color: green; | ||
} | ||
} | ||
|
||
@supports (display: grid) { | ||
.test-10 { | ||
background-color: green; | ||
} | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test test-5"><div></div></div> | ||
<div class="test test-10"><div></div></div> | ||
</body> |
64 changes: 64 additions & 0 deletions
64
Tests/LibWeb/Ref/expected/wpt-import/css/css-nesting/conditional-rules-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE html> | ||
<title>Conditional rules with nesting</title> | ||
<link rel="author" title="Adam Argyle" href="mailto:argyle@google.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/"> | ||
<style> | ||
.test { | ||
background-color: red; | ||
width: 30px; | ||
height: 30px; | ||
display: grid; | ||
} | ||
|
||
@media (min-width: 10px) { | ||
.test-5 > div { | ||
background-color: green; | ||
} | ||
} | ||
|
||
@media (min-width: 10px) { | ||
.test-6 > div { | ||
background-color: green; | ||
} | ||
} | ||
|
||
@supports (display: grid) { | ||
.test-10 { | ||
background-color: green; | ||
} | ||
} | ||
|
||
@layer { | ||
.test-11 { | ||
background-color: green !important; | ||
} | ||
} | ||
|
||
@scope (.test-12) { | ||
:scope { | ||
background-color: green; | ||
} | ||
} | ||
|
||
div { | ||
container-type: inline-size; | ||
} | ||
@container (width >= 0px) { | ||
.test-13 { | ||
background-color: green; | ||
} | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test test-5"><div></div></div> | ||
<div class="test test-6"><div></div></div> | ||
<div class="test test-10"><div></div></div> | ||
<div class="test test-11"><div></div></div> | ||
<div class="test"><div class="test-12"></div></div> | ||
<div class="test"><div class="test-13"></div></div> | ||
</body> |
8 changes: 8 additions & 0 deletions
8
Tests/LibWeb/Ref/expected/wpt-import/css/css-nesting/has-nesting-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!doctype html> | ||
<title>Nested has shouldn't match</title> | ||
<style> | ||
ul { background: green } | ||
</style> | ||
<ul> | ||
<li>Bar</li> | ||
</ul> |
27 changes: 27 additions & 0 deletions
27
Tests/LibWeb/Ref/expected/wpt-import/css/css-nesting/implicit-nesting-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<title>Implicit nesting</title> | ||
<link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org"> | ||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/"> | ||
<style> | ||
.test { | ||
background-color: green; | ||
width: 30px; | ||
height: 30px; | ||
display: grid; | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
</body> |
19 changes: 19 additions & 0 deletions
19
Tests/LibWeb/Ref/expected/wpt-import/css/css-nesting/nest-containing-forgiving-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<title>Nest-containing in forgiving parsing</title> | ||
<style> | ||
.test { | ||
background-color: green; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
</body> |
5 changes: 5 additions & 0 deletions
5
Tests/LibWeb/Ref/expected/wpt-import/css/css-nesting/supports-is-consistent-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!DOCTYPE html> | ||
<title>@supports needs to be consistent with actual nesting support</title> | ||
<body> | ||
<p>Test passes if this text is not red</p> | ||
</body> |
23 changes: 23 additions & 0 deletions
23
Tests/LibWeb/Ref/expected/wpt-import/css/css-nesting/supports-rule-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<title>@supports with nesting</title> | ||
<link rel="author" title="Matthieu Dubet" href="mailto:m_dubet@apple.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/"> | ||
<style> | ||
.test { | ||
background-color: green; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
<div class="test"></div> | ||
</body> |
4 changes: 4 additions & 0 deletions
4
Tests/LibWeb/Ref/expected/wpt-import/css/reference/ref-filled-green-100px-square-only.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> | ||
<p>Test passes if there is a filled green square.</p> | ||
<div style="width:100px; height:100px; background:green;"></div> |
34 changes: 34 additions & 0 deletions
34
Tests/LibWeb/Ref/input/wpt-import/css/css-nesting/conditional-properties.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<title>Properties in nested conditional rules</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/conditional-properties-ref.html"> | ||
<style> | ||
.test { | ||
background-color: red; | ||
width: 100px; | ||
height: 100px; | ||
display: grid; | ||
} | ||
|
||
.test-5 { | ||
@media (min-width: 50px) { | ||
background-color: green; | ||
} | ||
} | ||
|
||
.test-10 { | ||
@supports (display: grid) { | ||
background-color: green; | ||
} | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test test-5"><div></div></div> | ||
<div class="test test-10"><div></div></div> | ||
</body> |
75 changes: 75 additions & 0 deletions
75
Tests/LibWeb/Ref/input/wpt-import/css/css-nesting/conditional-rules.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!DOCTYPE html> | ||
<title>Conditional rules with 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/conditional-rules-ref.html"> | ||
<style> | ||
.test { | ||
background-color: red; | ||
width: 30px; | ||
height: 30px; | ||
display: grid; | ||
} | ||
|
||
.test-5 { | ||
@media (min-width: 10px) { | ||
& { | ||
background-color: green; | ||
} | ||
} | ||
} | ||
|
||
.test-6 { | ||
@media (min-width: 10px) { | ||
background-color: green; | ||
} | ||
} | ||
|
||
.test-10 { | ||
@supports (display: grid) { | ||
& { | ||
background-color: green; | ||
} | ||
} | ||
} | ||
|
||
.test-11 { | ||
@layer { | ||
& { | ||
background-color: green !important; | ||
} | ||
} | ||
} | ||
|
||
.test-12 { | ||
@scope (&) { | ||
:scope { | ||
background-color: green; | ||
} | ||
} | ||
} | ||
|
||
div { | ||
container-type: inline-size; | ||
} | ||
.test-13 { | ||
@container (width >= 0px) { | ||
& { | ||
background-color: green; | ||
} | ||
} | ||
} | ||
|
||
body * + * { | ||
margin-top: 8px; | ||
} | ||
</style> | ||
<body> | ||
<p>Tests pass if <strong>block is green</strong></p> | ||
<div class="test test-5"></div> | ||
<div class="test test-6"></div> | ||
<div class="test test-10"></div> | ||
<div class="test test-11"></div> | ||
<div class="test test-12"><div class="test-12"></div></div> | ||
<div class="test"><div class="test-13"></div></div> | ||
</body> |
21 changes: 21 additions & 0 deletions
21
Tests/LibWeb/Ref/input/wpt-import/css/css-nesting/has-nesting.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!doctype html> | ||
<title>Nested has shouldn't match</title> | ||
<link rel="help" href="https://drafts.csswg.org/selectors/#relational"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1864647"> | ||
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/9600"> | ||
<link rel="match" href="../../../../expected/wpt-import/css/css-nesting/has-nesting-ref.html"> | ||
<style> | ||
ul { background: green } | ||
|
||
li:has(strong) { | ||
display: none; | ||
|
||
:has(> &) { | ||
background: red; | ||
} | ||
} | ||
</style> | ||
<ul> | ||
<li><strong>Foo</strong></li> | ||
<li>Bar</li> | ||
</ul> |
23 changes: 23 additions & 0 deletions
23
Tests/LibWeb/Ref/input/wpt-import/css/css-nesting/host-nesting-001.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>:host and nesting (basic) </title> | ||
<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://drafts.csswg.org/css-nesting/#nest-selector"> | ||
<link rel="match" href="../../../../expected/wpt-import//css/reference/ref-filled-green-100px-square-only.html"> | ||
<p>Test passes if there is a filled green square.</p> | ||
<div id="host"></div> | ||
<script> | ||
host.attachShadow({mode: "open"}).innerHTML = ` | ||
<style> | ||
:host { | ||
.nested { | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
<div class="nested"></div> | ||
`; | ||
</script> |
22 changes: 22 additions & 0 deletions
22
Tests/LibWeb/Ref/input/wpt-import/css/css-nesting/host-nesting-002.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>:host and nesting (bare declarations)</title> | ||
<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://drafts.csswg.org/css-nesting/#nest-selector"> | ||
<link rel="match" href="../../../../expected/wpt-import//css/reference/ref-filled-green-100px-square-only.html"> | ||
<p>Test passes if there is a filled green square.</p> | ||
<div id="host"></div> | ||
<script> | ||
host.attachShadow({mode: "open"}).innerHTML = ` | ||
<style> | ||
:host { | ||
@media (width >= 0) { | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
} | ||
</style> | ||
`; | ||
</script> |
26 changes: 26 additions & 0 deletions
26
Tests/LibWeb/Ref/input/wpt-import/css/css-nesting/host-nesting-003.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>:host and nesting (combined with something else)</title> | ||
<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://drafts.csswg.org/css-nesting/#nest-selector"> | ||
<link rel="match" href="../../../../expected/wpt-import//css/reference/ref-filled-green-100px-square-only.html"> | ||
<p>Test passes if there is a filled green square.</p> | ||
<div id="host"></div> | ||
<script> | ||
host.attachShadow({mode: "open"}).innerHTML = ` | ||
<style> | ||
.nested { | ||
width: 100px; | ||
height: 100px; | ||
background-color: green; | ||
} | ||
:host(#not-host), #host { | ||
.nested { | ||
background-color: red; | ||
} | ||
} | ||
</style> | ||
<div class="nested"></div> | ||
`; | ||
</script> |
Oops, something went wrong.