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

Unified Diff: LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html

Issue 21205004: [CSS Grid Layout] Store m_grid across layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after Ojan's review Created 7 years, 5 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
« no previous file with comments | « no previous file | LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html
diff --git a/LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html b/LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html
new file mode 100644
index 0000000000000000000000000000000000000000..ff1d36dbc63d4c1dc0262160ba2237b1a31096f2
--- /dev/null
+++ b/LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html>
+<script>
+if (window.testRunner)
+ testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
+</script>
+<link href="resources/grid.css" rel="stylesheet">
+<script src="../../resources/check-layout.js"></script>
+<style>
+.grid {
+ grid-auto-flow: row;
+}
+#firstGridItem {
+ grid-row: auto;
+ grid-column: 1;
+}
+
+#secondGridItem {
+ grid-row: 1;
+ grid-column: auto;
+}
+
+#thirdGridItem {
+ grid-row: auto;
+ grid-column: auto;
+}
+</style>
+<script>
+function testGridDefinitions(gridDefinitionRows, gridDefinitionColumns, firstGridItemData, secondGridItemData, thirdGridItemData)
+{
+ var gridElement = document.getElementsByClassName("grid")[0];
+ gridElement.style.gridDefinitionRows = gridDefinitionRows;
+ gridElement.style.gridDefinitionColumns = gridDefinitionColumns;
+
+ var firstGridItem = document.getElementById("firstGridItem");
+ firstGridItem.setAttribute("data-expected-width", firstGridItemData.width);
+ firstGridItem.setAttribute("data-expected-height", firstGridItemData.height);
+ firstGridItem.setAttribute("data-offset-x", firstGridItemData.x);
+ firstGridItem.setAttribute("data-offset-y", firstGridItemData.y);
+
+ var secondGridItem = document.getElementById("secondGridItem");
+ secondGridItem.setAttribute("data-expected-width", secondGridItemData.width);
+ secondGridItem.setAttribute("data-expected-height", secondGridItemData.height);
+ secondGridItem.setAttribute("data-offset-x", secondGridItemData.x);
+ secondGridItem.setAttribute("data-offset-y", secondGridItemData.y);
+
+ var thirdGridItem = document.getElementById("thirdGridItem");
+ thirdGridItem.setAttribute("data-expected-width", thirdGridItemData.width);
+ thirdGridItem.setAttribute("data-expected-height", thirdGridItemData.height);
+ thirdGridItem.setAttribute("data-offset-x", thirdGridItemData.x);
+ thirdGridItem.setAttribute("data-offset-y", thirdGridItemData.y);
+
+ checkLayout(".grid");
+}
+
+function testChangingGridDefinitions()
+{
+ testGridDefinitions('10px 20px', '10px', { 'width': '10', 'height': '20', 'x': '0', 'y': '10' }, { 'width': '10', 'height': '10', 'x': '0', 'y': '0' }, { 'width': '10', 'height': '0', 'x': '0', 'y': '30' });
+ testGridDefinitions('50px', '30px 40px', { 'width': '30', 'height': '0', 'x': '0', 'y': '50' }, { 'width': '30', 'height': '50', 'x': '0', 'y': '0' }, { 'width': '40', 'height': '50', 'x': '30', 'y': '0' });
+ testGridDefinitions('50px', '60px', { 'width': '60', 'height': '0', 'x': '0', 'y': '50' }, { 'width': '60', 'height': '50', 'x': '0', 'y': '0' }, { 'width': '60', 'height': '0', 'x': '0', 'y': '50' });
+ testGridDefinitions('50px 100px 150px', '60px', { 'width': '60', 'height': '100', 'x': '0', 'y': '50' }, { 'width': '60', 'height': '50', 'x': '0', 'y': '0' }, { 'width': '60', 'height': '150', 'x': '0', 'y': '150' });
+}
+
+window.addEventListener("load", testChangingGridDefinitions, false);
+</script>
+<body>
+<div>This test checks that grid-definition-{rows|columns} dynamic updates recomputes the positions of automatically placed grid items.</div>
+
+<div style="position: relative">
+ <div class="grid">
+ <div class="sizedToGridArea" id="firstGridItem"></div>
+ <div class="sizedToGridArea" id="secondGridItem"></div>
+ <div class="sizedToGridArea" id="thirdGridItem"></div>
+ </div>
+</div>
+
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/css-grid-layout/grid-container-change-explicit-grid-recompute-child-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698