Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/css-grid-layout/preferred-width-computed-after-layout.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/css-grid-layout/preferred-width-computed-after-layout.html b/third_party/WebKit/LayoutTests/fast/css-grid-layout/preferred-width-computed-after-layout.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4669b4e0cfdb8761941c659f9a2a488d55c1883b |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/css-grid-layout/preferred-width-computed-after-layout.html |
| @@ -0,0 +1,49 @@ |
| +<!DOCTYPE html> |
| +<link href="resources/grid.css" rel="stylesheet"> |
| +<style> |
| +.flex { |
| + display: flex; |
| + flex-direction: column; |
| + width: 500px; |
| +} |
| + |
| +input { |
| + margin: 10px; |
| + font: 10px/1 Ahem; |
| +} |
| +</style> |
| + |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="../../resources/check-layout-th.js"></script> |
| + |
| +<body onload="runTest()"> |
| +<p>This test checks that preferred widths computations triggered after layout for 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
|
| +<h3>Grid as flex item.</h3> |
| +<div class="flex"> |
| + <div class="grid" data-expected-width="500"> |
| + <input data-expected-width="480"> |
| + </div> |
| +</div> |
| + |
| +<h3>Grid as a child of a flex item.</h3> |
| +<div class="flex"> |
| + <div> |
| + <div class="grid" data-expected-width="500"> |
| + <input data-expected-width="480"> |
| + </div> |
| + </div> |
| +</div> |
| +<div id="log"></div> |
| +</body> |
| + |
| +<script> |
| +function runTest() { |
| + var inputs = document.getElementsByTagName("input"); |
| + for (i = 0; i < inputs.length; ++i) { |
| + inputs[i].focus(); |
| + document.execCommand('InsertText', false, 'X'); |
| + } |
| + checkLayout('.grid'); |
| +} |
| +</script> |