3 <link href=
"resources/grid.css" rel=
"stylesheet">
6 grid-template-columns:
70%
30%;
7 grid-template-rows:
40%
60%;
12 .firstRowFirstColumn {
17 .firstRowSecondColumn {
22 .secondRowFirstColumn {
27 .secondRowSecondColumn {
28 width: -webkit-calc(
100%);
29 height: -webkit-calc(
100%);
32 <script src=
"../../resources/check-layout.js"></script>
34 function changeGridDefinitionsAndCheckValues()
36 var grid0
= document
.getElementsByClassName("grid")[0];
37 var grid1
= document
.getElementsByClassName("grid")[1];
38 var grid2
= document
.getElementsByClassName("grid")[2];
39 document
.body
.offsetLeft
;
40 grid0
.style
.gridTemplateColumns
= "40% 60%";
42 grid1
.style
.gridTemplateRows
= "30% 70%";
44 grid2
.style
.gridTemplateColumns
= "40% 60%";
45 grid2
.style
.gridTemplateRows
= "30% 70%";
49 window
.addEventListener("load", changeGridDefinitionsAndCheckValues
, false);
53 <p>Test that changing percentage sized grid tracks make the grid items relayouts.
</p>
55 <div style=
"position: relative">
56 <div class=
"grid" data-expected-width=
"400" data-expected-height=
"300">
57 <div class=
"firstRowFirstColumn" data-expected-width=
"160" data-expected-height=
"15"></div>
58 <div class=
"firstRowSecondColumn" data-expected-width=
"15" data-expected-height=
"120"></div>
59 <div class=
"secondRowFirstColumn" data-expected-width=
"80" data-expected-height=
"90"></div>
60 <div class=
"secondRowSecondColumn" data-expected-width=
"240" data-expected-height=
"180"></div>
64 <div style=
"position: relative">
65 <div class=
"grid" data-expected-width=
"400" data-expected-height=
"300">
66 <div class=
"firstRowFirstColumn" data-expected-width=
"280" data-expected-height=
"15"></div>
67 <div class=
"firstRowSecondColumn" data-expected-width=
"15" data-expected-height=
"90"></div>
68 <div class=
"secondRowFirstColumn" data-expected-width=
"140" data-expected-height=
"105"></div>
69 <div class=
"secondRowSecondColumn" data-expected-width=
"120" data-expected-height=
"210"></div>
73 <div style=
"position: relative">
74 <div class=
"grid" data-expected-width=
"400" data-expected-height=
"300">
75 <div class=
"firstRowFirstColumn" data-expected-width=
"160" data-expected-height=
"15"></div>
76 <div class=
"firstRowSecondColumn" data-expected-width=
"15" data-expected-height=
"90"></div>
77 <div class=
"secondRowFirstColumn" data-expected-width=
"80" data-expected-height=
"105"></div>
78 <div class=
"secondRowSecondColumn" data-expected-width=
"240" data-expected-height=
"210"></div>