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

Unified Diff: LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html

Issue 842193004: [css-grid] Handle alignment with orthogonal flows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@orthogonal-flows
Patch Set: Implemented logic for self-start/end values. Created 5 years, 11 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-alignment-with-orthogonal-flows.html
diff --git a/LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html b/LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html
new file mode 100644
index 0000000000000000000000000000000000000000..cc8ad9efb3327234b02dcc7f4251ec01b0c7d06c
--- /dev/null
+++ b/LayoutTests/fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html
@@ -0,0 +1,187 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link href="resources/grid.css" rel="stylesheet">
+<script src="../../resources/check-layout.js"></script>
+<style>
+body {
+ margin: 0;
+}
+.container {
+ position: relative;
+}
+.grid {
+ font: 10px/1 Ahem;
+ grid-template-columns: 20px 50px;
+ grid-template-rows: 150px 150px;
+ width: -webkit-fit-content;
+}
+.start {
+ align-self: start;
+ justify-self: start;
+}
+.end {
+ align-self: end;
+ justify-self: end;
+}
+.center {
+ align-self: center;
+ justify-self: center;
+}
+.right {
+ align-self: right;
+ justify-self: right;
+}
+.left {
+ align-self: left;
+ justify-self: left;
+}
+.selfStart {
+ align-self: self-start;
+ justify-self: self-start;
+}
+.selfEnd {
+ align-self: self-end;
+ justify-self: self-end;
+}
+.itemsCenter {
+ align-items: center;
+ justify-items: center;
+}
+</style>
+</head>
+<body onload="checkLayout('.grid')">
+
+<p>This test checks that grid items positioning works as expected with orthogonal flows.</p>
+
+<p>Orthogonal flows: HORIZONTAL-TB vs VERTICAL-RL</p>
+<p>Direction: LTR vs LTR</p>
+<div class="container">
+ <div class="grid directionLTR" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionLTR verticalRL end" data-offset-x="10" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionLTR verticalRL center" data-offset-x="40" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionLTR verticalRL left" data-offset-x="0" data-offset-y="150" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionLTR verticalRL right" data-offset-x="60" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+<div class="container">
+ <div class="grid directionLTR itemsCenter" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionLTR verticalRL selfEnd" data-offset-x="0" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionLTR verticalRL" data-offset-x="40" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionLTR verticalRL" data-offset-x="5" data-offset-y="160" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionLTR verticalRL selfStart" data-offset-x="60" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+
+<p>Direction: RTL vs LTR</p>
+<div class="container">
+ <div class="grid directionRTL" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionLTR verticalRL end" data-offset-x="50" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionLTR verticalRL center" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionLTR verticalRL left" data-offset-x="50" data-offset-y="150" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionLTR verticalRL right" data-offset-x="40" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+<div class="container">
+ <div class="grid directionRTL itemsCenter" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionLTR verticalRL selfEnd" data-offset-x="50" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionLTR verticalRL" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionLTR verticalRL" data-offset-x="55" data-offset-y="160" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionLTR verticalRL selfStart" data-offset-x="40" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+
+<p>Direction: LTR vs RTL</p>
+<div class="container">
+ <div class="grid directionLTR" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionRTL verticalRL end" data-offset-x="10" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionRTL verticalRL center" data-offset-x="40" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionRTL verticalRL left" data-offset-x="0" data-offset-y="150" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionRTL verticalRL right" data-offset-x="60" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+<div class="container">
+ <div class="grid directionLTR itemsCenter" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionRTL verticalRL selfEnd" data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionRTL verticalRL" data-offset-x="40" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionRTL verticalRL" data-offset-x="5" data-offset-y="160" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionRTL verticalRL selfStart" data-offset-x="60" data-offset-y="230" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+
+<p>Direction: RTL vs RTL</p>
+<div class="container">
+ <div class="grid directionRTL" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionRTL verticalRL end" data-offset-x="50" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionRTL verticalRL center" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionRTL verticalRL left" data-offset-x="50" data-offset-y="150" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionRTL verticalRL right" data-offset-x="40" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+<div class="container">
+ <div class="grid directionRTL itemsCenter" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionRTL verticalRL selfEnd" data-offset-x="50" data-offset-y="0" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionRTL verticalRL" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionRTL verticalRL" data-offset-x="55" data-offset-y="160" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionRTL verticalRL selfStart" data-offset-x="40" data-offset-y="230" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+
+<!-- HORIZONTAL-TB vs VERTICAL-LR -->
+<p>Orthogonal flows: HORIZONTAL-TB vs VERTICAL-LR</p>
+<p>Direction: LTR vs LTR</p>
+<div class="container">
+ <div class="grid" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn verticalLR end" data-offset-x="10" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn verticalLR center" data-offset-x="40" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn verticalLR left" data-offset-x="0" data-offset-y="150" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn verticalLR right" data-offset-x="60" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+<div class="container">
+ <div class="grid itemsCenter" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn verticalLR selfEnd" data-offset-x="10" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn verticalLR" data-offset-x="40" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn verticalLR" data-offset-x="5" data-offset-y="160" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn verticalLR selfStart" data-offset-x="20" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+
+<p>Direction: RTL vs LTR</p>
+<div class="container">
+ <div class="grid directionRTL" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionLTR verticalLR end" data-offset-x="50" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionLTR verticalLR center" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionLTR verticalLR left" data-offset-x="50" data-offset-y="150" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionLTR verticalLR right" data-offset-x="40" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+<div class="container">
+ <div class="grid directionRTL itemsCenter" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionLTR verticalLR selfEnd" data-offset-x="60" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionLTR verticalLR" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionLTR verticalLR" data-offset-x="55" data-offset-y="160" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionLTR verticalLR selfStart" data-offset-x="00" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+
+<p>Direction: RTL vs RTL</p>
+<div class="container">
+ <div class="grid directionRTL" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionRTL verticalLR end" data-offset-x="50" data-offset-y="20" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionRTL verticalLR center" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionRTL verticalLR left" data-offset-x="50" data-offset-y="150" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionRTL verticalLR right" data-offset-x="40" data-offset-y="150" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+<div class="container">
+ <div class="grid directionRTL itemsCenter" data-expected-width="70" data-expected-height="300">
+ <div class="firstRowFirstColumn directionRTL verticalLR selfEnd" data-offset-x="60" data-offset-y="0" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="firstRowSecondColumn directionRTL verticalLR" data-offset-x="20" data-offset-y="40" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ <div class="secondRowFirstColumn directionRTL verticalLR" data-offset-x="55" data-offset-y="160" data-expected-width="10" data-expected-height="130">XXXXXXXXXXXXX</div>
+ <div class="secondRowSecondColumn directionRTL verticalLR selfStart" data-offset-x="0" data-offset-y="230" data-expected-width="10" data-expected-height="70">XXXXXXX</div>
+ </div>
+</div>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698