Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: third_party/WebKit/LayoutTests/fast/css-grid-layout/preferred-width-computed-after-layout.html

Issue 2834473003: [css-grid] Preemptively store intrinsic sizes during layout (Closed)
Patch Set: Patch+Test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698