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
[CSS Container Queries] Improper style sharing with container queries
https://bugs.webkit.org/show_bug.cgi?id=241848 Reviewed by Antoine Quint. Elements affected by container queries may get different style even though DOM is perfectly symmetric because containers have different sizes. * LayoutTests/fast/css/container-query-style-sharing-expected.html: Added. * LayoutTests/fast/css/container-query-style-sharing.html: Added. * Source/WebCore/style/StyleSharingResolver.cpp: (WebCore::Style::SharingResolver::canShareStyleWithElement const): Canonical link: https://commits.webkit.org/251731@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 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
@@ -0,0 +1,17 @@ | ||
<style> | ||
body { | ||
display: grid; | ||
grid-template-columns: 100px 50px; | ||
} | ||
div { | ||
background-color: blue; | ||
} | ||
</style> | ||
<body> | ||
<div> | ||
<span style="background-color: green">1</span> | ||
</div> | ||
<div> | ||
<span style="background-color: red">2</span> | ||
</div> | ||
</body> |
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
@@ -0,0 +1,23 @@ | ||
<style> | ||
body { | ||
display: grid; | ||
grid-template-columns: 100px 50px; | ||
} | ||
div { | ||
container-type: inline-size; | ||
background-color: blue; | ||
} | ||
span { background-color: red } | ||
@container (width = 100px) { | ||
span { background-color: green } | ||
} | ||
</style> | ||
<body> | ||
<div> | ||
<span>1</span> | ||
</div> | ||
<div> | ||
<span>2</span> | ||
</div> | ||
</body> | ||
|
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