Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: LayoutTests/fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-margin-change.html

Issue 1145183003: [CSS Grid Layout] Clear stretched height when conditions don't allow it. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied suggested changes. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-margin-change-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-margin-change.html
diff --git a/LayoutTests/fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-margin-change.html b/LayoutTests/fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-margin-change.html
new file mode 100644
index 0000000000000000000000000000000000000000..e432c6666bd20bb3c09577342fd11c19d4cdf46c
--- /dev/null
+++ b/LayoutTests/fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-margin-change.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<link href="resources/grid.css" rel="stylesheet">
+<script src="../../resources/check-layout.js"></script>
+<style>
+.grid {
+ grid-template: 200px 200px / 200px 200px;
+ width: -webkit-fit-content;
+ position: relative;
+}
+#fromFixedHeight { height: 100px; }
+#fromMarginAuto { margin: auto; }
+</style>
+<p>The grids below had initially 'stretched' items, but we have changed 'height' and 'margin' to values which don't allow stretch. This test verifies that the layout algorithm properly detects such changes and clear the override height accordingly.</p>
+<div class="grid">
+ <div id="toFixedHeight" class="firstRowFirstColumn" data-expected-height="100"></div>
+ <div class="firstRowSecondColumn" data-expected-height="200"></div>
+ <div class="secondRowFirstColumn" data-expected-height="200"></div>
+ <div id="fromFixedHeight" class="secondRowSecondColumn" data-expected-height="200"></div>
+</div>
+<div class="grid">
+ <div id="toMarginAuto" class="firstRowFirstColumn" data-expected-height="100">
+ <div style="height: 100px"></div>
+ </div>
+ <div class="firstRowSecondColumn" data-expected-height="200"></div>
+ <div class="secondRowFirstColumn" data-expected-height="200"></div>
+ <div id="fromMarginAuto" class="secondRowSecondColumn" data-expected-height="200">
+ <div style="height: 100px"></div>
+ </div>
+</div>
+<script>
+document.body.offsetLeft;
+document.getElementById("fromFixedHeight").style.height = "auto";
+document.getElementById("toFixedHeight").style.height = "100px";
+document.getElementById("fromMarginAuto").style.margin = "0";
+document.getElementById("toMarginAuto").style.margin = "auto";
+checkLayout(".grid");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css-grid-layout/grid-items-should-not-be-stretched-when-height-or-margin-change-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698