Title: [294423] trunk
Revision
294423
Author
[email protected]
Date
2022-05-18 12:21:18 -0700 (Wed, 18 May 2022)

Log Message

Invalidation fails if the mutated elements subtree has been marked invalid
https://bugs.webkit.org/show_bug.cgi?id=240581

Reviewed by Alan Bujtas.

:has() can affect elements outside the subtree so we can't use this optimization if it is present.

* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-adjacent-position-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-ancestor-position-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-parent-position-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-sibling-position-expected.txt:

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::needsStyleInvalidation const):

Don't skip invalidation for a locally invalid subtree if :has() is present.
Add a new check for document element subtree being invalid (this covers some of the same cases and works with :has()).

* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::forNode):

Add const version.

* Source/WebCore/style/StyleScope.h:

Canonical link: https://commits.webkit.org/250706@main

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-adjacent-position-expected.txt (294422 => 294423)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-adjacent-position-expected.txt	2022-05-18 19:19:48 UTC (rev 294422)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-adjacent-position-expected.txt	2022-05-18 19:21:18 UTC (rev 294423)
@@ -29,7 +29,7 @@
 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
-FAIL add the class 'test' to the element inserted again before previous_sibling_child assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -39,7 +39,7 @@
 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
-FAIL add the class 'test' to the element inserted again before previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -69,7 +69,7 @@
 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
-FAIL add the class 'test' to the element inserted again before next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -79,7 +79,7 @@
 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
-FAIL add the class 'test' to the element inserted again before next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -99,7 +99,7 @@
 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
-FAIL add the class 'test' to the element inserted again after previous_sibling_child assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -109,7 +109,7 @@
 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
-FAIL add the class 'test' to the element inserted again after previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -139,7 +139,7 @@
 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
-FAIL add the class 'test' to the element inserted again after next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -149,7 +149,7 @@
 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
-FAIL add the class 'test' to the element inserted again after next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -169,7 +169,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before previous_sibling_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -179,7 +179,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -209,7 +209,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -219,7 +219,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -239,7 +239,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after previous_sibling_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -249,7 +249,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -279,7 +279,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -289,7 +289,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-ancestor-position-expected.txt (294422 => 294423)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-ancestor-position-expected.txt	2022-05-18 19:19:48 UTC (rev 294422)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-ancestor-position-expected.txt	2022-05-18 19:21:18 UTC (rev 294423)
@@ -31,7 +31,7 @@
 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
-FAIL add the class 'test' to the element inserted again before subject_parent assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -41,7 +41,7 @@
 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
-FAIL add the class 'test' to the element inserted again before subject assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -51,7 +51,7 @@
 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
-FAIL add the class 'test' to the element inserted again before subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -61,7 +61,7 @@
 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
-FAIL add the class 'test' to the element inserted again before subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -71,7 +71,7 @@
 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
-FAIL add the class 'test' to the element inserted again before next_sibling assert_equals: expected "rgb(0, 0, 255)" but got "rgb(128, 128, 128)"
+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
@@ -81,7 +81,7 @@
 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
-FAIL add the class 'test' to the element inserted again before next_sibling_child assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -91,7 +91,7 @@
 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
-FAIL add the class 'test' to the element inserted again before next_sibling_descendant assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -101,7 +101,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject_ancestor assert_equals: expected "rgb(0, 0, 255)" but got "rgb(128, 128, 128)"
+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
@@ -111,7 +111,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject_parent assert_equals: expected "rgb(0, 0, 255)" but got "rgb(128, 128, 128)"
+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
@@ -121,7 +121,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -131,7 +131,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -141,7 +141,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -151,7 +151,7 @@
 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
-FAIL add the class 'test' to the element inserted again after next_sibling assert_equals: expected "rgb(255, 255, 0)" but got "rgb(128, 128, 128)"
+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
@@ -161,7 +161,7 @@
 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
-FAIL add the class 'test' to the element inserted again after next_sibling_child assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -171,7 +171,7 @@
 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
-FAIL add the class 'test' to the element inserted again after next_sibling_descendant assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -191,7 +191,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before subject_parent assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -201,7 +201,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before subject assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -211,7 +211,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -221,7 +221,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -231,7 +231,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before next_sibling assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -241,7 +241,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before next_sibling_child assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -251,7 +251,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before next_sibling_descendant assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -261,7 +261,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject_ancestor assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -271,7 +271,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject_parent assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -281,7 +281,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -291,7 +291,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -301,7 +301,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -311,7 +311,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after next_sibling assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -321,7 +321,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after next_sibling_child assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -331,7 +331,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after next_sibling_descendant assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-parent-position-expected.txt (294422 => 294423)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-parent-position-expected.txt	2022-05-18 19:19:48 UTC (rev 294422)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-parent-position-expected.txt	2022-05-18 19:21:18 UTC (rev 294423)
@@ -35,7 +35,7 @@
 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
-FAIL add the class 'test' to the element inserted again before subject assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -45,7 +45,7 @@
 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
-FAIL add the class 'test' to the element inserted again before subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -55,7 +55,7 @@
 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
-FAIL add the class 'test' to the element inserted again before subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -75,7 +75,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject_parent assert_equals: expected "rgb(0, 0, 255)" but got "rgb(128, 128, 128)"
+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
@@ -85,7 +85,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -95,7 +95,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -105,7 +105,7 @@
 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
-FAIL add the class 'test' to the element inserted again after subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -135,7 +135,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before subject assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -145,7 +145,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -155,7 +155,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -175,7 +175,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject_parent assert_equals: expected "rgb(255, 192, 203)" but got "rgb(128, 128, 128)"
+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
@@ -185,7 +185,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -195,7 +195,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -205,7 +205,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after subject_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-sibling-position-expected.txt (294422 => 294423)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-sibling-position-expected.txt	2022-05-18 19:19:48 UTC (rev 294422)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/has-in-sibling-position-expected.txt	2022-05-18 19:21:18 UTC (rev 294423)
@@ -29,7 +29,7 @@
 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
-FAIL add the class 'test' to the element inserted again before previous_sibling_child assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -39,7 +39,7 @@
 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
-FAIL add the class 'test' to the element inserted again before previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -69,7 +69,7 @@
 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
-FAIL add the class 'test' to the element inserted again before next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -79,7 +79,7 @@
 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
-FAIL add the class 'test' to the element inserted again before next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -99,7 +99,7 @@
 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
-FAIL add the class 'test' to the element inserted again after previous_sibling_child assert_equals: expected "rgb(0, 128, 0)" but got "rgb(128, 128, 128)"
+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
@@ -109,7 +109,7 @@
 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
-FAIL add the class 'test' to the element inserted again after previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -139,7 +139,7 @@
 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
-FAIL add the class 'test' to the element inserted again after next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -149,7 +149,7 @@
 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
-FAIL add the class 'test' to the element inserted again after next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -169,7 +169,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before previous_sibling_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -179,7 +179,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -209,7 +209,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -219,7 +219,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again before next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -239,7 +239,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after previous_sibling_child assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -249,7 +249,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after previous_sibling_descendant assert_equals: expected "rgb(255, 0, 0)" but got "rgb(128, 128, 128)"
+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
@@ -279,7 +279,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after next_sibling_child assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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
@@ -289,7 +289,7 @@
 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
-FAIL add the class 'test' to the element in the tree inserted again after next_sibling_descendant assert_equals: expected "rgb(128, 0, 128)" but got "rgb(128, 128, 128)"
+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

Modified: trunk/Source/WebCore/dom/Element.cpp (294422 => 294423)


--- trunk/Source/WebCore/dom/Element.cpp	2022-05-18 19:19:48 UTC (rev 294422)
+++ trunk/Source/WebCore/dom/Element.cpp	2022-05-18 19:21:18 UTC (rev 294423)
@@ -3762,8 +3762,11 @@
 {
     if (!inRenderedDocument())
         return false;
-    if (styleValidity() >= Style::Validity::SubtreeInvalid)
+    // If :has() is present a change in an element may affect elements outside its subtree.
+    if (styleValidity() >= Style::Validity::SubtreeInvalid && !Style::Scope::forNode(*this).usesHasPseudoClass())
         return false;
+    if (document().documentElement() && document().documentElement()->styleValidity() >= Style::Validity::SubtreeInvalid)
+        return false;
     if (document().hasPendingFullStyleRebuild())
         return false;
 

Modified: trunk/Source/WebCore/style/StyleScope.cpp (294422 => 294423)


--- trunk/Source/WebCore/style/StyleScope.cpp	2022-05-18 19:19:48 UTC (rev 294422)
+++ trunk/Source/WebCore/style/StyleScope.cpp	2022-05-18 19:21:18 UTC (rev 294423)
@@ -188,6 +188,11 @@
     return node.document().styleScope();
 }
 
+const Scope& Scope::forNode(const Node& node)
+{
+    return forNode(const_cast<Node&>(node));
+}
+
 Scope* Scope::forOrdinal(Element& element, ScopeOrdinal ordinal)
 {
     if (ordinal == ScopeOrdinal::Element)

Modified: trunk/Source/WebCore/style/StyleScope.h (294422 => 294423)


--- trunk/Source/WebCore/style/StyleScope.h	2022-05-18 19:19:48 UTC (rev 294422)
+++ trunk/Source/WebCore/style/StyleScope.h	2022-05-18 19:21:18 UTC (rev 294423)
@@ -127,6 +127,7 @@
     ShadowRoot* shadowRoot() { return m_shadowRoot; }
 
     static Scope& forNode(Node&);
+    static const Scope& forNode(const Node&);
     static Scope* forOrdinal(Element&, ScopeOrdinal);
 
     struct QueryContainerUpdateContext {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to