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

Unified Diff: third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html

Issue 2121173002: [css-grid] Fix percentage height resolution for replaced elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make hasAutoHeightOrContainingBlockWithAutoHeight(bool) private Created 4 years, 5 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 | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html
new file mode 100644
index 0000000000000000000000000000000000000000..93f1700979b0f54aa1c05221ad67c9383908cd5c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-with-percent-height-replaced-element.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+
+<link href="resources/grid.css" rel="stylesheet">
+<link href="resources/grid-alignment.css" rel="stylesheet">
+<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel="stylesheet">
+
+<style>
+ .grid {
+ grid: 200px / 200px;
+ width: 200px;
+ }
+
+ .red {
+ background-color: red;
+ }
+
+ img {
+ height: 100%;
+ display: block;
+ }
+</style>
+
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../resources/check-layout-th.js"></script>
+
+<body onload="checkLayout('.grid')">
+<div id="log"></div>
+
+<p>This test checks that percentage heights are properly resolved for grid items that are replaced elements.
+You shouldn't see any red if the test is working as expected.</p>
+
+<p>1) 100% height on the image (grid item) should be resolved against the height of the grid area (200px).
+Actually we don't need the 100% height in this case as the grid items are stretched by default.</p>
+
+<div class="grid red">
+ <img src="../css/resources/greenbox-100px.png"
+ data-expected-width="200" data-expected-height="200">
+</div>
+
+<p>2) 100% height on the image (grid item's child) should be resolved against the height of the grid item,
+which is stretched by default to the height of the grid area (200px).</p>
+
+
+<div class="grid red">
+ <div data-expected-width="200" data-expected-height="200">
+ <img src="../css/resources/greenbox-100px.png"
+ data-expected-width="200" data-expected-height="200">
+ </div>
+</div>
+
+<p>3) 100% height on the image (grid item) should be resolved against the height of the grid area (200px).
+The grid item is not stretched in this case but the height percentage can be resolved anyway.</p>
+
+<div class="grid red alignItemsStart">
+ <img src="../css/resources/greenbox-100px.png"
+ data-expected-width="200" data-expected-height="200">
+</div>
+
+<p>4) 100% height on the image (grid item's child) should be resolved against the height of the grid item,
+as it's not stretched the grid item's height is indefinite, so the percentage cannot be resolved.</p>
+
+<div class="grid alignItemsStart justifyItemsStart">
+ <div class="firstRowFirstColumn red" style="width: 100px; height: 100px;"
+ data-expected-width="100" data-expected-height="100">
+ </div>
+ <div class="firstRowFirstColumn">
+ <img src="../css/resources/greenbox-100px.png"
+ data-expected-width="100" data-expected-height="100">
+ </div>
+</div>
+
+</body>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698