From 5202ae26e01ab7b0e5f0f7a8800b6777337f171b Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Fri, 24 Jan 2025 18:57:32 +0100 Subject: [PATCH] LibWeb: Import WPT tests for :nth-child and :nth-last-child invalidation --- .../nth-child-containing-ancestor-ref.html | 12 + .../nth-child-of-attr-largedom-ref.html | 452 +++++++++++++++++ .../invalidation/nth-child-of-attr-ref.html | 15 + .../invalidation/nth-child-of-class-ref.html | 15 + .../invalidation/nth-child-of-has-ref.html | 15 + .../nth-child-of-in-ancestor-ref.html | 13 + .../nth-child-of-pseudo-class-ref.html | 13 + .../nth-child-of-sibling-ref.html | 15 + .../nth-child-when-ancestor-changes-ref.html | 13 + .../nth-child-when-sibling-changes-ref.html | 14 + .../nth-child-containing-ancestor.html | 22 + .../nth-child-of-attr-largedom.html | 462 ++++++++++++++++++ .../invalidation/nth-child-of-attr.html | 25 + .../invalidation/nth-child-of-class.html | 25 + .../invalidation/nth-child-of-has.html | 25 + .../invalidation/nth-child-of-id-prefix.html | 25 + .../invalidation/nth-child-of-ids.html | 25 + .../nth-child-of-in-ancestor.html | 23 + .../invalidation/nth-child-of-in-is.html | 25 + .../invalidation/nth-child-of-is.html | 25 + .../nth-child-of-pseudo-class.html | 31 ++ .../invalidation/nth-child-of-sibling.html | 25 + .../nth-child-when-ancestor-changes.html | 23 + .../nth-child-when-sibling-changes.html | 24 + 24 files changed, 1362 insertions(+) create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-class-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-has-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-sibling-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes-ref.html create mode 100644 Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes-ref.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-class.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-has.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-id-prefix.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-ids.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-is.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-is.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-sibling.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes.html create mode 100644 Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes.html diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor-ref.html new file mode 100644 index 00000000000..6e6680d8c3f --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor-ref.html @@ -0,0 +1,12 @@ + + +CSS Selectors Invalidation: :nth-child(... of S) with ancestor in S + + +
+
+
+
Should be green
+
+
+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html new file mode 100644 index 00000000000..7e42dd156b3 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom-ref.html @@ -0,0 +1,452 @@ + + +CSS Selectors Invalidation: :nth-child(... of attribute) with a large DOM + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#
2
3
4
5
7
10
12
19
28
29
35
37
43
45
51
52
57
61
68
70
75
78
84
90
101
102
106
113
114
115
116
117
118
120
129
133
134
137
138
141
142
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-ref.html new file mode 100644 index 00000000000..5207cc987d1 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-attr-ref.html @@ -0,0 +1,15 @@ + + +CSS Selectors Invalidation: :nth-child(... of attribute) + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-class-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-class-ref.html new file mode 100644 index 00000000000..d4e2dfb71d9 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-class-ref.html @@ -0,0 +1,15 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-has-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-has-ref.html new file mode 100644 index 00000000000..39f0501b826 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-has-ref.html @@ -0,0 +1,15 @@ + + +CSS Selectors Invalidation: :nth-child(... of :has(...)) + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor-ref.html new file mode 100644 index 00000000000..bc7ecb9ff7c --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor-ref.html @@ -0,0 +1,13 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) as ancestor + + +
+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class-ref.html new file mode 100644 index 00000000000..b06f47aafa3 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class-ref.html @@ -0,0 +1,13 @@ + + +CSS Test Reference +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-sibling-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-sibling-ref.html new file mode 100644 index 00000000000..ed7fefc59fe --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-of-sibling-ref.html @@ -0,0 +1,15 @@ + + +CSS Selectors Invalidation: :nth-child(... of sibling) + + +
+

Ignored

+

Ignored

+

Selectively ignored

+

Ignored

+

Not ignored

+

Ignored

+

Not ignored

+

Ignored

+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes-ref.html new file mode 100644 index 00000000000..7e3f7f0c98a --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes-ref.html @@ -0,0 +1,13 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) when ancestor changes + + +
+

Ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
diff --git a/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes-ref.html b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes-ref.html new file mode 100644 index 00000000000..f30a853cae7 --- /dev/null +++ b/Tests/LibWeb/Ref/expected/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes-ref.html @@ -0,0 +1,14 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) when sibling changes + + +
+

Ignored

+

Odd; used to be green, should not be since no sibling

+

Even, so should not be green

+

Odd, but no sibling, so should not be green

+

Even, so should not be green

+

Ignored

+

Odd, should be green

+
diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor.html new file mode 100644 index 00000000000..d282925f3d4 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-containing-ancestor.html @@ -0,0 +1,22 @@ + + +CSS Selectors Invalidation: :nth-child(... of S) with ancestor in S + + + + +
+
+
+
Should be green
+
+
+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom.html new file mode 100644 index 00000000000..ccc9a7efc5d --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr-largedom.html @@ -0,0 +1,462 @@ + + +CSS Selectors Invalidation: :nth-child(... of attribute) with a large DOM + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#
2
3
4
5
7
10
12
19
28
29
35
37
43
45
51
52
57
61
68
70
75
78
84
90
101
102
106
113
114
115
116
117
118
120
129
133
134
137
138
141
142
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr.html new file mode 100644 index 00000000000..fae2dfb5abf --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-attr.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :nth-child(... of attribute) + + + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-class.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-class.html new file mode 100644 index 00000000000..308d8b43c1d --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-class.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) + + + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-has.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-has.html new file mode 100644 index 00000000000..a5ecaf3a9fc --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-has.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :nth-child(... of :has(...)) + + + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-id-prefix.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-id-prefix.html new file mode 100644 index 00000000000..59f3662167d --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-id-prefix.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :nth-child(... of ID prefix) + + + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-ids.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-ids.html new file mode 100644 index 00000000000..e2ef49f7d9b --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-ids.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :nth-child(... of IDs) + + + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor.html new file mode 100644 index 00000000000..1c441e66e71 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-ancestor.html @@ -0,0 +1,23 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) as ancestor + + + + +
+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-is.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-is.html new file mode 100644 index 00000000000..64e3a317045 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-in-is.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :is(:nth-child(... of class)) + + + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-is.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-is.html new file mode 100644 index 00000000000..40b24249531 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-is.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :nth-child(... of :is) + + + + +
+

Ignored

+

Ignored

+

Not ignored

+

Selectively ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class.html new file mode 100644 index 00000000000..34419363271 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-pseudo-class.html @@ -0,0 +1,31 @@ + + +CSS Selectors Invalidation: :nth-child(... of pseudo-class) + + + + +
+ Ignored + Ignored +

Not ignored

+ Selectively ignored +

Not ignored

+

Not ignored

+

Not ignored

+ Ignored +
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-sibling.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-sibling.html new file mode 100644 index 00000000000..80ee1b99fbc --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-of-sibling.html @@ -0,0 +1,25 @@ + + +CSS Selectors Invalidation: :nth-child(... of sibling) + + + + +
+

Ignored

+

Ignored

+

Selectively ignored

+

Ignored

+

Not ignored

+

Ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes.html new file mode 100644 index 00000000000..a1bfeb26cff --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-ancestor-changes.html @@ -0,0 +1,23 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) when ancestor changes + + + + +
+

Ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Not ignored

+

Ignored

+
+ diff --git a/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes.html b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes.html new file mode 100644 index 00000000000..699c3b31980 --- /dev/null +++ b/Tests/LibWeb/Ref/input/wpt-import/css/selectors/invalidation/nth-child-when-sibling-changes.html @@ -0,0 +1,24 @@ + + +CSS Selectors Invalidation: :nth-child(... of class) when sibling changes + + + + +
+

Ignored

+

Odd; used to be green, should not be since no sibling

+

Even, so should not be green

+

Odd, but no sibling, so should not be green

+

Even, so should not be green

+

Ignored

+

Odd, should be green

+
+