OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <link href="resources/grid.css" rel="stylesheet"> | |
3 <style> | |
4 .flex { | |
5 display: flex; | |
6 flex-direction: column; | |
7 width: 500px; | |
8 } | |
9 | |
10 input { | |
11 margin: 10px; | |
12 font: 10px/1 Ahem; | |
13 } | |
14 </style> | |
15 | |
16 <script src="../../resources/testharness.js"></script> | |
17 <script src="../../resources/testharnessreport.js"></script> | |
18 <script src="../../resources/check-layout-th.js"></script> | |
19 | |
20 <body onload="runTest()"> | |
21 <p>This test checks that preferred widths computations triggered after layout fo r flex items do not cause grid containers to shrink. The test PASS if you see a 10px black square inside a white box inside a gray box.</p> | |
Manuel Rego
2017/04/24 09:08:23
Nit: As this is a testharness.js test, you'll actu
| |
22 <h3>Grid as flex item.</h3> | |
23 <div class="flex"> | |
24 <div class="grid" data-expected-width="500"> | |
25 <input data-expected-width="480"> | |
26 </div> | |
27 </div> | |
28 | |
29 <h3>Grid as a child of a flex item.</h3> | |
30 <div class="flex"> | |
31 <div> | |
32 <div class="grid" data-expected-width="500"> | |
33 <input data-expected-width="480"> | |
34 </div> | |
35 </div> | |
36 </div> | |
37 <div id="log"></div> | |
38 </body> | |
39 | |
40 <script> | |
41 function runTest() { | |
42 var inputs = document.getElementsByTagName("input"); | |
43 for (i = 0; i < inputs.length; ++i) { | |
44 inputs[i].focus(); | |
45 document.execCommand('InsertText', false, 'X'); | |
46 } | |
47 checkLayout('.grid'); | |
48 } | |
49 </script> | |
OLD | NEW |