[CSS Grid Layout] Rename grid-{rows|columns} to grid-definition-{rows|columns}
[WebKit-https.git] / LayoutTests / fast / css-grid-layout / percent-padding-margin-resolution-grid-item-update.html
1 <!DOCTYPE html>
2 <html>
3 <script>
4 if (window.testRunner)
5     testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
6 </script>
7 <link href="resources/grid.css" rel="stylesheet">
8 <style>
9 .grid {
10     -webkit-grid-definition-columns: 200px 200px;
11     -webkit-grid-definition-rows: 100px 100px;
12     height: 200px;
13     width: 400px;
14 }
15
16 .percentPadding {
17     width: 0px;
18     height: 0px;
19     padding: 50%;
20 }
21
22 .percentMargin {
23     width: 0px;
24     height: 0px;
25     margin: 50%;
26 }
27
28 .percentPaddingAndMargin {
29     width: 0px;
30     height: 0px;
31     padding: 10%;
32     margin: 20%;
33 }
34 </style>
35 <script src="../../resources/check-layout.js"></script>
36 <script>
37 function changeGridTrackSizesAndCheckLayout()
38 {
39     var grid = document.getElementsByClassName("grid")[0];
40     grid.offsetLeft;
41     grid.style.webkitGridDefinitionColumns = "100px 300px";
42     grid.style.webkitGridDefinitionRows = "50px 150px";
43     checkLayout('.grid');
44 }
45 window.addEventListener("load", changeGridTrackSizesAndCheckLayout, false);
46 </script>
47 <body>
48
49 <p>Test that changing grid tracks size forces the grid items' to resolve percentage padding and margin</p>
50
51 <div class="grid">
52     <div class="firstRowFirstColumn percentPadding" data-expected-padding-top="50" data-expected-padding-right="50" data-expected-padding-bottom="50" data-expected-padding-left="50"></div>
53     <div class="firstRowSecondColumn percentMargin" data-expected-margin-top="150" data-expected-margin-right="150" data-expected-margin-bottom="150" data-expected-margin-left="150"></div>
54     <div class="secondRowFirstColumn percentPaddingAndMargin" data-expected-padding-top="10" data-expected-padding-right="10" data-expected-padding-bottom="10" data-expected-padding-left="10" data-expected-margin-top="20" data-expected-margin-right="20" data-expected-margin-bottom="20" data-expected-margin-left="20"></div>
55     <div class="secondRowSecondColumn percentPaddingAndMargin" data-expected-padding-top="30" data-expected-padding-right="30" data-expected-padding-bottom="30" data-expected-padding-left="30" data-expected-margin-top="60" data-expected-margin-right="60" data-expected-margin-bottom="60" data-expected-margin-left="60"></div>
56 </div>
57
58 </body>
59 </html>