Commit f336f3b7 authored by Antonio Gomes's avatar Antonio Gomes Committed by Commit Bot

[css-grid] Migrate grid-container-change-named-grid-lines-recompute-child.html to WPT

BUG=767015, 1063749
R=rego@igalia.com

Change-Id: Ie5a6454850f580d7ada804d83760689366522258
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152607
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: default avatarManuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#759938}
parent f152bc93
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link href="resources/grid.css" rel="stylesheet"> <title>CSS Grid: Change named grid lines.</title>
<link href="resources/grid-alignment.css" rel="stylesheet"> <link rel="author" title="Julien Chaffraix" href="mailto:jchaffraix@chromium.org"/>
<script src="../../resources/check-layout.js"></script> <link rel="help" href="https://drafts.csswg.org/css-grid/#placement"/>
<meta name="assert" content="Checks that updating the named grid lines definitions in grid-template-{rows|columns} recomputes the positions of automatically placed grid items."/>
<link rel="issue" href="https://crbug.com/248151"/>
<link href="/css/support/grid.css" rel="stylesheet"/>
<link href="/css/support/alignment.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"/>
<style> <style>
.grid { .grid {
grid-auto-flow: row dense; grid-auto-flow: row dense;
...@@ -22,6 +27,9 @@ ...@@ -22,6 +27,9 @@
grid-column: auto; grid-column: auto;
} }
</style> </style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/check-layout-th.js"></script>
<script> <script>
function testGridDefinitions(gridTemplateRows, gridTemplateColumns, firstGridItemData, secondGridItemData, thirdGridItemData) function testGridDefinitions(gridTemplateRows, gridTemplateColumns, firstGridItemData, secondGridItemData, thirdGridItemData)
{ {
...@@ -47,7 +55,7 @@ function testGridDefinitions(gridTemplateRows, gridTemplateColumns, firstGridIte ...@@ -47,7 +55,7 @@ function testGridDefinitions(gridTemplateRows, gridTemplateColumns, firstGridIte
thirdGridItem.setAttribute("data-offset-x", thirdGridItemData.x); thirdGridItem.setAttribute("data-offset-x", thirdGridItemData.x);
thirdGridItem.setAttribute("data-offset-y", thirdGridItemData.y); thirdGridItem.setAttribute("data-offset-y", thirdGridItemData.y);
checkLayout(".grid"); checkLayout(".grid", false);
} }
function testChangingGridDefinitions() function testChangingGridDefinitions()
...@@ -56,13 +64,14 @@ function testChangingGridDefinitions() ...@@ -56,13 +64,14 @@ function testChangingGridDefinitions()
testGridDefinitions('10px [row] 20px', '30px', { 'width': '0', 'height': '10', 'x': '30', 'y': '0' }, { 'width': '30', 'height': '20', 'x': '0', 'y': '10' }, { 'width': '30', 'height': '10', 'x': '0', 'y': '0' }); testGridDefinitions('10px [row] 20px', '30px', { 'width': '0', 'height': '10', 'x': '30', 'y': '0' }, { 'width': '30', 'height': '20', 'x': '0', 'y': '10' }, { 'width': '30', 'height': '10', 'x': '0', 'y': '0' });
testGridDefinitions('10px 20px [row]', '30px', { 'width': '0', 'height': '10', 'x': '30', 'y': '0' }, { 'width': '30', 'height': '0', 'x': '0', 'y': '30' }, { 'width': '30', 'height': '10', 'x': '0', 'y': '0' }); testGridDefinitions('10px 20px [row]', '30px', { 'width': '0', 'height': '10', 'x': '30', 'y': '0' }, { 'width': '30', 'height': '0', 'x': '0', 'y': '30' }, { 'width': '30', 'height': '10', 'x': '0', 'y': '0' });
testGridDefinitions('10px 20px [row]', '30px [column]', { 'width': '0', 'height': '10', 'x': '30', 'y': '0' }, { 'width': '30', 'height': '0', 'x': '0', 'y': '30' }, { 'width': '30', 'height': '10', 'x': '0', 'y': '0' }); testGridDefinitions('10px 20px [row]', '30px [column]', { 'width': '0', 'height': '10', 'x': '30', 'y': '0' }, { 'width': '30', 'height': '0', 'x': '0', 'y': '30' }, { 'width': '30', 'height': '10', 'x': '0', 'y': '0' });
done();
} }
window.addEventListener("load", testChangingGridDefinitions, false);
</script> </script>
<body> <script type="text/javascript">
<div>This test checks that updating the named grid lines definitions in grid-template-{rows|columns} recomputes the positions of automatically placed grid items.</div> setup({ explicit_done: true });
</script>
<body onload="document.fonts.ready.then(() => { testChangingGridDefinitions(); })">
<div style="position: relative"> <div style="position: relative">
<div class="grid justifyContentStart"> <div class="grid justifyContentStart">
<div class="sizedToGridArea" id="firstGridItem"></div> <div class="sizedToGridArea" id="firstGridItem"></div>
......
This test checks that updating the named grid lines definitions in grid-template-{rows|columns} recomputes the positions of automatically placed grid items.
PASS
PASS
PASS
PASS
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment