diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-argument-with-explicit-scope.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-argument-with-explicit-scope.txt
new file mode 100644
index 00000000000..d0f3f773269
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-argument-with-explicit-scope.txt
@@ -0,0 +1,24 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 13 tests
+
+12 Pass
+1 Fail
+Details
+Result Test Name MessagePass :has(:scope) matches expected elements on scope1
+Pass :has(:scope .c) matches expected elements on scope1
+Pass :has(.a :scope) matches expected elements on scope1
+Fail .a:has(:scope) .c matches expected elements on scope1 assert_equals: expected "d02,d03" but got ""
+Pass .a:has(:scope) .c and :is(.a :scope .c) returns same elements on scope1
+Pass .a:has(:scope) .c matches expected elements on scope2
+Pass .a:has(:scope) .c and :is(.a :scope .c) returns same elements on scope2
+Pass .c:has(:is(:scope .d)) matches expected elements on scope1
+Pass .c:has(:is(:scope .d)) and :scope .c:has(.d) returns same elements on scope1
+Pass .c:has(:is(:scope .d)) and .c:has(.d) returns same elements on scope1
+Pass .c:has(:is(:scope .d)) matches expected elements on scope2
+Pass .c:has(:is(:scope .d)) and :scope .c:has(.d) returns same elements on scope2
+Pass .c:has(:is(:scope .d)) and .c:has(.d) returns same elements on scope2
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-basic.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-basic.txt
new file mode 100644
index 00000000000..31172efbb67
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-basic.txt
@@ -0,0 +1,28 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 18 tests
+
+18 Pass
+Details
+Result Test Name MessagePass :has(#a) matches expected elements
+Pass :has(.ancestor) matches expected elements
+Pass :has(.target) matches expected elements
+Pass :has(.descendant) matches expected elements
+Pass .parent:has(.target) matches expected elements
+Pass :has(.sibling ~ .target) matches expected elements
+Pass .parent:has(.sibling ~ .target) matches expected elements
+Pass :has(:is(.target ~ .sibling .descendant)) matches expected elements
+Pass .parent:has(:is(.target ~ .sibling .descendant)) matches expected elements
+Pass .sibling:has(.descendant) ~ .target matches expected elements
+Pass :has(> .parent) matches expected elements
+Pass :has(> .target) matches expected elements
+Pass :has(> .parent, > .target) matches expected elements
+Pass :has(+ #h) matches expected elements
+Pass .parent:has(~ #h) matches expected elements
+Pass .sibling:has(.descendant) matches expected element
+Pass closest(.ancestor:has(.descendant)) returns expected element
+Pass :has(.target ~ .sibling .descendant) matches expectedly
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-matches-to-uninserted-elements.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-matches-to-uninserted-elements.txt
new file mode 100644
index 00000000000..9d62965a50e
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-matches-to-uninserted-elements.txt
@@ -0,0 +1,22 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 12 tests
+
+12 Pass
+Details
+Result Test Name MessagePass :has(child) matches expectedly
+Pass :has(> child) matches expectedly
+Pass :has(descendant) matches expectedly
+Pass :has(> descendant) matches expectedly
+Pass :has(~ direct_sibling) matches expectedly
+Pass :has(+ direct_sibling) matches expectedly
+Pass :has(~ indirect_sibling) matches expectedly
+Pass :has(+ indirect_sibling) matches expectedly
+Pass :has(*) matches expectedly
+Pass :has(> *) matches expectedly
+Pass :has(~ *) matches expectedly
+Pass :has(+ *) matches expectedly
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-relative-argument.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-relative-argument.txt
new file mode 100644
index 00000000000..f3ca85257a9
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-relative-argument.txt
@@ -0,0 +1,45 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 35 tests
+
+35 Pass
+Details
+Result Test Name MessagePass .x:has(.a) matches expected elements
+Pass .x:has(.a > .b) matches expected elements
+Pass .x:has(.a .b) matches expected elements
+Pass .x:has(.a + .b) matches expected elements
+Pass .x:has(.a ~ .b) matches expected elements
+Pass .x:has(> .a) matches expected elements
+Pass .x:has(> .a > .b) matches expected elements
+Pass .x:has(> .a .b) matches expected elements
+Pass .x:has(> .a + .b) matches expected elements
+Pass .x:has(> .a ~ .b) matches expected elements
+Pass .x:has(+ .a) matches expected elements
+Pass .x:has(+ .a > .b) matches expected elements
+Pass .x:has(+ .a .b) matches expected elements
+Pass .x:has(+ .a + .b) matches expected elements
+Pass .x:has(+ .a ~ .b) matches expected elements
+Pass .x:has(~ .a) matches expected elements
+Pass .x:has(~ .a > .b) matches expected elements
+Pass .x:has(~ .a .b) matches expected elements
+Pass .x:has(~ .a + .b) matches expected elements
+Pass .x:has(~ .a + .b > .c) matches expected elements
+Pass .x:has(~ .a + .b .c) matches expected elements
+Pass .x:has(.d .e) matches expected elements
+Pass .x:has(.d .e) .f matches expected elements
+Pass .x:has(> .d) matches expected elements
+Pass .x:has(> .d) .f matches expected elements
+Pass .x:has(~ .d ~ .e) matches expected elements
+Pass .x:has(~ .d ~ .e) ~ .f matches expected elements
+Pass .x:has(+ .d ~ .e) matches expected elements
+Pass .x:has(+ .d ~ .e) ~ .f matches expected elements
+Pass .y:has(> .g .h) matches expected elements
+Pass .y:has(.g .h) matches expected elements
+Pass .y:has(> .g .h) .i matches expected elements
+Pass .y:has(.g .h) .i matches expected elements
+Pass .d .x:has(.e) matches expected elements
+Pass .d ~ .x:has(~ .e) matches expected elements
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-sibling-chrome-crash.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-sibling-chrome-crash.txt
new file mode 100644
index 00000000000..465701e3460
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-sibling-chrome-crash.txt
@@ -0,0 +1 @@
+PASS
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-specificity.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-specificity.txt
new file mode 100644
index 00000000000..c1b94e4e2a1
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/has-specificity.txt
@@ -0,0 +1,18 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 8 tests
+
+8 Fail
+Details
+Result Test Name MessageFail :has(#foo) wins over :has(.foo) assert_equals: expected "PASS" but got ""
+Fail :has(span#foo) wins over :has(#foo) assert_equals: expected "PASS" but got ""
+Fail :has(.bar, #foo) has same specificity as :has(#foo, .bar) assert_equals: expected "PASS" but got ""
+Fail :has(.bar, #foo) wins over :has(.foo, .bar) assert_equals: expected "PASS" but got ""
+Fail :has(span + span) wins over :has(span) assert_equals: expected "PASS" but got ""
+Fail :has(span, li, p) wins over :has(span, lo, p) assert_equals: expected "PASS" but got ""
+Fail latter .baz wins over :has(.foo) assert_equals: expected "PASS" but got ""
+Fail latter :has(.foo) wins over .baz assert_equals: expected "PASS" but got ""
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-css-nesting-shared.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-css-nesting-shared.txt
new file mode 100644
index 00000000000..38ceb4fbf6c
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-css-nesting-shared.txt
@@ -0,0 +1,22 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 12 tests
+
+12 Pass
+Details
+Result Test Name MessagePass add .test to trigger1 - check subject1_1
+Pass add .test to trigger1 - check subject1_2
+Pass remove .test from trigger1 - check subject1_1
+Pass remove .test from trigger1 - check subject1_2
+Pass add .test to trigger2 - check subject2_1
+Pass add .test to trigger2 - check subject2_2
+Pass remove .test from trigger2 - check subject2_1
+Pass remove .test from trigger2 - check subject2_2
+Pass add .test to trigger3 - check subject3_1
+Pass add .test to trigger3 - check subject3_2
+Pass remove .test from trigger3 - check subject3_1
+Pass remove .test from trigger3 - check subject3_2
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-adjacent-position.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-adjacent-position.txt
new file mode 100644
index 00000000000..e137e28f07e
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-adjacent-position.txt
@@ -0,0 +1,305 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 295 tests
+
+295 Pass
+Details
+Result Test Name MessagePass Initial color
+Pass add .test to previous_sibling
+Pass remove .test from previous_sibling
+Pass add .test to previous_sibling_child
+Pass remove .test from previous_sibling_child
+Pass add .test to previous_sibling_descendant
+Pass remove .test from previous_sibling_descendant
+Pass add .test to subject
+Pass remove .test from subject
+Pass add .test to next_sibling
+Pass remove .test from next_sibling
+Pass add .test to next_sibling_child
+Pass remove .test from next_sibling_child
+Pass add .test to next_sibling_descendant
+Pass remove .test from next_sibling_descendant
+Pass insert element div.test before previous_sibling
+Pass remove the class 'test' from the element inserted before previous_sibling
+Pass add the class 'test' again to the element inserted before previous_sibling
+Pass remove element div.test before previous_sibling
+Pass insert element div before previous_sibling
+Pass add the class 'test' to the element inserted again before previous_sibling
+Pass remove the class 'test' from the element inserted again before previous_sibling
+Pass remove element div before previous_sibling
+Pass insert element div[test_attr] before previous_sibling
+Pass remove element div[test_attr] before previous_sibling
+Pass insert element div.test before previous_sibling_child
+Pass remove the class 'test' from the element inserted before previous_sibling_child
+Pass add the class 'test' again to the element inserted before previous_sibling_child
+Pass remove element div.test before previous_sibling_child
+Pass insert element div before previous_sibling_child
+Pass add the class 'test' to the element inserted again before previous_sibling_child
+Pass remove the class 'test' from the element inserted again before previous_sibling_child
+Pass remove element div before previous_sibling_child
+Pass insert element div[test_attr] before previous_sibling_child
+Pass remove element div[test_attr] before previous_sibling_child
+Pass insert element div.test before previous_sibling_descendant
+Pass remove the class 'test' from the element inserted before previous_sibling_descendant
+Pass add the class 'test' again to the element inserted before previous_sibling_descendant
+Pass remove element div.test before previous_sibling_descendant
+Pass insert element div before previous_sibling_descendant
+Pass add the class 'test' to the element inserted again before previous_sibling_descendant
+Pass remove the class 'test' from the element inserted again before previous_sibling_descendant
+Pass remove element div before previous_sibling_descendant
+Pass insert element div[test_attr] before previous_sibling_descendant
+Pass remove element div[test_attr] before previous_sibling_descendant
+Pass insert element div.test before subject
+Pass remove the class 'test' from the element inserted before subject
+Pass add the class 'test' again to the element inserted before subject
+Pass remove element div.test before subject
+Pass insert element div before subject
+Pass add the class 'test' to the element inserted again before subject
+Pass remove the class 'test' from the element inserted again before subject
+Pass remove element div before subject
+Pass insert element div[test_attr] before subject
+Pass remove element div[test_attr] before subject
+Pass insert element div.test before next_sibling
+Pass remove the class 'test' from the element inserted before next_sibling
+Pass add the class 'test' again to the element inserted before next_sibling
+Pass remove element div.test before next_sibling
+Pass insert element div before next_sibling
+Pass add the class 'test' to the element inserted again before next_sibling
+Pass remove the class 'test' from the element inserted again before next_sibling
+Pass remove element div before next_sibling
+Pass insert element div[test_attr] before next_sibling
+Pass remove element div[test_attr] before next_sibling
+Pass insert element div.test before next_sibling_child
+Pass remove the class 'test' from the element inserted before next_sibling_child
+Pass add the class 'test' again to the element inserted before next_sibling_child
+Pass remove element div.test before next_sibling_child
+Pass insert element div before next_sibling_child
+Pass add the class 'test' to the element inserted again before next_sibling_child
+Pass remove the class 'test' from the element inserted again before next_sibling_child
+Pass remove element div before next_sibling_child
+Pass insert element div[test_attr] before next_sibling_child
+Pass remove element div[test_attr] before next_sibling_child
+Pass insert element div.test before next_sibling_descendant
+Pass remove the class 'test' from the element inserted before next_sibling_descendant
+Pass add the class 'test' again to the element inserted before next_sibling_descendant
+Pass remove element div.test before next_sibling_descendant
+Pass insert element div before next_sibling_descendant
+Pass add the class 'test' to the element inserted again before next_sibling_descendant
+Pass remove the class 'test' from the element inserted again before next_sibling_descendant
+Pass remove element div before next_sibling_descendant
+Pass insert element div[test_attr] before next_sibling_descendant
+Pass remove element div[test_attr] before next_sibling_descendant
+Pass insert element div.test after previous_sibling
+Pass remove the class 'test' from the element inserted after previous_sibling
+Pass add the class 'test' again to the element inserted after previous_sibling
+Pass remove element div.test after previous_sibling
+Pass insert element div after previous_sibling
+Pass add the class 'test' to the element inserted again after previous_sibling
+Pass remove the class 'test' from the element inserted again after previous_sibling
+Pass remove element div after previous_sibling
+Pass insert element div[test_attr] after previous_sibling
+Pass remove element div[test_attr] after previous_sibling
+Pass insert element div.test after previous_sibling_child
+Pass remove the class 'test' from the element inserted after previous_sibling_child
+Pass add the class 'test' again to the element inserted after previous_sibling_child
+Pass remove element div.test after previous_sibling_child
+Pass insert element div after previous_sibling_child
+Pass add the class 'test' to the element inserted again after previous_sibling_child
+Pass remove the class 'test' from the element inserted again after previous_sibling_child
+Pass remove element div after previous_sibling_child
+Pass insert element div[test_attr] after previous_sibling_child
+Pass remove element div[test_attr] after previous_sibling_child
+Pass insert element div.test after previous_sibling_descendant
+Pass remove the class 'test' from the element inserted after previous_sibling_descendant
+Pass add the class 'test' again to the element inserted after previous_sibling_descendant
+Pass remove element div.test after previous_sibling_descendant
+Pass insert element div after previous_sibling_descendant
+Pass add the class 'test' to the element inserted again after previous_sibling_descendant
+Pass remove the class 'test' from the element inserted again after previous_sibling_descendant
+Pass remove element div after previous_sibling_descendant
+Pass insert element div[test_attr] after previous_sibling_descendant
+Pass remove element div[test_attr] after previous_sibling_descendant
+Pass insert element div.test after subject
+Pass remove the class 'test' from the element inserted after subject
+Pass add the class 'test' again to the element inserted after subject
+Pass remove element div.test after subject
+Pass insert element div after subject
+Pass add the class 'test' to the element inserted again after subject
+Pass remove the class 'test' from the element inserted again after subject
+Pass remove element div after subject
+Pass insert element div[test_attr] after subject
+Pass remove element div[test_attr] after subject
+Pass insert element div.test after next_sibling
+Pass remove the class 'test' from the element inserted after next_sibling
+Pass add the class 'test' again to the element inserted after next_sibling
+Pass remove element div.test after next_sibling
+Pass insert element div after next_sibling
+Pass add the class 'test' to the element inserted again after next_sibling
+Pass remove the class 'test' from the element inserted again after next_sibling
+Pass remove element div after next_sibling
+Pass insert element div[test_attr] after next_sibling
+Pass remove element div[test_attr] after next_sibling
+Pass insert element div.test after next_sibling_child
+Pass remove the class 'test' from the element inserted after next_sibling_child
+Pass add the class 'test' again to the element inserted after next_sibling_child
+Pass remove element div.test after next_sibling_child
+Pass insert element div after next_sibling_child
+Pass add the class 'test' to the element inserted again after next_sibling_child
+Pass remove the class 'test' from the element inserted again after next_sibling_child
+Pass remove element div after next_sibling_child
+Pass insert element div[test_attr] after next_sibling_child
+Pass remove element div[test_attr] after next_sibling_child
+Pass insert element div.test after next_sibling_descendant
+Pass remove the class 'test' from the element inserted after next_sibling_descendant
+Pass add the class 'test' again to the element inserted after next_sibling_descendant
+Pass remove element div.test after next_sibling_descendant
+Pass insert element div after next_sibling_descendant
+Pass add the class 'test' to the element inserted again after next_sibling_descendant
+Pass remove the class 'test' from the element inserted again after next_sibling_descendant
+Pass remove element div after next_sibling_descendant
+Pass insert element div[test_attr] after next_sibling_descendant
+Pass remove element div[test_attr] after next_sibling_descendant
+Pass insert tree div>div.test before previous_sibling
+Pass remove the class 'test' from the element in the tree inserted before previous_sibling
+Pass add the class 'test' again to the element in the tree inserted before previous_sibling
+Pass remove tree div>div.test before previous_sibling
+Pass insert tree div>div before previous_sibling
+Pass add the class 'test' to the element in the tree inserted again before previous_sibling
+Pass remove the class 'test' from the element in the tree inserted again before previous_sibling
+Pass remove tree div>div before previous_sibling
+Pass insert element div>div[test_attr] before previous_sibling
+Pass remove element div>div[test_attr] before previous_sibling
+Pass insert tree div>div.test before previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted before previous_sibling_child
+Pass add the class 'test' again to the element in the tree inserted before previous_sibling_child
+Pass remove tree div>div.test before previous_sibling_child
+Pass insert tree div>div before previous_sibling_child
+Pass add the class 'test' to the element in the tree inserted again before previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again before previous_sibling_child
+Pass remove tree div>div before previous_sibling_child
+Pass insert element div>div[test_attr] before previous_sibling_child
+Pass remove element div>div[test_attr] before previous_sibling_child
+Pass insert tree div>div.test before previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted before previous_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted before previous_sibling_descendant
+Pass remove tree div>div.test before previous_sibling_descendant
+Pass insert tree div>div before previous_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again before previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again before previous_sibling_descendant
+Pass remove tree div>div before previous_sibling_descendant
+Pass insert element div>div[test_attr] before previous_sibling_descendant
+Pass remove element div>div[test_attr] before previous_sibling_descendant
+Pass insert tree div>div.test before subject
+Pass remove the class 'test' from the element in the tree inserted before subject
+Pass add the class 'test' again to the element in the tree inserted before subject
+Pass remove tree div>div.test before subject
+Pass insert tree div>div before subject
+Pass add the class 'test' to the element in the tree inserted again before subject
+Pass remove the class 'test' from the element in the tree inserted again before subject
+Pass remove tree div>div before subject
+Pass insert element div>div[test_attr] before subject
+Pass remove element div>div[test_attr] before subject
+Pass insert tree div>div.test before next_sibling
+Pass remove the class 'test' from the element in the tree inserted before next_sibling
+Pass add the class 'test' again to the element in the tree inserted before next_sibling
+Pass remove tree div>div.test before next_sibling
+Pass insert tree div>div before next_sibling
+Pass add the class 'test' to the element in the tree inserted again before next_sibling
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling
+Pass remove tree div>div before next_sibling
+Pass insert element div>div[test_attr] before next_sibling
+Pass remove element div>div[test_attr] before next_sibling
+Pass insert tree div>div.test before next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted before next_sibling_child
+Pass add the class 'test' again to the element in the tree inserted before next_sibling_child
+Pass remove tree div>div.test before next_sibling_child
+Pass insert tree div>div before next_sibling_child
+Pass add the class 'test' to the element in the tree inserted again before next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling_child
+Pass remove tree div>div before next_sibling_child
+Pass insert element div>div[test_attr] before next_sibling_child
+Pass remove element div>div[test_attr] before next_sibling_child
+Pass insert tree div>div.test before next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted before next_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted before next_sibling_descendant
+Pass remove tree div>div.test before next_sibling_descendant
+Pass insert tree div>div before next_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again before next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling_descendant
+Pass remove tree div>div before next_sibling_descendant
+Pass insert element div>div[test_attr] before next_sibling_descendant
+Pass remove element div>div[test_attr] before next_sibling_descendant
+Pass insert tree div>div.test after previous_sibling
+Pass remove the class 'test' from the element in the tree inserted after previous_sibling
+Pass add the class 'test' again to the element in the tree inserted after previous_sibling
+Pass remove tree div>div.test after previous_sibling
+Pass insert tree div>div after previous_sibling
+Pass add the class 'test' to the element in the tree inserted again after previous_sibling
+Pass remove the class 'test' from the element in the tree inserted again after previous_sibling
+Pass remove tree div>div after previous_sibling
+Pass insert element div>div[test_attr] after previous_sibling
+Pass remove element div>div[test_attr] after previous_sibling
+Pass insert tree div>div.test after previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted after previous_sibling_child
+Pass add the class 'test' again to the element in the tree inserted after previous_sibling_child
+Pass remove tree div>div.test after previous_sibling_child
+Pass insert tree div>div after previous_sibling_child
+Pass add the class 'test' to the element in the tree inserted again after previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again after previous_sibling_child
+Pass remove tree div>div after previous_sibling_child
+Pass insert element div>div[test_attr] after previous_sibling_child
+Pass remove element div>div[test_attr] after previous_sibling_child
+Pass insert tree div>div.test after previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted after previous_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted after previous_sibling_descendant
+Pass remove tree div>div.test after previous_sibling_descendant
+Pass insert tree div>div after previous_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again after previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again after previous_sibling_descendant
+Pass remove tree div>div after previous_sibling_descendant
+Pass insert element div>div[test_attr] after previous_sibling_descendant
+Pass remove element div>div[test_attr] after previous_sibling_descendant
+Pass insert tree div>div.test after subject
+Pass remove the class 'test' from the element in the tree inserted after subject
+Pass add the class 'test' again to the element in the tree inserted after subject
+Pass remove tree div>div.test after subject
+Pass insert tree div>div after subject
+Pass add the class 'test' to the element in the tree inserted again after subject
+Pass remove the class 'test' from the element in the tree inserted again after subject
+Pass remove tree div>div after subject
+Pass insert element div>div[test_attr] after subject
+Pass remove element div>div[test_attr] after subject
+Pass insert tree div>div.test after next_sibling
+Pass remove the class 'test' from the element in the tree inserted after next_sibling
+Pass add the class 'test' again to the element in the tree inserted after next_sibling
+Pass remove tree div>div.test after next_sibling
+Pass insert tree div>div after next_sibling
+Pass add the class 'test' to the element in the tree inserted again after next_sibling
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling
+Pass remove tree div>div after next_sibling
+Pass insert element div>div[test_attr] after next_sibling
+Pass remove element div>div[test_attr] after next_sibling
+Pass insert tree div>div.test after next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted after next_sibling_child
+Pass add the class 'test' again to the element in the tree inserted after next_sibling_child
+Pass remove tree div>div.test after next_sibling_child
+Pass insert tree div>div after next_sibling_child
+Pass add the class 'test' to the element in the tree inserted again after next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling_child
+Pass remove tree div>div after next_sibling_child
+Pass insert element div>div[test_attr] after next_sibling_child
+Pass remove element div>div[test_attr] after next_sibling_child
+Pass insert tree div>div.test after next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted after next_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted after next_sibling_descendant
+Pass remove tree div>div.test after next_sibling_descendant
+Pass insert tree div>div after next_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again after next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling_descendant
+Pass remove tree div>div after next_sibling_descendant
+Pass insert element div>div[test_attr] after next_sibling_descendant
+Pass remove element div>div[test_attr] after next_sibling_descendant
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-ancestor-position.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-ancestor-position.txt
new file mode 100644
index 00000000000..ca438a8168f
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-ancestor-position.txt
@@ -0,0 +1,347 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 337 tests
+
+337 Pass
+Details
+Result Test Name MessagePass Initial color
+Pass add .test to subject_ancestor
+Pass remove .test from subject_ancestor
+Pass add .test to subject_parent
+Pass remove .test from subject_parent
+Pass add .test to subject
+Pass remove .test from subject
+Pass add .test to subject_child
+Pass remove .test from subject_child
+Pass add .test to subject_descendant
+Pass remove .test from subject_descendant
+Pass add .test to next_sibling
+Pass remove .test from next_sibling
+Pass add .test to next_sibling_child
+Pass remove .test from next_sibling_child
+Pass add .test to next_sibling_descendant
+Pass remove .test from next_sibling_descendant
+Pass insert element div.test before subject_ancestor
+Pass remove the class 'test' from the element inserted before subject_ancestor
+Pass add the class 'test' again to the element inserted before subject_ancestor
+Pass remove element div.test before subject_ancestor
+Pass insert element div before subject_ancestor
+Pass add the class 'test' to the element inserted again before subject_ancestor
+Pass remove the class 'test' from the element inserted again before subject_ancestor
+Pass remove element div before subject_ancestor
+Pass insert element div[test_attr] before subject_ancestor
+Pass remove element div[test_attr] before subject_ancestor
+Pass insert element div.test before subject_parent
+Pass remove the class 'test' from the element inserted before subject_parent
+Pass add the class 'test' again to the element inserted before subject_parent
+Pass remove element div.test before subject_parent
+Pass insert element div before subject_parent
+Pass add the class 'test' to the element inserted again before subject_parent
+Pass remove the class 'test' from the element inserted again before subject_parent
+Pass remove element div before subject_parent
+Pass insert element div[test_attr] before subject_parent
+Pass remove element div[test_attr] before subject_parent
+Pass insert element div.test before subject
+Pass remove the class 'test' from the element inserted before subject
+Pass add the class 'test' again to the element inserted before subject
+Pass remove element div.test before subject
+Pass insert element div before subject
+Pass add the class 'test' to the element inserted again before subject
+Pass remove the class 'test' from the element inserted again before subject
+Pass remove element div before subject
+Pass insert element div[test_attr] before subject
+Pass remove element div[test_attr] before subject
+Pass insert element div.test before subject_child
+Pass remove the class 'test' from the element inserted before subject_child
+Pass add the class 'test' again to the element inserted before subject_child
+Pass remove element div.test before subject_child
+Pass insert element div before subject_child
+Pass add the class 'test' to the element inserted again before subject_child
+Pass remove the class 'test' from the element inserted again before subject_child
+Pass remove element div before subject_child
+Pass insert element div[test_attr] before subject_child
+Pass remove element div[test_attr] before subject_child
+Pass insert element div.test before subject_descendant
+Pass remove the class 'test' from the element inserted before subject_descendant
+Pass add the class 'test' again to the element inserted before subject_descendant
+Pass remove element div.test before subject_descendant
+Pass insert element div before subject_descendant
+Pass add the class 'test' to the element inserted again before subject_descendant
+Pass remove the class 'test' from the element inserted again before subject_descendant
+Pass remove element div before subject_descendant
+Pass insert element div[test_attr] before subject_descendant
+Pass remove element div[test_attr] before subject_descendant
+Pass insert element div.test before next_sibling
+Pass remove the class 'test' from the element inserted before next_sibling
+Pass add the class 'test' again to the element inserted before next_sibling
+Pass remove element div.test before next_sibling
+Pass insert element div before next_sibling
+Pass add the class 'test' to the element inserted again before next_sibling
+Pass remove the class 'test' from the element inserted again before next_sibling
+Pass remove element div before next_sibling
+Pass insert element div[test_attr] before next_sibling
+Pass remove element div[test_attr] before next_sibling
+Pass insert element div.test before next_sibling_child
+Pass remove the class 'test' from the element inserted before next_sibling_child
+Pass add the class 'test' again to the element inserted before next_sibling_child
+Pass remove element div.test before next_sibling_child
+Pass insert element div before next_sibling_child
+Pass add the class 'test' to the element inserted again before next_sibling_child
+Pass remove the class 'test' from the element inserted again before next_sibling_child
+Pass remove element div before next_sibling_child
+Pass insert element div[test_attr] before next_sibling_child
+Pass remove element div[test_attr] before next_sibling_child
+Pass insert element div.test before next_sibling_descendant
+Pass remove the class 'test' from the element inserted before next_sibling_descendant
+Pass add the class 'test' again to the element inserted before next_sibling_descendant
+Pass remove element div.test before next_sibling_descendant
+Pass insert element div before next_sibling_descendant
+Pass add the class 'test' to the element inserted again before next_sibling_descendant
+Pass remove the class 'test' from the element inserted again before next_sibling_descendant
+Pass remove element div before next_sibling_descendant
+Pass insert element div[test_attr] before next_sibling_descendant
+Pass remove element div[test_attr] before next_sibling_descendant
+Pass insert element div.test after subject_ancestor
+Pass remove the class 'test' from the element inserted after subject_ancestor
+Pass add the class 'test' again to the element inserted after subject_ancestor
+Pass remove element div.test after subject_ancestor
+Pass insert element div after subject_ancestor
+Pass add the class 'test' to the element inserted again after subject_ancestor
+Pass remove the class 'test' from the element inserted again after subject_ancestor
+Pass remove element div after subject_ancestor
+Pass insert element div[test_attr] after subject_ancestor
+Pass remove element div[test_attr] after subject_ancestor
+Pass insert element div.test after subject_parent
+Pass remove the class 'test' from the element inserted after subject_parent
+Pass add the class 'test' again to the element inserted after subject_parent
+Pass remove element div.test after subject_parent
+Pass insert element div after subject_parent
+Pass add the class 'test' to the element inserted again after subject_parent
+Pass remove the class 'test' from the element inserted again after subject_parent
+Pass remove element div after subject_parent
+Pass insert element div[test_attr] after subject_parent
+Pass remove element div[test_attr] after subject_parent
+Pass insert element div.test after subject
+Pass remove the class 'test' from the element inserted after subject
+Pass add the class 'test' again to the element inserted after subject
+Pass remove element div.test after subject
+Pass insert element div after subject
+Pass add the class 'test' to the element inserted again after subject
+Pass remove the class 'test' from the element inserted again after subject
+Pass remove element div after subject
+Pass insert element div[test_attr] after subject
+Pass remove element div[test_attr] after subject
+Pass insert element div.test after subject_child
+Pass remove the class 'test' from the element inserted after subject_child
+Pass add the class 'test' again to the element inserted after subject_child
+Pass remove element div.test after subject_child
+Pass insert element div after subject_child
+Pass add the class 'test' to the element inserted again after subject_child
+Pass remove the class 'test' from the element inserted again after subject_child
+Pass remove element div after subject_child
+Pass insert element div[test_attr] after subject_child
+Pass remove element div[test_attr] after subject_child
+Pass insert element div.test after subject_descendant
+Pass remove the class 'test' from the element inserted after subject_descendant
+Pass add the class 'test' again to the element inserted after subject_descendant
+Pass remove element div.test after subject_descendant
+Pass insert element div after subject_descendant
+Pass add the class 'test' to the element inserted again after subject_descendant
+Pass remove the class 'test' from the element inserted again after subject_descendant
+Pass remove element div after subject_descendant
+Pass insert element div[test_attr] after subject_descendant
+Pass remove element div[test_attr] after subject_descendant
+Pass insert element div.test after next_sibling
+Pass remove the class 'test' from the element inserted after next_sibling
+Pass add the class 'test' again to the element inserted after next_sibling
+Pass remove element div.test after next_sibling
+Pass insert element div after next_sibling
+Pass add the class 'test' to the element inserted again after next_sibling
+Pass remove the class 'test' from the element inserted again after next_sibling
+Pass remove element div after next_sibling
+Pass insert element div[test_attr] after next_sibling
+Pass remove element div[test_attr] after next_sibling
+Pass insert element div.test after next_sibling_child
+Pass remove the class 'test' from the element inserted after next_sibling_child
+Pass add the class 'test' again to the element inserted after next_sibling_child
+Pass remove element div.test after next_sibling_child
+Pass insert element div after next_sibling_child
+Pass add the class 'test' to the element inserted again after next_sibling_child
+Pass remove the class 'test' from the element inserted again after next_sibling_child
+Pass remove element div after next_sibling_child
+Pass insert element div[test_attr] after next_sibling_child
+Pass remove element div[test_attr] after next_sibling_child
+Pass insert element div.test after next_sibling_descendant
+Pass remove the class 'test' from the element inserted after next_sibling_descendant
+Pass add the class 'test' again to the element inserted after next_sibling_descendant
+Pass remove element div.test after next_sibling_descendant
+Pass insert element div after next_sibling_descendant
+Pass add the class 'test' to the element inserted again after next_sibling_descendant
+Pass remove the class 'test' from the element inserted again after next_sibling_descendant
+Pass remove element div after next_sibling_descendant
+Pass insert element div[test_attr] after next_sibling_descendant
+Pass remove element div[test_attr] after next_sibling_descendant
+Pass insert tree div>div.test before subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted before subject_ancestor
+Pass add the class 'test' again to the element in the tree inserted before subject_ancestor
+Pass remove tree div>div.test before subject_ancestor
+Pass insert tree div>div before subject_ancestor
+Pass add the class 'test' to the element in the tree inserted again before subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted again before subject_ancestor
+Pass remove tree div>div before subject_ancestor
+Pass insert element div>div[test_attr] before subject_ancestor
+Pass remove element div>div[test_attr] before subject_ancestor
+Pass insert tree div>div.test before subject_parent
+Pass remove the class 'test' from the element in the tree inserted before subject_parent
+Pass add the class 'test' again to the element in the tree inserted before subject_parent
+Pass remove tree div>div.test before subject_parent
+Pass insert tree div>div before subject_parent
+Pass add the class 'test' to the element in the tree inserted again before subject_parent
+Pass remove the class 'test' from the element in the tree inserted again before subject_parent
+Pass remove tree div>div before subject_parent
+Pass insert element div>div[test_attr] before subject_parent
+Pass remove element div>div[test_attr] before subject_parent
+Pass insert tree div>div.test before subject
+Pass remove the class 'test' from the element in the tree inserted before subject
+Pass add the class 'test' again to the element in the tree inserted before subject
+Pass remove tree div>div.test before subject
+Pass insert tree div>div before subject
+Pass add the class 'test' to the element in the tree inserted again before subject
+Pass remove the class 'test' from the element in the tree inserted again before subject
+Pass remove tree div>div before subject
+Pass insert element div>div[test_attr] before subject
+Pass remove element div>div[test_attr] before subject
+Pass insert tree div>div.test before subject_child
+Pass remove the class 'test' from the element in the tree inserted before subject_child
+Pass add the class 'test' again to the element in the tree inserted before subject_child
+Pass remove tree div>div.test before subject_child
+Pass insert tree div>div before subject_child
+Pass add the class 'test' to the element in the tree inserted again before subject_child
+Pass remove the class 'test' from the element in the tree inserted again before subject_child
+Pass remove tree div>div before subject_child
+Pass insert element div>div[test_attr] before subject_child
+Pass remove element div>div[test_attr] before subject_child
+Pass insert tree div>div.test before subject_descendant
+Pass remove the class 'test' from the element in the tree inserted before subject_descendant
+Pass add the class 'test' again to the element in the tree inserted before subject_descendant
+Pass remove tree div>div.test before subject_descendant
+Pass insert tree div>div before subject_descendant
+Pass add the class 'test' to the element in the tree inserted again before subject_descendant
+Pass remove the class 'test' from the element in the tree inserted again before subject_descendant
+Pass remove tree div>div before subject_descendant
+Pass insert element div>div[test_attr] before subject_descendant
+Pass remove element div>div[test_attr] before subject_descendant
+Pass insert tree div>div.test before next_sibling
+Pass remove the class 'test' from the element in the tree inserted before next_sibling
+Pass add the class 'test' again to the element in the tree inserted before next_sibling
+Pass remove tree div>div.test before next_sibling
+Pass insert tree div>div before next_sibling
+Pass add the class 'test' to the element in the tree inserted again before next_sibling
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling
+Pass remove tree div>div before next_sibling
+Pass insert element div>div[test_attr] before next_sibling
+Pass remove element div>div[test_attr] before next_sibling
+Pass insert tree div>div.test before next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted before next_sibling_child
+Pass add the class 'test' again to the element in the tree inserted before next_sibling_child
+Pass remove tree div>div.test before next_sibling_child
+Pass insert tree div>div before next_sibling_child
+Pass add the class 'test' to the element in the tree inserted again before next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling_child
+Pass remove tree div>div before next_sibling_child
+Pass insert element div>div[test_attr] before next_sibling_child
+Pass remove element div>div[test_attr] before next_sibling_child
+Pass insert tree div>div.test before next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted before next_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted before next_sibling_descendant
+Pass remove tree div>div.test before next_sibling_descendant
+Pass insert tree div>div before next_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again before next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling_descendant
+Pass remove tree div>div before next_sibling_descendant
+Pass insert element div>div[test_attr] before next_sibling_descendant
+Pass remove element div>div[test_attr] before next_sibling_descendant
+Pass insert tree div>div.test after subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted after subject_ancestor
+Pass add the class 'test' again to the element in the tree inserted after subject_ancestor
+Pass remove tree div>div.test after subject_ancestor
+Pass insert tree div>div after subject_ancestor
+Pass add the class 'test' to the element in the tree inserted again after subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted again after subject_ancestor
+Pass remove tree div>div after subject_ancestor
+Pass insert element div>div[test_attr] after subject_ancestor
+Pass remove element div>div[test_attr] after subject_ancestor
+Pass insert tree div>div.test after subject_parent
+Pass remove the class 'test' from the element in the tree inserted after subject_parent
+Pass add the class 'test' again to the element in the tree inserted after subject_parent
+Pass remove tree div>div.test after subject_parent
+Pass insert tree div>div after subject_parent
+Pass add the class 'test' to the element in the tree inserted again after subject_parent
+Pass remove the class 'test' from the element in the tree inserted again after subject_parent
+Pass remove tree div>div after subject_parent
+Pass insert element div>div[test_attr] after subject_parent
+Pass remove element div>div[test_attr] after subject_parent
+Pass insert tree div>div.test after subject
+Pass remove the class 'test' from the element in the tree inserted after subject
+Pass add the class 'test' again to the element in the tree inserted after subject
+Pass remove tree div>div.test after subject
+Pass insert tree div>div after subject
+Pass add the class 'test' to the element in the tree inserted again after subject
+Pass remove the class 'test' from the element in the tree inserted again after subject
+Pass remove tree div>div after subject
+Pass insert element div>div[test_attr] after subject
+Pass remove element div>div[test_attr] after subject
+Pass insert tree div>div.test after subject_child
+Pass remove the class 'test' from the element in the tree inserted after subject_child
+Pass add the class 'test' again to the element in the tree inserted after subject_child
+Pass remove tree div>div.test after subject_child
+Pass insert tree div>div after subject_child
+Pass add the class 'test' to the element in the tree inserted again after subject_child
+Pass remove the class 'test' from the element in the tree inserted again after subject_child
+Pass remove tree div>div after subject_child
+Pass insert element div>div[test_attr] after subject_child
+Pass remove element div>div[test_attr] after subject_child
+Pass insert tree div>div.test after subject_descendant
+Pass remove the class 'test' from the element in the tree inserted after subject_descendant
+Pass add the class 'test' again to the element in the tree inserted after subject_descendant
+Pass remove tree div>div.test after subject_descendant
+Pass insert tree div>div after subject_descendant
+Pass add the class 'test' to the element in the tree inserted again after subject_descendant
+Pass remove the class 'test' from the element in the tree inserted again after subject_descendant
+Pass remove tree div>div after subject_descendant
+Pass insert element div>div[test_attr] after subject_descendant
+Pass remove element div>div[test_attr] after subject_descendant
+Pass insert tree div>div.test after next_sibling
+Pass remove the class 'test' from the element in the tree inserted after next_sibling
+Pass add the class 'test' again to the element in the tree inserted after next_sibling
+Pass remove tree div>div.test after next_sibling
+Pass insert tree div>div after next_sibling
+Pass add the class 'test' to the element in the tree inserted again after next_sibling
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling
+Pass remove tree div>div after next_sibling
+Pass insert element div>div[test_attr] after next_sibling
+Pass remove element div>div[test_attr] after next_sibling
+Pass insert tree div>div.test after next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted after next_sibling_child
+Pass add the class 'test' again to the element in the tree inserted after next_sibling_child
+Pass remove tree div>div.test after next_sibling_child
+Pass insert tree div>div after next_sibling_child
+Pass add the class 'test' to the element in the tree inserted again after next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling_child
+Pass remove tree div>div after next_sibling_child
+Pass insert element div>div[test_attr] after next_sibling_child
+Pass remove element div>div[test_attr] after next_sibling_child
+Pass insert tree div>div.test after next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted after next_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted after next_sibling_descendant
+Pass remove tree div>div.test after next_sibling_descendant
+Pass insert tree div>div after next_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again after next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling_descendant
+Pass remove tree div>div after next_sibling_descendant
+Pass insert element div>div[test_attr] after next_sibling_descendant
+Pass remove element div>div[test_attr] after next_sibling_descendant
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-parent-position.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-parent-position.txt
new file mode 100644
index 00000000000..79b23409b3d
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-parent-position.txt
@@ -0,0 +1,221 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 211 tests
+
+211 Pass
+Details
+Result Test Name MessagePass Initial color
+Pass add .test to subject_ancestor
+Pass remove .test from subject_ancestor
+Pass add .test to subject_parent
+Pass remove .test from subject_parent
+Pass add .test to subject
+Pass remove .test from subject
+Pass add .test to subject_child
+Pass remove .test from subject_child
+Pass add .test to subject_descendant
+Pass remove .test from subject_descendant
+Pass insert element div.test before subject_ancestor
+Pass remove the class 'test' from the element inserted before subject_ancestor
+Pass add the class 'test' again to the element inserted before subject_ancestor
+Pass remove element div.test before subject_ancestor
+Pass insert element div before subject_ancestor
+Pass add the class 'test' to the element inserted again before subject_ancestor
+Pass remove the class 'test' from the element inserted again before subject_ancestor
+Pass remove element div before subject_ancestor
+Pass insert element div[test_attr] before subject_ancestor
+Pass remove element div[test_attr] before subject_ancestor
+Pass insert element div.test before subject_parent
+Pass remove the class 'test' from the element inserted before subject_parent
+Pass add the class 'test' again to the element inserted before subject_parent
+Pass remove element div.test before subject_parent
+Pass insert element div before subject_parent
+Pass add the class 'test' to the element inserted again before subject_parent
+Pass remove the class 'test' from the element inserted again before subject_parent
+Pass remove element div before subject_parent
+Pass insert element div[test_attr] before subject_parent
+Pass remove element div[test_attr] before subject_parent
+Pass insert element div.test before subject
+Pass remove the class 'test' from the element inserted before subject
+Pass add the class 'test' again to the element inserted before subject
+Pass remove element div.test before subject
+Pass insert element div before subject
+Pass add the class 'test' to the element inserted again before subject
+Pass remove the class 'test' from the element inserted again before subject
+Pass remove element div before subject
+Pass insert element div[test_attr] before subject
+Pass remove element div[test_attr] before subject
+Pass insert element div.test before subject_child
+Pass remove the class 'test' from the element inserted before subject_child
+Pass add the class 'test' again to the element inserted before subject_child
+Pass remove element div.test before subject_child
+Pass insert element div before subject_child
+Pass add the class 'test' to the element inserted again before subject_child
+Pass remove the class 'test' from the element inserted again before subject_child
+Pass remove element div before subject_child
+Pass insert element div[test_attr] before subject_child
+Pass remove element div[test_attr] before subject_child
+Pass insert element div.test before subject_descendant
+Pass remove the class 'test' from the element inserted before subject_descendant
+Pass add the class 'test' again to the element inserted before subject_descendant
+Pass remove element div.test before subject_descendant
+Pass insert element div before subject_descendant
+Pass add the class 'test' to the element inserted again before subject_descendant
+Pass remove the class 'test' from the element inserted again before subject_descendant
+Pass remove element div before subject_descendant
+Pass insert element div[test_attr] before subject_descendant
+Pass remove element div[test_attr] before subject_descendant
+Pass insert element div.test after subject_ancestor
+Pass remove the class 'test' from the element inserted after subject_ancestor
+Pass add the class 'test' again to the element inserted after subject_ancestor
+Pass remove element div.test after subject_ancestor
+Pass insert element div after subject_ancestor
+Pass add the class 'test' to the element inserted again after subject_ancestor
+Pass remove the class 'test' from the element inserted again after subject_ancestor
+Pass remove element div after subject_ancestor
+Pass insert element div[test_attr] after subject_ancestor
+Pass remove element div[test_attr] after subject_ancestor
+Pass insert element div.test after subject_parent
+Pass remove the class 'test' from the element inserted after subject_parent
+Pass add the class 'test' again to the element inserted after subject_parent
+Pass remove element div.test after subject_parent
+Pass insert element div after subject_parent
+Pass add the class 'test' to the element inserted again after subject_parent
+Pass remove the class 'test' from the element inserted again after subject_parent
+Pass remove element div after subject_parent
+Pass insert element div[test_attr] after subject_parent
+Pass remove element div[test_attr] after subject_parent
+Pass insert element div.test after subject
+Pass remove the class 'test' from the element inserted after subject
+Pass add the class 'test' again to the element inserted after subject
+Pass remove element div.test after subject
+Pass insert element div after subject
+Pass add the class 'test' to the element inserted again after subject
+Pass remove the class 'test' from the element inserted again after subject
+Pass remove element div after subject
+Pass insert element div[test_attr] after subject
+Pass remove element div[test_attr] after subject
+Pass insert element div.test after subject_child
+Pass remove the class 'test' from the element inserted after subject_child
+Pass add the class 'test' again to the element inserted after subject_child
+Pass remove element div.test after subject_child
+Pass insert element div after subject_child
+Pass add the class 'test' to the element inserted again after subject_child
+Pass remove the class 'test' from the element inserted again after subject_child
+Pass remove element div after subject_child
+Pass insert element div[test_attr] after subject_child
+Pass remove element div[test_attr] after subject_child
+Pass insert element div.test after subject_descendant
+Pass remove the class 'test' from the element inserted after subject_descendant
+Pass add the class 'test' again to the element inserted after subject_descendant
+Pass remove element div.test after subject_descendant
+Pass insert element div after subject_descendant
+Pass add the class 'test' to the element inserted again after subject_descendant
+Pass remove the class 'test' from the element inserted again after subject_descendant
+Pass remove element div after subject_descendant
+Pass insert element div[test_attr] after subject_descendant
+Pass remove element div[test_attr] after subject_descendant
+Pass insert tree div>div.test before subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted before subject_ancestor
+Pass add the class 'test' again to the element in the tree inserted before subject_ancestor
+Pass remove tree div>div.test before subject_ancestor
+Pass insert tree div>div before subject_ancestor
+Pass add the class 'test' to the element in the tree inserted again before subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted again before subject_ancestor
+Pass remove tree div>div before subject_ancestor
+Pass insert element div>div[test_attr] before subject_ancestor
+Pass remove element div>div[test_attr] before subject_ancestor
+Pass insert tree div>div.test before subject_parent
+Pass remove the class 'test' from the element in the tree inserted before subject_parent
+Pass add the class 'test' again to the element in the tree inserted before subject_parent
+Pass remove tree div>div.test before subject_parent
+Pass insert tree div>div before subject_parent
+Pass add the class 'test' to the element in the tree inserted again before subject_parent
+Pass remove the class 'test' from the element in the tree inserted again before subject_parent
+Pass remove tree div>div before subject_parent
+Pass insert element div>div[test_attr] before subject_parent
+Pass remove element div>div[test_attr] before subject_parent
+Pass insert tree div>div.test before subject
+Pass remove the class 'test' from the element in the tree inserted before subject
+Pass add the class 'test' again to the element in the tree inserted before subject
+Pass remove tree div>div.test before subject
+Pass insert tree div>div before subject
+Pass add the class 'test' to the element in the tree inserted again before subject
+Pass remove the class 'test' from the element in the tree inserted again before subject
+Pass remove tree div>div before subject
+Pass insert element div>div[test_attr] before subject
+Pass remove element div>div[test_attr] before subject
+Pass insert tree div>div.test before subject_child
+Pass remove the class 'test' from the element in the tree inserted before subject_child
+Pass add the class 'test' again to the element in the tree inserted before subject_child
+Pass remove tree div>div.test before subject_child
+Pass insert tree div>div before subject_child
+Pass add the class 'test' to the element in the tree inserted again before subject_child
+Pass remove the class 'test' from the element in the tree inserted again before subject_child
+Pass remove tree div>div before subject_child
+Pass insert element div>div[test_attr] before subject_child
+Pass remove element div>div[test_attr] before subject_child
+Pass insert tree div>div.test before subject_descendant
+Pass remove the class 'test' from the element in the tree inserted before subject_descendant
+Pass add the class 'test' again to the element in the tree inserted before subject_descendant
+Pass remove tree div>div.test before subject_descendant
+Pass insert tree div>div before subject_descendant
+Pass add the class 'test' to the element in the tree inserted again before subject_descendant
+Pass remove the class 'test' from the element in the tree inserted again before subject_descendant
+Pass remove tree div>div before subject_descendant
+Pass insert element div>div[test_attr] before subject_descendant
+Pass remove element div>div[test_attr] before subject_descendant
+Pass insert tree div>div.test after subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted after subject_ancestor
+Pass add the class 'test' again to the element in the tree inserted after subject_ancestor
+Pass remove tree div>div.test after subject_ancestor
+Pass insert tree div>div after subject_ancestor
+Pass add the class 'test' to the element in the tree inserted again after subject_ancestor
+Pass remove the class 'test' from the element in the tree inserted again after subject_ancestor
+Pass remove tree div>div after subject_ancestor
+Pass insert element div>div[test_attr] after subject_ancestor
+Pass remove element div>div[test_attr] after subject_ancestor
+Pass insert tree div>div.test after subject_parent
+Pass remove the class 'test' from the element in the tree inserted after subject_parent
+Pass add the class 'test' again to the element in the tree inserted after subject_parent
+Pass remove tree div>div.test after subject_parent
+Pass insert tree div>div after subject_parent
+Pass add the class 'test' to the element in the tree inserted again after subject_parent
+Pass remove the class 'test' from the element in the tree inserted again after subject_parent
+Pass remove tree div>div after subject_parent
+Pass insert element div>div[test_attr] after subject_parent
+Pass remove element div>div[test_attr] after subject_parent
+Pass insert tree div>div.test after subject
+Pass remove the class 'test' from the element in the tree inserted after subject
+Pass add the class 'test' again to the element in the tree inserted after subject
+Pass remove tree div>div.test after subject
+Pass insert tree div>div after subject
+Pass add the class 'test' to the element in the tree inserted again after subject
+Pass remove the class 'test' from the element in the tree inserted again after subject
+Pass remove tree div>div after subject
+Pass insert element div>div[test_attr] after subject
+Pass remove element div>div[test_attr] after subject
+Pass insert tree div>div.test after subject_child
+Pass remove the class 'test' from the element in the tree inserted after subject_child
+Pass add the class 'test' again to the element in the tree inserted after subject_child
+Pass remove tree div>div.test after subject_child
+Pass insert tree div>div after subject_child
+Pass add the class 'test' to the element in the tree inserted again after subject_child
+Pass remove the class 'test' from the element in the tree inserted again after subject_child
+Pass remove tree div>div after subject_child
+Pass insert element div>div[test_attr] after subject_child
+Pass remove element div>div[test_attr] after subject_child
+Pass insert tree div>div.test after subject_descendant
+Pass remove the class 'test' from the element in the tree inserted after subject_descendant
+Pass add the class 'test' again to the element in the tree inserted after subject_descendant
+Pass remove tree div>div.test after subject_descendant
+Pass insert tree div>div after subject_descendant
+Pass add the class 'test' to the element in the tree inserted again after subject_descendant
+Pass remove the class 'test' from the element in the tree inserted again after subject_descendant
+Pass remove tree div>div after subject_descendant
+Pass insert element div>div[test_attr] after subject_descendant
+Pass remove element div>div[test_attr] after subject_descendant
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-sibling-position.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-sibling-position.txt
new file mode 100644
index 00000000000..e137e28f07e
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-in-sibling-position.txt
@@ -0,0 +1,305 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 295 tests
+
+295 Pass
+Details
+Result Test Name MessagePass Initial color
+Pass add .test to previous_sibling
+Pass remove .test from previous_sibling
+Pass add .test to previous_sibling_child
+Pass remove .test from previous_sibling_child
+Pass add .test to previous_sibling_descendant
+Pass remove .test from previous_sibling_descendant
+Pass add .test to subject
+Pass remove .test from subject
+Pass add .test to next_sibling
+Pass remove .test from next_sibling
+Pass add .test to next_sibling_child
+Pass remove .test from next_sibling_child
+Pass add .test to next_sibling_descendant
+Pass remove .test from next_sibling_descendant
+Pass insert element div.test before previous_sibling
+Pass remove the class 'test' from the element inserted before previous_sibling
+Pass add the class 'test' again to the element inserted before previous_sibling
+Pass remove element div.test before previous_sibling
+Pass insert element div before previous_sibling
+Pass add the class 'test' to the element inserted again before previous_sibling
+Pass remove the class 'test' from the element inserted again before previous_sibling
+Pass remove element div before previous_sibling
+Pass insert element div[test_attr] before previous_sibling
+Pass remove element div[test_attr] before previous_sibling
+Pass insert element div.test before previous_sibling_child
+Pass remove the class 'test' from the element inserted before previous_sibling_child
+Pass add the class 'test' again to the element inserted before previous_sibling_child
+Pass remove element div.test before previous_sibling_child
+Pass insert element div before previous_sibling_child
+Pass add the class 'test' to the element inserted again before previous_sibling_child
+Pass remove the class 'test' from the element inserted again before previous_sibling_child
+Pass remove element div before previous_sibling_child
+Pass insert element div[test_attr] before previous_sibling_child
+Pass remove element div[test_attr] before previous_sibling_child
+Pass insert element div.test before previous_sibling_descendant
+Pass remove the class 'test' from the element inserted before previous_sibling_descendant
+Pass add the class 'test' again to the element inserted before previous_sibling_descendant
+Pass remove element div.test before previous_sibling_descendant
+Pass insert element div before previous_sibling_descendant
+Pass add the class 'test' to the element inserted again before previous_sibling_descendant
+Pass remove the class 'test' from the element inserted again before previous_sibling_descendant
+Pass remove element div before previous_sibling_descendant
+Pass insert element div[test_attr] before previous_sibling_descendant
+Pass remove element div[test_attr] before previous_sibling_descendant
+Pass insert element div.test before subject
+Pass remove the class 'test' from the element inserted before subject
+Pass add the class 'test' again to the element inserted before subject
+Pass remove element div.test before subject
+Pass insert element div before subject
+Pass add the class 'test' to the element inserted again before subject
+Pass remove the class 'test' from the element inserted again before subject
+Pass remove element div before subject
+Pass insert element div[test_attr] before subject
+Pass remove element div[test_attr] before subject
+Pass insert element div.test before next_sibling
+Pass remove the class 'test' from the element inserted before next_sibling
+Pass add the class 'test' again to the element inserted before next_sibling
+Pass remove element div.test before next_sibling
+Pass insert element div before next_sibling
+Pass add the class 'test' to the element inserted again before next_sibling
+Pass remove the class 'test' from the element inserted again before next_sibling
+Pass remove element div before next_sibling
+Pass insert element div[test_attr] before next_sibling
+Pass remove element div[test_attr] before next_sibling
+Pass insert element div.test before next_sibling_child
+Pass remove the class 'test' from the element inserted before next_sibling_child
+Pass add the class 'test' again to the element inserted before next_sibling_child
+Pass remove element div.test before next_sibling_child
+Pass insert element div before next_sibling_child
+Pass add the class 'test' to the element inserted again before next_sibling_child
+Pass remove the class 'test' from the element inserted again before next_sibling_child
+Pass remove element div before next_sibling_child
+Pass insert element div[test_attr] before next_sibling_child
+Pass remove element div[test_attr] before next_sibling_child
+Pass insert element div.test before next_sibling_descendant
+Pass remove the class 'test' from the element inserted before next_sibling_descendant
+Pass add the class 'test' again to the element inserted before next_sibling_descendant
+Pass remove element div.test before next_sibling_descendant
+Pass insert element div before next_sibling_descendant
+Pass add the class 'test' to the element inserted again before next_sibling_descendant
+Pass remove the class 'test' from the element inserted again before next_sibling_descendant
+Pass remove element div before next_sibling_descendant
+Pass insert element div[test_attr] before next_sibling_descendant
+Pass remove element div[test_attr] before next_sibling_descendant
+Pass insert element div.test after previous_sibling
+Pass remove the class 'test' from the element inserted after previous_sibling
+Pass add the class 'test' again to the element inserted after previous_sibling
+Pass remove element div.test after previous_sibling
+Pass insert element div after previous_sibling
+Pass add the class 'test' to the element inserted again after previous_sibling
+Pass remove the class 'test' from the element inserted again after previous_sibling
+Pass remove element div after previous_sibling
+Pass insert element div[test_attr] after previous_sibling
+Pass remove element div[test_attr] after previous_sibling
+Pass insert element div.test after previous_sibling_child
+Pass remove the class 'test' from the element inserted after previous_sibling_child
+Pass add the class 'test' again to the element inserted after previous_sibling_child
+Pass remove element div.test after previous_sibling_child
+Pass insert element div after previous_sibling_child
+Pass add the class 'test' to the element inserted again after previous_sibling_child
+Pass remove the class 'test' from the element inserted again after previous_sibling_child
+Pass remove element div after previous_sibling_child
+Pass insert element div[test_attr] after previous_sibling_child
+Pass remove element div[test_attr] after previous_sibling_child
+Pass insert element div.test after previous_sibling_descendant
+Pass remove the class 'test' from the element inserted after previous_sibling_descendant
+Pass add the class 'test' again to the element inserted after previous_sibling_descendant
+Pass remove element div.test after previous_sibling_descendant
+Pass insert element div after previous_sibling_descendant
+Pass add the class 'test' to the element inserted again after previous_sibling_descendant
+Pass remove the class 'test' from the element inserted again after previous_sibling_descendant
+Pass remove element div after previous_sibling_descendant
+Pass insert element div[test_attr] after previous_sibling_descendant
+Pass remove element div[test_attr] after previous_sibling_descendant
+Pass insert element div.test after subject
+Pass remove the class 'test' from the element inserted after subject
+Pass add the class 'test' again to the element inserted after subject
+Pass remove element div.test after subject
+Pass insert element div after subject
+Pass add the class 'test' to the element inserted again after subject
+Pass remove the class 'test' from the element inserted again after subject
+Pass remove element div after subject
+Pass insert element div[test_attr] after subject
+Pass remove element div[test_attr] after subject
+Pass insert element div.test after next_sibling
+Pass remove the class 'test' from the element inserted after next_sibling
+Pass add the class 'test' again to the element inserted after next_sibling
+Pass remove element div.test after next_sibling
+Pass insert element div after next_sibling
+Pass add the class 'test' to the element inserted again after next_sibling
+Pass remove the class 'test' from the element inserted again after next_sibling
+Pass remove element div after next_sibling
+Pass insert element div[test_attr] after next_sibling
+Pass remove element div[test_attr] after next_sibling
+Pass insert element div.test after next_sibling_child
+Pass remove the class 'test' from the element inserted after next_sibling_child
+Pass add the class 'test' again to the element inserted after next_sibling_child
+Pass remove element div.test after next_sibling_child
+Pass insert element div after next_sibling_child
+Pass add the class 'test' to the element inserted again after next_sibling_child
+Pass remove the class 'test' from the element inserted again after next_sibling_child
+Pass remove element div after next_sibling_child
+Pass insert element div[test_attr] after next_sibling_child
+Pass remove element div[test_attr] after next_sibling_child
+Pass insert element div.test after next_sibling_descendant
+Pass remove the class 'test' from the element inserted after next_sibling_descendant
+Pass add the class 'test' again to the element inserted after next_sibling_descendant
+Pass remove element div.test after next_sibling_descendant
+Pass insert element div after next_sibling_descendant
+Pass add the class 'test' to the element inserted again after next_sibling_descendant
+Pass remove the class 'test' from the element inserted again after next_sibling_descendant
+Pass remove element div after next_sibling_descendant
+Pass insert element div[test_attr] after next_sibling_descendant
+Pass remove element div[test_attr] after next_sibling_descendant
+Pass insert tree div>div.test before previous_sibling
+Pass remove the class 'test' from the element in the tree inserted before previous_sibling
+Pass add the class 'test' again to the element in the tree inserted before previous_sibling
+Pass remove tree div>div.test before previous_sibling
+Pass insert tree div>div before previous_sibling
+Pass add the class 'test' to the element in the tree inserted again before previous_sibling
+Pass remove the class 'test' from the element in the tree inserted again before previous_sibling
+Pass remove tree div>div before previous_sibling
+Pass insert element div>div[test_attr] before previous_sibling
+Pass remove element div>div[test_attr] before previous_sibling
+Pass insert tree div>div.test before previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted before previous_sibling_child
+Pass add the class 'test' again to the element in the tree inserted before previous_sibling_child
+Pass remove tree div>div.test before previous_sibling_child
+Pass insert tree div>div before previous_sibling_child
+Pass add the class 'test' to the element in the tree inserted again before previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again before previous_sibling_child
+Pass remove tree div>div before previous_sibling_child
+Pass insert element div>div[test_attr] before previous_sibling_child
+Pass remove element div>div[test_attr] before previous_sibling_child
+Pass insert tree div>div.test before previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted before previous_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted before previous_sibling_descendant
+Pass remove tree div>div.test before previous_sibling_descendant
+Pass insert tree div>div before previous_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again before previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again before previous_sibling_descendant
+Pass remove tree div>div before previous_sibling_descendant
+Pass insert element div>div[test_attr] before previous_sibling_descendant
+Pass remove element div>div[test_attr] before previous_sibling_descendant
+Pass insert tree div>div.test before subject
+Pass remove the class 'test' from the element in the tree inserted before subject
+Pass add the class 'test' again to the element in the tree inserted before subject
+Pass remove tree div>div.test before subject
+Pass insert tree div>div before subject
+Pass add the class 'test' to the element in the tree inserted again before subject
+Pass remove the class 'test' from the element in the tree inserted again before subject
+Pass remove tree div>div before subject
+Pass insert element div>div[test_attr] before subject
+Pass remove element div>div[test_attr] before subject
+Pass insert tree div>div.test before next_sibling
+Pass remove the class 'test' from the element in the tree inserted before next_sibling
+Pass add the class 'test' again to the element in the tree inserted before next_sibling
+Pass remove tree div>div.test before next_sibling
+Pass insert tree div>div before next_sibling
+Pass add the class 'test' to the element in the tree inserted again before next_sibling
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling
+Pass remove tree div>div before next_sibling
+Pass insert element div>div[test_attr] before next_sibling
+Pass remove element div>div[test_attr] before next_sibling
+Pass insert tree div>div.test before next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted before next_sibling_child
+Pass add the class 'test' again to the element in the tree inserted before next_sibling_child
+Pass remove tree div>div.test before next_sibling_child
+Pass insert tree div>div before next_sibling_child
+Pass add the class 'test' to the element in the tree inserted again before next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling_child
+Pass remove tree div>div before next_sibling_child
+Pass insert element div>div[test_attr] before next_sibling_child
+Pass remove element div>div[test_attr] before next_sibling_child
+Pass insert tree div>div.test before next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted before next_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted before next_sibling_descendant
+Pass remove tree div>div.test before next_sibling_descendant
+Pass insert tree div>div before next_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again before next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again before next_sibling_descendant
+Pass remove tree div>div before next_sibling_descendant
+Pass insert element div>div[test_attr] before next_sibling_descendant
+Pass remove element div>div[test_attr] before next_sibling_descendant
+Pass insert tree div>div.test after previous_sibling
+Pass remove the class 'test' from the element in the tree inserted after previous_sibling
+Pass add the class 'test' again to the element in the tree inserted after previous_sibling
+Pass remove tree div>div.test after previous_sibling
+Pass insert tree div>div after previous_sibling
+Pass add the class 'test' to the element in the tree inserted again after previous_sibling
+Pass remove the class 'test' from the element in the tree inserted again after previous_sibling
+Pass remove tree div>div after previous_sibling
+Pass insert element div>div[test_attr] after previous_sibling
+Pass remove element div>div[test_attr] after previous_sibling
+Pass insert tree div>div.test after previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted after previous_sibling_child
+Pass add the class 'test' again to the element in the tree inserted after previous_sibling_child
+Pass remove tree div>div.test after previous_sibling_child
+Pass insert tree div>div after previous_sibling_child
+Pass add the class 'test' to the element in the tree inserted again after previous_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again after previous_sibling_child
+Pass remove tree div>div after previous_sibling_child
+Pass insert element div>div[test_attr] after previous_sibling_child
+Pass remove element div>div[test_attr] after previous_sibling_child
+Pass insert tree div>div.test after previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted after previous_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted after previous_sibling_descendant
+Pass remove tree div>div.test after previous_sibling_descendant
+Pass insert tree div>div after previous_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again after previous_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again after previous_sibling_descendant
+Pass remove tree div>div after previous_sibling_descendant
+Pass insert element div>div[test_attr] after previous_sibling_descendant
+Pass remove element div>div[test_attr] after previous_sibling_descendant
+Pass insert tree div>div.test after subject
+Pass remove the class 'test' from the element in the tree inserted after subject
+Pass add the class 'test' again to the element in the tree inserted after subject
+Pass remove tree div>div.test after subject
+Pass insert tree div>div after subject
+Pass add the class 'test' to the element in the tree inserted again after subject
+Pass remove the class 'test' from the element in the tree inserted again after subject
+Pass remove tree div>div after subject
+Pass insert element div>div[test_attr] after subject
+Pass remove element div>div[test_attr] after subject
+Pass insert tree div>div.test after next_sibling
+Pass remove the class 'test' from the element in the tree inserted after next_sibling
+Pass add the class 'test' again to the element in the tree inserted after next_sibling
+Pass remove tree div>div.test after next_sibling
+Pass insert tree div>div after next_sibling
+Pass add the class 'test' to the element in the tree inserted again after next_sibling
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling
+Pass remove tree div>div after next_sibling
+Pass insert element div>div[test_attr] after next_sibling
+Pass remove element div>div[test_attr] after next_sibling
+Pass insert tree div>div.test after next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted after next_sibling_child
+Pass add the class 'test' again to the element in the tree inserted after next_sibling_child
+Pass remove tree div>div.test after next_sibling_child
+Pass insert tree div>div after next_sibling_child
+Pass add the class 'test' to the element in the tree inserted again after next_sibling_child
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling_child
+Pass remove tree div>div after next_sibling_child
+Pass insert element div>div[test_attr] after next_sibling_child
+Pass remove element div>div[test_attr] after next_sibling_child
+Pass insert tree div>div.test after next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted after next_sibling_descendant
+Pass add the class 'test' again to the element in the tree inserted after next_sibling_descendant
+Pass remove tree div>div.test after next_sibling_descendant
+Pass insert tree div>div after next_sibling_descendant
+Pass add the class 'test' to the element in the tree inserted again after next_sibling_descendant
+Pass remove the class 'test' from the element in the tree inserted again after next_sibling_descendant
+Pass remove tree div>div after next_sibling_descendant
+Pass insert element div>div[test_attr] after next_sibling_descendant
+Pass remove element div>div[test_attr] after next_sibling_descendant
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-invalidation-after-removing-non-first-element.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-invalidation-after-removing-non-first-element.txt
new file mode 100644
index 00000000000..a985a3ed0c6
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-invalidation-after-removing-non-first-element.txt
@@ -0,0 +1,12 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 2 tests
+
+2 Pass
+Details
+Result Test Name MessagePass initial_color: div#subject.color
+Pass remove descendant: div#subject.color
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-invalidation-for-wiping-an-element.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-invalidation-for-wiping-an-element.txt
new file mode 100644
index 00000000000..181b14bf0ee
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-invalidation-for-wiping-an-element.txt
@@ -0,0 +1,15 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 5 tests
+
+5 Pass
+Details
+Result Test Name MessagePass initial color: div#subject.color
+Pass color after inserting text and div > .descendant: div#subject.color
+Pass color after wiping #child to remove div > .descendant: div#subject.color
+Pass color after inserting text and #child > .descendant: div#subject.color
+Pass color after wiping #child to remove .descendant: div#subject.color
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-sibling-insertion-removal.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-sibling-insertion-removal.txt
new file mode 100644
index 00000000000..c813d3ab034
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-sibling-insertion-removal.txt
@@ -0,0 +1,38 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 28 tests
+
+28 Pass
+Details
+Result Test Name MessagePass subject1: initial color should be rgb(128, 128, 128)
+Pass subject1: color after #sibling1_1 inserted should be rgb(255, 0, 0)
+Pass subject2: initial color should be rgb(128, 128, 128)
+Pass subject2: color after #sibling2_1 removed should be rgb(0, 128, 0)
+Pass subject3: initial color should be rgb(128, 128, 128)
+Pass subject3: color after #sibling3_1 inserted should be rgb(0, 0, 255)
+Pass subject4: initial color should be rgb(128, 128, 128)
+Pass subject4: color after #sibling4_1 removed should be rgb(255, 255, 0)
+Pass subject5: initial color should be rgb(255, 0, 0)
+Pass subject5: color after #sibling5_1 removed should be rgb(128, 128, 128)
+Pass subject6: initial color should be rgb(0, 128, 0)
+Pass subject6: color after #sibling6_1 inserted should be rgb(128, 128, 128)
+Pass subject7: initial color should be rgb(0, 0, 255)
+Pass subject7: color after #sibling7_1 removed should be rgb(128, 128, 128)
+Pass subject8: initial color should be rgb(255, 255, 0)
+Pass subject8: color after #sibling8_1 inserted should be rgb(128, 128, 128)
+Pass subject9: initial color should be rgb(128, 128, 128)
+Pass subject9: color after #sibling9_1 inserted should be rgb(255, 0, 0)
+Pass subject10: initial color should be rgb(128, 128, 128)
+Pass subject10: color after #sibling10_1 removed should be rgb(0, 128, 0)
+Pass subject11: initial color should be rgb(128, 128, 128)
+Pass subject11: color after #sibling11_1 inserted should be rgb(0, 0, 255)
+Pass subject12: initial color should be rgb(128, 128, 128)
+Pass subject12: color after #sibling12_1 removed should be rgb(255, 255, 0)
+Pass subject13: initial color should be rgb(128, 128, 128)
+Pass subject13: color after #sibling12_1 removed should be rgb(0, 128, 0)
+Pass subject14: initial color should be rgb(0, 128, 0)
+Pass subject14: color after #sibling14_2 removed should be rgb(128, 128, 128)
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-sibling.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-sibling.txt
new file mode 100644
index 00000000000..ffcde038aab
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-sibling.txt
@@ -0,0 +1,81 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 71 tests
+
+71 Pass
+Details
+Result Test Name MessagePass initial_color
+Pass add .test to first_sibling
+Pass remove .test from first_sibling
+Pass add .test to second_sibling
+Pass remove .test from second_sibling
+Pass add .test to third_sibling
+Pass remove .test from third_sibling
+Pass add .test to first_sibling_child
+Pass remove .test from first_sibling_child
+Pass add .test to first_sibling_descendant
+Pass remove .test from first_sibling_descendant
+Pass add .test to third_sibling_child
+Pass remove .test from third_sibling_child
+Pass add .test to third_sibling_descendant
+Pass remove .test from third_sibling_descendant
+Pass insert element div.test before first_sibling
+Pass remove element div.test before first_sibling
+Pass insert element div.test before second_sibling
+Pass remove element div.test before second_sibling
+Pass insert element div.test before third_sibling
+Pass remove element div.test before third_sibling
+Pass insert element div.test before first_sibling_child
+Pass remove element div.test before first_sibling_child
+Pass insert element div.test before first_sibling_descendant
+Pass remove element div.test before first_sibling_descendant
+Pass insert element div.test before third_sibling_child
+Pass remove element div.test before third_sibling_child
+Pass insert element div.test before third_sibling_descendant
+Pass remove element div.test before third_sibling_descendant
+Pass insert element div.test after first_sibling
+Pass remove element div.test after first_sibling
+Pass insert element div.test after second_sibling
+Pass remove element div.test after second_sibling
+Pass insert element div.test after third_sibling
+Pass remove element div.test after third_sibling
+Pass insert element div.test after first_sibling_child
+Pass remove element div.test after first_sibling_child
+Pass insert element div.test after first_sibling_descendant
+Pass remove element div.test after first_sibling_descendant
+Pass insert element div.test after third_sibling_child
+Pass remove element div.test after third_sibling_child
+Pass insert element div.test after third_sibling_descendant
+Pass remove element div.test after third_sibling_descendant
+Pass insert tree div>div.test before first_sibling
+Pass remove tree div>div.test before first_sibling
+Pass insert tree div>div.test before second_sibling
+Pass remove tree div>div.test before second_sibling
+Pass insert tree div>div.test before third_sibling
+Pass remove tree div>div.test before third_sibling
+Pass insert tree div>div.test before first_sibling_child
+Pass remove tree div>div.test before first_sibling_child
+Pass insert tree div>div.test before first_sibling_descendant
+Pass remove tree div>div.test before first_sibling_descendant
+Pass insert tree div>div.test before third_sibling_child
+Pass remove tree div>div.test before third_sibling_child
+Pass insert tree div>div.test before third_sibling_descendant
+Pass remove tree div>div.test before third_sibling_descendant
+Pass insert tree div>div.test after first_sibling
+Pass remove tree div>div.test after first_sibling
+Pass insert tree div>div.test after second_sibling
+Pass remove tree div>div.test after second_sibling
+Pass insert tree div>div.test after third_sibling
+Pass remove tree div>div.test after third_sibling
+Pass insert tree div>div.test after first_sibling_child
+Pass remove tree div>div.test after first_sibling_child
+Pass insert tree div>div.test after first_sibling_descendant
+Pass remove tree div>div.test after first_sibling_descendant
+Pass insert tree div>div.test after third_sibling_child
+Pass remove tree div>div.test after third_sibling_child
+Pass insert tree div>div.test after third_sibling_descendant
+Pass remove tree div>div.test after third_sibling_descendant
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-side-effect.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-side-effect.txt
new file mode 100644
index 00000000000..b9fb3ebb9cb
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-side-effect.txt
@@ -0,0 +1,13 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 3 tests
+
+3 Pass
+Details
+Result Test Name MessagePass Initial colors
+Pass Matches after #blocks_match removed
+Pass Does not match after #blocks_match added
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-unstyled.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-unstyled.txt
new file mode 100644
index 00000000000..4bdd1bc984c
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-unstyled.txt
@@ -0,0 +1,19 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 9 tests
+
+9 Pass
+Details
+Result Test Name MessagePass Initial color
+Pass add test to subject_descendant
+Pass remove test from subject_descendant
+Pass add test to sibling_descendant
+Pass remove test from sibling_descendant
+Pass add test_inner to subject_child
+Pass remove test_inner from subject_child
+Pass add test_inner to sibling_child
+Pass remove test_inner from sibling_child
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nesting-parent-containing-complex.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nesting-parent-containing-complex.txt
new file mode 100644
index 00000000000..66921812282
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nesting-parent-containing-complex.txt
@@ -0,0 +1,47 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 37 tests
+
+37 Pass
+Details
+Result Test Name MessagePass #anchor1 initially white
+Pass #anchor1 becomes rgb(0, 0, 255) after adding .ancestor to #grand_parent1
+Pass #anchor1 becomes rgb(255, 255, 255) after removing .ancestor from #grand_parent1
+Pass #anchor1 becomes rgb(0, 0, 255) after adding .ancestor to #parent1
+Pass #anchor1 becomes rgb(255, 255, 255) after removing .ancestor from #parent1
+Pass #anchor2 initially white
+Pass #anchor2 becomes rgb(173, 216, 230) after adding .ancestor to #grand_parent2
+Pass #anchor2 becomes rgb(255, 255, 255) after removing .ancestor from #grand_parent2
+Pass #anchor2 becomes rgb(173, 216, 230) after adding .ancestor to #parent2
+Pass #anchor2 becomes rgb(255, 255, 255) after removing .ancestor from #parent2
+Pass #anchor3 initially white
+Pass #anchor3 becomes rgb(255, 255, 0) after adding .ancestor_prev to #grand_parent_indirect_prev3
+Pass #anchor3 becomes rgb(154, 205, 50) after adding .ancestor to #grand_parent3
+Pass #anchor3 becomes rgb(255, 255, 0) after removing .ancestor from #grand_parent3
+Pass #anchor3 becomes rgb(255, 255, 255) after removing .ancestor_prev from #grand_parent_indirect_prev3
+Pass #anchor3 becomes rgb(255, 255, 0) after adding .ancestor_prev to #grand_parent_direct_prev3
+Pass #anchor3 becomes rgb(255, 255, 255) after removing .ancestor_prev from #grand_parent_direct_prev3
+Pass #anchor3 becomes rgb(255, 255, 0) after adding .ancestor_prev to #parent_indirect_prev3
+Pass #anchor3 becomes rgb(154, 205, 50) after adding .ancestor to #parent3
+Pass #anchor3 becomes rgb(255, 255, 0) after removing .ancestor from #parent3
+Pass #anchor3 becomes rgb(255, 255, 255) after removing .ancestor_prev from #parent_indirect_prev3
+Pass #anchor3 becomes rgb(255, 255, 0) after adding .ancestor_prev to #parent_direct_prev3
+Pass #anchor3 becomes rgb(255, 255, 255) after removing .ancestor_prev from #parent_direct_prev3
+Pass #anchor3 becomes rgb(255, 255, 0) after adding .ancestor_prev to #anchor_indirect_prev3
+Pass #anchor3 becomes rgb(255, 255, 255) after removing .ancestor_prev from #anchor_indirect_prev3
+Pass #anchor3 becomes rgb(255, 255, 0) after adding .ancestor_prev to #anchor_direct_prev3
+Pass #anchor3 becomes rgb(255, 255, 255) after removing .ancestor_prev from #anchor_direct_prev3
+Pass #anchor4 initially white
+Pass #anchor4 becomes rgb(0, 128, 0) after adding .prev to #indirect_prev4
+Pass #anchor4 becomes rgb(255, 255, 255) after removing .prev from #indirect_prev4
+Pass #anchor4 becomes rgb(0, 128, 0) after adding .prev to #direct_prev4
+Pass #anchor4 becomes rgb(255, 255, 255) after removing .prev from #direct_prev4
+Pass #anchor5 initially white
+Pass #anchor5 becomes rgb(144, 238, 144) after adding .prev to #indirect_prev5
+Pass #anchor5 becomes rgb(255, 255, 255) after removing .prev from #indirect_prev5
+Pass #anchor5 becomes rgb(144, 238, 144) after adding .prev to #direct_prev5
+Pass #anchor5 becomes rgb(255, 255, 255) after removing .prev from #direct_prev5
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nesting-parent-containing-hover.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nesting-parent-containing-hover.txt
new file mode 100644
index 00000000000..2f49ced323f
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nesting-parent-containing-hover.txt
@@ -0,0 +1,11 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 1 tests
+
+1 Fail
+Details
+Result Test Name MessageFail CSS Selector Invalidation: :has() with nesting parent containing :hover promise_test: Unhandled rejection with value: object "ReferenceError: 'test_driver' is not defined"
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-not.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-not.txt
new file mode 100644
index 00000000000..01772770d9c
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-not.txt
@@ -0,0 +1,31 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 21 tests
+
+21 Pass
+Details
+Result Test Name MessagePass Initial color
+Pass remove .test to subject_child
+Pass add .test from subject_child
+Pass remove .test to subject_descendant
+Pass add .test from subject_descendant
+Pass insert element div before subject_child
+Pass remove element div before subject_child
+Pass insert element div before subject_descendant
+Pass remove element div before subject_descendant
+Pass insert element div after subject_child
+Pass remove element div after subject_child
+Pass insert element div after subject_descendant
+Pass remove element div after subject_descendant
+Pass insert tree div>div before subject_child
+Pass remove tree div>div before subject_child
+Pass insert tree div>div before subject_descendant
+Pass remove tree div>div before subject_descendant
+Pass insert tree div.test after subject_child
+Pass remove tree div.test after subject_child
+Pass insert tree div.test after subject_descendant
+Pass remove tree div.test after subject_descendant
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nth-child.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nth-child.txt
new file mode 100644
index 00000000000..701f9daf75a
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-nth-child.txt
@@ -0,0 +1,15 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 5 tests
+
+5 Pass
+Details
+Result Test Name MessagePass Initially red
+Pass :nth-child() no longer matching after removal
+Pass :nth-last-child() no longer matching after removal
+Pass :nth-child() in non-subject no longer matching after removal
+Pass :nth-last-child() in non-subject no longer matching after removal
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-pseudo-class.txt b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-pseudo-class.txt
new file mode 100644
index 00000000000..c3c86685a7a
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/selectors/invalidation/has-with-pseudo-class.txt
@@ -0,0 +1,52 @@
+Summary
+
+Harness status: OK
+
+Rerun
+
+Found 41 tests
+
+22 Pass
+19 Fail
+Details
+Result Test Name MessagePass Before set checked on checkbox, testing subject
+Fail Set checked on checkbox, testing subject assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+Pass Unset checked on checkbox, testing subject
+Fail Set select on option assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+Pass Reset select
+Pass Before set disabled on checkbox, testing subject
+Pass Set disabled on checkbox, testing subject
+Fail Unset disabled on checkbox, testing subject assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 0, 0)"
+Pass Before set disabled on checkbox, testing subject3
+Pass Set disabled on checkbox, testing subject3
+Pass Unset disabled on checkbox, testing subject3
+Fail Before set disabled on option, testing subject assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 0, 0)"
+Pass Set disabled on option, testing subject
+Fail Unset disabled on option, testing subject assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 0, 0)"
+Pass Before set disabled on option, testing subject3
+Pass Set disabled on option, testing subject3
+Pass Unset disabled on option, testing subject3
+Fail Before set disabled on optgroup, testing subject assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 0, 0)"
+Pass Set disabled on optgroup, testing subject
+Fail Unset disabled on optgroup, testing subject assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 0, 0)"
+Fail Before set disabled on optgroup, testing subject2 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
+Pass Set disabled on optgroup, testing subject2
+Fail Unset disabled on optgroup, testing subject2 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
+Pass Before set disabled on optgroup, testing subject3
+Pass Set disabled on optgroup, testing subject3
+Pass Unset disabled on optgroup, testing subject3
+Fail Before set disabled on optgroup, testing subject4 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
+Pass Set disabled on optgroup, testing subject4
+Fail Unset disabled on optgroup, testing subject4 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
+Fail Before setting value of text_input, testing subject assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 0, 0)"
+Fail Set value of text_input, testing subject assert_equals: expected "rgb(255, 255, 0)" but got "rgb(255, 0, 0)"
+Fail Clear value of text_input, testing subject assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 0, 0)"
+Fail Before setting value of text_input, testing subject2 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
+Pass Set value of text_input, testing subject2
+Fail Clear value of text_input, testing subject2 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
+Pass Before setting value of text_input, testing subject3
+Fail Set value of text_input, testing subject3 assert_equals: expected "rgb(255, 255, 0)" but got "rgb(128, 128, 128)"
+Pass Clear value of text_input, testing subject3
+Fail Before setting value of text_input, testing subject4 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
+Pass Set value of text_input, testing subject4
+Fail Clear value of text_input, testing subject4 assert_equals: expected "rgb(128, 128, 128)" but got "rgb(255, 255, 0)"
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-argument-with-explicit-scope.html b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-argument-with-explicit-scope.html
new file mode 100644
index 00000000000..f9448f5e02b
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-argument-with-explicit-scope.html
@@ -0,0 +1,69 @@
+
+
+
:has pseudo class behavior with explicit ':scope' in its argument
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-basic.html b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-basic.html
new file mode 100644
index 00000000000..d1e9af3662c
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-basic.html
@@ -0,0 +1,81 @@
+
+
+Basic matching behavior of :has pseudo class
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-matches-to-uninserted-elements.html b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-matches-to-uninserted-elements.html
new file mode 100644
index 00000000000..17274f9cd74
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-matches-to-uninserted-elements.html
@@ -0,0 +1,37 @@
+
+
+Matches :has pseudo class to uninserted elements
+
+
+
+
+
+
diff --git a/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-relative-argument.html b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-relative-argument.html
new file mode 100644
index 00000000000..6d39544f1ce
--- /dev/null
+++ b/Tests/LibWeb/Text/input/wpt-import/css/selectors/has-relative-argument.html
@@ -0,0 +1,184 @@
+
+
+:has pseudo class behavior with various relative arguments
+
+
+
+
+
+
+