Commit 334b1dda authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Chromium LUCI CQ

Make container queries rely on size containment.

Bug: 1146097
Change-Id: I73f285c2c8cc828ae11132ae3c57148670b30b76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2621813Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842497}
parent 75b4a953
......@@ -3746,9 +3746,14 @@ void SetDependsOnContainerQueries(HTMLCollection& affected) {
TEST_F(StyleEngineTest, UpdateStyleAndLayoutTreeForContainer) {
GetDocument().body()->setInnerHTML(R"HTML(
<div id="container1" style="contain:layout">
<style>
.container {
contain: layout size;
}
</style>
<div id="container1" class="container">
<span class="affected"></span>
<div id="container2" style="contain:layout" class="affected">
<div id="container2" class="container affected">
<span class="affected"></span>
<span></span>
<span class="affected"></span>
......@@ -3763,7 +3768,7 @@ TEST_F(StyleEngineTest, UpdateStyleAndLayoutTreeForContainer) {
</div>
</div>
<span></span>
<div id="container3" style="contain:layout">
<div id="container3" class="container">
<span class="affected"></span>
<span class="affected"></span>
</div>
......@@ -3795,7 +3800,7 @@ TEST_F(StyleEngineTest, UpdateStyleAndLayoutTreeForContainer) {
TEST_F(StyleEngineTest, MarkStyleDirtyFromContainerRecalc) {
GetDocument().body()->setInnerHTML(R"HTML(
<div id="container" style="contain:layout">
<div id="container" style="contain: layout size">
<input id="input" type="text" class="affected">
</div>
)HTML");
......
......@@ -2662,7 +2662,9 @@ class ComputedStyle : public ComputedStyleBase,
return LogicalSize(LayoutUnit(ratio.Width()), LayoutUnit(ratio.Height()));
}
bool IsContainerForContainerQueries() const { return ContainsLayout(); }
bool IsContainerForContainerQueries() const {
return ContainsLayout() && ContainsSize();
}
private:
EClear Clear() const { return ClearInternal(); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment