| <!DOCTYPE html> |
| <html> |
| <head> |
| <link href="resources/grid.css" rel="stylesheet"> |
| <link href="resources/grid-alignment.css" rel="stylesheet"> |
| <script src="../../resources/check-layout.js"></script> |
| <style> |
| body { |
| margin: 0px; |
| } |
| |
| .grid { |
| grid-auto-columns: 20px; |
| grid-auto-rows: 40px; |
| grid-template-areas: "a a b" |
| "c d b"; |
| position: relative; |
| width: 300px; |
| height: 200px; |
| } |
| .a { |
| grid-area: a; |
| background-color: blue; |
| } |
| .b { |
| grid-area: b; |
| background-color: lime; |
| } |
| .c { |
| grid-area: c; |
| background-color: purple; |
| } |
| .d { |
| grid-area: d; |
| background-color: orange; |
| } |
| .stretchedGrid { |
| grid-auto-columns: minmax(20px, auto); |
| grid-auto-rows: minmax(40px, auto); |
| } |
| |
| |
| .cell { |
| width: 20px; |
| height: 40px; |
| } |
| </style> |
| </head> |
| <body onload="checkLayout('.grid')"> |
| |
| <p>This test checks that Content Distribution alignment works fine in combination with Self Alignmet and items span more than one track.</p> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'space-between' | self-alignment: center</p> |
| <div class="grid contentSpaceBetween" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter" data-offset-x="70" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfCenter" data-offset-x="280" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="0" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'space-between' | self-alignment: end</p> |
| <div class="grid contentSpaceBetween" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd" data-offset-x="140" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfEnd" data-offset-x="280" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="0" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'space-around' | self-alignment: center</p> |
| <div class="grid contentSpaceAround" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfCenter" data-offset-x="240" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="40" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'space-around' | self-alignment: end</p> |
| <div class="grid contentSpaceAround" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd" data-offset-x="140" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfEnd" data-offset-x="240" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="40" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'space-evenly' | self-alignment: center</p> |
| <div class="grid contentSpaceEvenly" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter" data-offset-x="100" data-offset-y="40" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfCenter" data-offset-x="220" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="60" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'space-evenly' | self-alignment: end</p> |
| <div class="grid contentSpaceEvenly" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd" data-offset-x="140" data-offset-y="40" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfEnd" data-offset-x="220" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="60" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'stretch' | self-alignment: center</p> |
| <div class="grid stretchedGrid contentStretch" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter alignSelfCenter" data-offset-x="90" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell justifySelfCenter alignSelfCenter" data-offset-x="240" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="0" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| <div class="d" data-offset-x="100" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: LTR | distribution: 'stretch' | self-alignment: end</p> |
| <div class="grid stretchedGrid contentStretch" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd alignSelfEnd" data-offset-x="180" data-offset-y="60" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell justifySelfEnd alignSelfEnd" data-offset-x="280" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="0" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| <div class="d" data-offset-x="100" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| </div> |
| </div> |
| |
| <!-- RTL direction. --> |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'space-between' | self-alignment: center</p> |
| <div class="grid contentSpaceBetween directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter" data-offset-x="210" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfCenter" data-offset-x="0" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="280" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'space-between' | self-alignment: end</p> |
| <div class="grid contentSpaceBetween directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd" data-offset-x="140" data-offset-y="0" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfEnd" data-offset-x="0" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="280" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'space-around' | self-alignment: center</p> |
| <div class="grid contentSpaceAround directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter" data-offset-x="190" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfCenter" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="240" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'space-around' | self-alignment: end</p> |
| <div class="grid contentSpaceAround directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd" data-offset-x="140" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfEnd" data-offset-x="40" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="240" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="130" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'space-evenly' | self-alignment: center</p> |
| <div class="grid contentSpaceEvenly directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter" data-offset-x="180" data-offset-y="40" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfCenter" data-offset-x="60" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="220" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'space-evenly' | self-alignment: end</p> |
| <div class="grid contentSpaceEvenly directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd" data-offset-x="140" data-offset-y="40" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell alignSelfEnd" data-offset-x="60" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="220" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| <div class="d" data-offset-x="140" data-offset-y="120" data-expected-width="20" data-expected-height="40"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'stretch' | self-alignment: center</p> |
| <div class="grid stretchedGrid contentStretch directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfCenter alignSelfCenter" data-offset-x="190" data-offset-y="30" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell justifySelfCenter alignSelfCenter" data-offset-x="40" data-offset-y="80" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="200" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| <div class="d" data-offset-x="100" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>direction: RTL | distribution: 'stretch' | self-alignment: end</p> |
| <div class="grid stretchedGrid contentStretch directionRTL" data-expected-width="300" data-expected-height="200"> |
| <div class="a cell justifySelfEnd alignSelfEnd" data-offset-x="100" data-offset-y="60" data-expected-width="20" data-expected-height="40"></div> |
| <div class="b cell justifySelfEnd alignSelfEnd" data-offset-x="0" data-offset-y="160" data-expected-width="20" data-expected-height="40"></div> |
| <div class="c" data-offset-x="200" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| <div class="d" data-offset-x="100" data-offset-y="100" data-expected-width="100" data-expected-height="100"></div> |
| </div> |
| </div> |
| |
| </body> |
| </html> |