| <!DOCTYPE html> |
| <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: 0; |
| } |
| |
| .grid { |
| position: relative; |
| width: 200px; |
| height: 300px; |
| } |
| |
| .fractionFlexTracks { |
| grid-template-columns: auto 0.25fr; |
| grid-template-rows: 0.2fr auto; |
| } |
| |
| .flexTracks { |
| grid-template-columns: auto 1fr; |
| grid-template-rows: 1.5fr auto; |
| } |
| |
| </style> |
| </head> |
| <body onload="checkLayout('.grid')"> |
| <p>This test verifies that we don't crash in debug builds when using flex tracks and 'stretch' value for the content alignment css properties.</p> |
| |
| <div style="position: relative"> |
| <p>When the sum of all track's flex factor is < 1, they don't exhaust the available space, which is used to stretch the 'auto' sized tracks.</p> |
| <div class="grid fractionFlexTracks contentStretch" data-expected-width="200" data-expected-height="300"> |
| <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="150" data-expected-height="60"></div> |
| <div class="firstRowSecondColumn" data-offset-x="150" data-offset-y="0" data-expected-width="50" data-expected-height="60"></div> |
| <div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="60" data-expected-width="150" data-expected-height="240"></div> |
| <div class="secondRowSecondColumn" data-offset-x="150" data-offset-y="60" data-expected-width="50" data-expected-height="240"></div> |
| </div> |
| </div> |
| |
| <div style="position: relative"> |
| <p>When the sum of all track's flex factor is >= 1, they exhaust the available space, hence the 'stretch' alignment is not applied to the 'auto' sized tracks.</p> |
| <div class="grid flexTracks contentStretch" data-expected-width="200" data-expected-height="300"> |
| <div class="firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="0" data-expected-height="300"></div> |
| <div class="firstRowSecondColumn" data-offset-x="0" data-offset-y="0" data-expected-width="200" data-expected-height="300"></div> |
| <div class="secondRowFirstColumn" data-offset-x="0" data-offset-y="300" data-expected-width="0" data-expected-height="0"></div> |
| <div class="secondRowSecondColumn" data-offset-x="0" data-offset-y="300" data-expected-width="200" data-expected-height="0"></div> |
| </div> |
| </div> |
| </body> |