Commit a2328fd6 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

[css-grid] Migrate grid-element-remove-svg-child.html to WPT

This CL migrates grid-element-bad-cast.html from
fast/css-grid-layout to external/wpt/css/css-grid
with WPT styles, adding links to the relevant specs,
and test description.

Additionally, this test is renamed to
grid-item-script-002[-ref].html to be align
with existing tests.

Bug: 1063749, 767015
Change-Id: I6bc718d99b15372882f80cb23d1d2be0c5aa70a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147525
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: default avatarManuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#759502}
parent f6807bb5
<!DOCTYPE html>
<title>CSS Grid Layout Test: Remove a first child in grid items</title>
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#grid-item">
<link rel="stylesheet" href="/css/support/grid.css"/>
<link rel="match" href="../reference/grid-item-script-001-ref.html">
<meta name="assert" content="This test ensures that removing a first child element in grid items doesn't crash.">
<link rel="stylesheet" href="/css/support/grid.css"/>
<div class="grid">
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='190'>
<polygon points='100,10 40,180 190,60 10,60 160,180' style='fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;'>
</svg>
</div>
<script>
var grid = document.getElementsByClassName("grid")[0];
grid.offsetTop;
while (grid.firstChild)
grid.removeChild(grid.firstChild);
grid.offsetTop;
grid.innerHTML = "Test passes if it doesn't crash.";
</script>
This test checks that removing a non-LayoutBox grid item doesn't make us crash.
This test has PASSED if it didn't crash and you see PASSED below.
PASSED
<!DOCTYPE html>
<link href="resources/grid.css" rel="stylesheet">
<p>This test checks that removing a non-LayoutBox grid item doesn't make us crash.</p>
<p>This test has PASSED if it didn't crash and you see PASSED below.</p>
<div class="grid">
<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='190'>
<polygon points='100,10 40,180 190,60 10,60 160,180' style='fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;'>
</svg>
</div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var grid = document.getElementsByClassName("grid")[0];
grid.offsetTop;
while (grid.firstChild)
grid.removeChild(grid.firstChild);
grid.offsetTop;
grid.innerHTML = "PASSED";
</script>
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