Title: [295264] trunk
Revision
295264
Author
[email protected]
Date
2022-06-04 06:23:27 -0700 (Sat, 04 Jun 2022)

Log Message

Update query container layout unconditionally when ancestor style changes
https://bugs.webkit.org/show_bug.cgi?id=241302

Reviewed by Alan Bujtas.

In some cases we incorrectly optimize away the layout.

* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/display-none-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-004-expected.txt:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveComposedTree):

Do the query container update even when shouldIterateChildren is false. While there is no reason to iterate children
now there may be after the query container layout has been updated.

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

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/display-none-expected.txt (295263 => 295264)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/display-none-expected.txt	2022-06-04 12:48:01 UTC (rev 295263)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/display-none-expected.txt	2022-06-04 13:23:27 UTC (rev 295264)
@@ -16,5 +16,5 @@
 PASS getComputedStyle when originating element is display:none
 PASS getComputedStyle on ::before when ancestor element is display:none
 PASS getComputedStyle on ::before when container is display:none
-FAIL getComputedStyle when in display:none with layout dirty outer element assert_equals: expected "50" but got ""
+PASS getComputedStyle when in display:none with layout dirty outer element
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-004-expected.txt (295263 => 295264)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-004-expected.txt	2022-06-04 12:48:01 UTC (rev 295263)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/pseudo-elements-004-expected.txt	2022-06-04 13:23:27 UTC (rev 295264)
@@ -5,10 +5,10 @@
 PASS Initial color for ::first-line
 PASS Initial color for ::first-letter
 PASS Initial color for ::backdrop
-FAIL Color for ::before depending on container assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
-FAIL Color for ::after depending on container assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
-FAIL Color for ::marker depending on container assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
-FAIL Color for ::first-line depending on container assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
-FAIL Color for ::first-letter depending on container assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
-FAIL Color for ::backdrop depending on container assert_equals: expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)"
+PASS Color for ::before depending on container
+PASS Color for ::after depending on container
+PASS Color for ::marker depending on container
+PASS Color for ::first-line depending on container
+PASS Color for ::first-letter depending on container
+PASS Color for ::backdrop depending on container
 

Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (295263 => 295264)


--- trunk/Source/WebCore/style/StyleTreeResolver.cpp	2022-06-04 12:48:01 UTC (rev 295263)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp	2022-06-04 13:23:27 UTC (rev 295264)
@@ -836,10 +836,8 @@
 
         bool shouldIterateChildren = style && (element.childNeedsStyleRecalc() || descendantsToResolve != DescendantsToResolve::None);
 
-        if (shouldIterateChildren) {
-            if (updateQueryContainer(element, *style, previousContainerType) == QueryContainerAction::Layout)
-                shouldIterateChildren = false;
-        }
+        if (style && updateQueryContainer(element, *style, previousContainerType) == QueryContainerAction::Layout)
+            shouldIterateChildren = false;
 
         if (!m_didSeePendingStylesheet)
             m_didSeePendingStylesheet = hasLoadingStylesheet(m_document.styleScope(), element, !shouldIterateChildren);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to