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

Unified Diff: LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment.html

Issue 1298623002: [CSS Grid Layout] Implement auto-margins alignment of grid items (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't need the resetAutoMargins function. Created 5 years, 3 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
Index: LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment.html
diff --git a/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment.html b/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment.html
new file mode 100644
index 0000000000000000000000000000000000000000..d1ac54367ac7e38e93858421cec0d652ea743fea
--- /dev/null
+++ b/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="resources/grid.css" rel="stylesheet">
+<script src="../../resources/check-layout.js"></script>
+<style>
+body {
+ margin: 0;
+}
+
+.grid {
+ grid-template-columns: 100px 100px;
+ grid-template-rows: 200px 200px;
+ width: -webkit-fit-content;
Manuel Rego 2015/09/24 11:38:26 Do we really need this? I'm also wondering if we
jfernandez 2015/09/25 13:47:01 Well, not mandatory but it helps to check grid ite
Manuel Rego 2015/09/25 16:00:58 Yeah, specially for the different writing modes. S
+ margin-bottom: 20px;
+}
+
+.item {
+ width: 20px;
+ height: 40px;
+}
+
+.autoMarginTop { margin-top: auto; }
+.autoMarginRight { margin-right: auto; }
+.autoMarginBottom { margin-bottom: auto; }
+.autoMarginLeft { margin-left: auto; }
+.autoMargin { margin: auto; }
+
+.itemsCenter {
+ align-items: center;
+ justify-items: center;
+}
+</style>
+</head>
+<body onload="checkLayout('.grid')">
+
+<p>This test checks that aling-self and justify-self properties are not applied when there is auto-margin in the correponding axis. Instead, auto-margin alignment should be applied.</p>
+
+<p>Direction: LTR | Self Aligmment: center | fixed size items | 1 auto-margin</p>
Manuel Rego 2015/09/24 11:38:26 Typo "Aligmment" vs "Alignment". This is repeated
jfernandez 2015/09/25 13:47:01 Done.
+<div style="position: relative">
+ <div class="grid itemsCenter" data-expected-width="200" data-expected-height="400">
Manuel Rego 2015/09/24 11:38:26 I was referring to these lines, I don't think we n
jfernandez 2015/09/25 13:47:01 Acknowledged.
+ <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="40" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="100" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="80" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="140" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>
+ </div>
+</div>
+
+<p>Direction: LTR | Self Aligmment: start | fixed size items | 4 auto-margin</p>
Manuel Rego 2015/09/24 11:38:26 I guess the right thing would be: "Self Alignment:
jfernandez 2015/09/25 13:47:02 Acknowledged.
+<div style="position: relative">
+ <div class="grid" data-expected-width="200" data-expected-height="400">
+ <div class="item autoMargin firstRowFirstColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMargin firstRowSecondColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMargin secondRowFirstColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMargin secondRowSecondColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
+ </div>
+</div>
+
+<p>Direction: LTR | Self Aligmment: center | auto size items | 1 auto-margin</p>
+<div style="position: relative">
+ <div class="grid itemsCenter" data-expected-width="200" data-expected-height="400">
+ <div class="autoMarginTop firstRowFirstColumn" data-offset-x="40" data-offset-y="160" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMarginRight firstRowSecondColumn" data-offset-x="100" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="80" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="140" data-offset-y="200" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ </div>
+</div>
+
+<p>Direction: LTR | Self Aligmment: start | auto size items | 4 auto-margin</p>
Manuel Rego 2015/09/24 11:38:26 "stretch" instead of "start" again.
jfernandez 2015/09/25 13:47:01 Acknowledged.
+<div style="position: relative">
+ <div class="grid" data-expected-width="200" data-expected-height="400">
+ <div class="autoMargin firstRowFirstColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMargin firstRowSecondColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMargin secondRowFirstColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMargin secondRowSecondColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ </div>
+</div>
+
+<!-- direction RTL -->
+<p>Direction: RTL | Self Aligmment: center | fixed size items | 1 auto-margin</p>
+<div style="position: relative">
+ <div class="grid itemsCenter directionRTL" data-expected-width="200" data-expected-height="400">
+ <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="40" data-offset-y="200" data-expected-width="20" data-expected-height="40"></div>
+ </div>
+</div>
+
+<p>Direction: RTL | Self Aligmment: start | fixed size items | 4 auto-margin</p>
+<div style="position: relative">
+ <div class="grid directionRTL" data-expected-width="200" data-expected-height="400">
+ <div class="item autoMargin firstRowFirstColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMargin firstRowSecondColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMargin secondRowFirstColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
+ <div class="item autoMargin secondRowSecondColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"></div>
+ </div>
+</div>
+
+<p>Direction: RTL | Self Aligmment: center | auto size items | 1 auto-margin</p>
+<div style="position: relative">
+ <div class="grid itemsCenter directionRTL" data-expected-width="200" data-expected-height="400">
+ <div class="autoMarginTop firstRowFirstColumn" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="180" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="40" data-offset-y="200" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ </div>
+</div>
+
+<p>Direction: RTL | Self Aligmment: start | auto size items | 4 auto-margin</p>
+<div style="position: relative">
+ <div class="grid directionRTL" data-expected-width="200" data-expected-height="400">
+ <div class="autoMargin firstRowFirstColumn" data-offset-x="140" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMargin firstRowSecondColumn" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMargin secondRowFirstColumn" data-offset-x="140" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ <div class="autoMargin secondRowSecondColumn" data-offset-x="40" data-offset-y="280" data-expected-width="20" data-expected-height="40"><div class="item"></div></div>
+ </div>
+</div>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698