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-change-alignment-from-stretch.html

Issue 2832783003: [css-grid] Clearing the override height before layout (Closed)
Patch Set: Modified comment, as requested. Created 3 years, 8 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/GridTrackSizingAlgorithm.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-change-alignment-from-stretch.html
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-change-alignment-from-stretch.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-change-alignment-from-stretch.html
new file mode 100644
index 0000000000000000000000000000000000000000..f936208bc792d02a9196046768e055f48088366e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-change-alignment-from-stretch.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<link href="../css-intrinsic-dimensions/resources/width-keyword-classes.css" rel="stylesheet">
+<link href="resources/grid.css" rel="stylesheet">
+<link href="resources/grid-alignment.css" rel="stylesheet">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+.grid {
+ position: relative;
+ grid-template-columns: 100px;
+ grid-template-rows: 200px;
+ font: 10px/1 ahem;
+}
+</style>
+<p>Test to verify that grid item's stretched size is reset when changing to a different alignment value.</p>
+<div class="grid fit-content">
+ <div id="item">XXXXX</div>
+</div>
+<script>
+"use strict";
+var child = document.getElementById("item");
+const values = ['self-start', 'self-end', 'start', 'end', 'center', 'right', 'left', 'baseline'];
+values.forEach(function(value) {
+ child.style.alignSelf = 'stretch';
+ child.style.justifySelf = 'stretch';
+ test(function() {
+ assert_equals(child.offsetWidth, 100, "The width is not what it should:");
+ assert_equals(child.offsetHeight, 200, "The height is not what it should:");
+ }, "Checking stretched size before changing to " + value + ".");
+
+ child.style.alignSelf = value;
+ child.style.justifySelf = value;
+ test(function() {
+ assert_equals(child.offsetWidth, 50, "The width is not what it should:");
+ assert_equals(child.offsetHeight, 10, "The height is not what it should:");
+ }, "Checking size after changing to " + value + ".");
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698