Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Correctly resolve queries when container size is affected by a subseq…
…uent sibling https://bugs.webkit.org/show_bug.cgi?id=241457 Reviewed by Alan Bujtas. We currently only take style changes before the container into account. This patch changes the query container resolution so that whenever we encounter a query container we skip the subtree and restart the resolution from the main resolution loop. This way we can optimize away unnecessary layouts while also handling backward dependencies. * LayoutTests/imported/w3c/web-platform-tests/css/css-contain/container-queries/sibling-layout-dependency-expected.txt: * Source/WebCore/dom/Document.cpp: (WebCore::Document::resolveStyle): Loop also when there are no style changes to apply but there are unresolved container. In this case we just resume the style resolution where we left it. * Source/WebCore/dom/Element.cpp: (WebCore::Element::invalidateForQueryContainerChange): Invalidate all descendants when a query container is resized. In practice we ended up computing them all anyway. * Source/WebCore/style/StyleChange.cpp: (WebCore::Style::determineChange): * Source/WebCore/style/StyleChange.h: Add new Descendants value for when container type or name changes. * Source/WebCore/style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::computeDescendantsToResolve): (WebCore::Style::TreeResolver::pushParent): (WebCore::Style::TreeResolver::popParent): (WebCore::Style::TreeResolver::resolveComposedTree): (WebCore::Style::TreeResolver::determineQueryContainerAction): Use two buckets for unresolved and resolved containers. Use the resolved bucket to avoid recomputing containers we have resolved already. (WebCore::Style::TreeResolver::resolve): Move the containers from the unresolved to resolved bucket in the beginning. (WebCore::Style::TreeResolver::updateQueryContainer): Deleted. * Source/WebCore/style/StyleTreeResolver.h: Canonical link: https://commits.webkit.org/251424@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
7 changed files
with
56 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
XXXX | ||
|
||
FAIL Sibling style mutation assert_equals: expected "10" but got "20" | ||
FAIL Sibling style mutation, parent is affected assert_equals: expected "10" but got "20" | ||
FAIL Sibling style mutation, ancestor is affected assert_equals: expected "10" but got "20" | ||
FAIL Sibling text mutation assert_equals: expected "10" but got "20" | ||
PASS Sibling style mutation | ||
PASS Sibling style mutation, parent is affected | ||
PASS Sibling style mutation, ancestor is affected | ||
PASS Sibling text mutation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -36,6 +36,7 @@ enum class Change : uint8_t { | ||
NonInherited, | ||
FastPathInherited, | ||
Inherited, | ||
Descendants, | ||
Renderer | ||
}; | ||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters