Index: third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html |
diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..aaeea2ac0fab7170ccca0a055b5cb983b74d4e98 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html |
@@ -0,0 +1,123 @@ |
+<!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; |
+ 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 on a vertical-lr grid 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 Alignment: center | fixed size items | 1 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR itemsCenter"> |
+ <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="60" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="100" data-expected-width="20" data-expected-height="40"></div> |
+ </div> |
+</div> |
+ |
+<p>Direction: LTR | Self Alignment: stretch | fixed size items | 4 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR"> |
+ <div class="item autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
+ </div> |
+</div> |
+ |
+<p>Direction: LTR | Self Alignment: center | auto size items | 1 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR itemsCenter"> |
+ <div class="autoMarginTop firstRowFirstColumn" data-offset-x="90" data-offset-y="60" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMarginRight firstRowSecondColumn" data-offset-x="0" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="100" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ </div> |
+</div> |
+ |
+<p>Direction: LTR | Self Alignment: stretch | auto size items | 4 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR"> |
+ <div class="autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ </div> |
+</div> |
+ |
+<!-- direction RTL --> |
+<p>Direction: RTL | Self Alignment: center | fixed size items | 1 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR itemsCenter directionRTL"> |
+ <div class="item autoMarginTop firstRowFirstColumn" data-offset-x="90" 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="30" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div> |
+ </div> |
+</div> |
+ |
+ |
+<p>Direction: RTL | Self Alignment: stretch | fixed size items | 4 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR directionRTL"> |
+ <div class="item autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
+ <div class="item autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
+ </div> |
+</div> |
+ |
+<p>Direction: RTL | Self Alignment: center | auto size items | 1 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR itemsCenter directionRTL"> |
+ <div class="autoMarginTop firstRowFirstColumn" data-offset-x="90" 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="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMarginLeft secondRowFirstColumn" data-offset-x="380" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMarginBottom secondRowSecondColumn" data-offset-x="290" data-offset-y="0" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ </div> |
+</div> |
+ |
+ |
+<p>Direction: RTL | Self Alignment: stretch | auto size items | 4 auto-margin</p> |
+<div style="position: relative"> |
+ <div class="grid verticalLR directionRTL"> |
+ <div class="autoMargin firstRowFirstColumn" data-offset-x="90" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMargin firstRowSecondColumn" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMargin secondRowFirstColumn" data-offset-x="290" data-offset-y="130" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ <div class="autoMargin secondRowSecondColumn" data-offset-x="290" data-offset-y="30" data-expected-width="20" data-expected-height="40"><div class="item"></div></div> |
+ </div> |
+</div> |
+ |
+</body> |
+</html> |