File: empty-grid-001.html

package info (click to toggle)
firefox-esr 140.4.0esr-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,539,276 kB
  • sloc: cpp: 7,381,286; javascript: 6,388,710; ansic: 3,710,139; python: 1,393,780; xml: 628,165; asm: 426,918; java: 184,004; sh: 65,742; makefile: 19,302; objc: 13,059; perl: 12,912; yacc: 4,583; cs: 3,846; pascal: 3,352; lex: 1,720; ruby: 1,226; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (70 lines) | stat: -rw-r--r-- 2,670 bytes parent folder | download | duplicates (24)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<title>CSS Grid: empty grid without explicit tracks.</title>
<link rel="author" title="Sergio Villar" href="mailto:svillar@igalia.com"/>
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#abspos"/>
<link rel="issue" href="https://crrev.com/562167"/>
<meta name="assert" content="Test ensures that the grids with no in-flow items are actually empty."/>

<link href="/css/support/grid.css" rel="stylesheet"/>
<link href="/css/support/width-keyword-classes.css" rel="stylesheet"/>
<link href="/fonts/ahem.css" rel="stylesheet" type="text/css"/>
<style>
.gridWithAbsolutePositionedItem {
  /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */
  position: relative;
}

.grid {
  grid-auto-columns: 200px;
  grid-auto-rows: 200px;
}

.item {
  position: absolute;
  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>
<script>
function addRemoveItem()
{
  var gridItem = document.createElement("div");
  gridItem.style.width = "100px";
  gridItem.style.height = "100px";
  gridItem.style.backgroundColor = "red";
  var gridElement = document.getElementById("dynamicGrid");
  gridElement.appendChild(gridItem);
  gridElement.removeChild(gridItem);
}

setup({ explicit_done: true });

function doTest() {
  addRemoveItem();
  checkLayout(".grid");
}
</script>

<body onload="document.fonts.ready.then(() => { doTest(); })">

<div class="grid min-content" data-expected-width="0" data-expected-height="0"></div>

<div class="grid min-content gridWithAbsolutePositionedItem" data-expected-width="0" data-expected-height="0">
  <div class="item" data-expected-width="40" data-expected-height="10">XXXX</div>
</div>

<div id="dynamicGrid" class="grid min-content" data-expected-width="0" data-expected-height="0"></div>

<div class="grid min-content" style="grid-template-rows: 100px;" data-expected-width="0" data-expected-height="100"></div>
<div class="grid min-content" style="grid-template-rows: auto;" data-expected-width="0" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-rows: 1fr;" data-expected-width="0" data-expected-height="0"></div>

<div class="grid min-content" style="grid-template-columns: 100px;" data-expected-width="100" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-columns: auto;" data-expected-width="0" data-expected-height="0"></div>
<div class="grid min-content" style="grid-template-columns: 1fr;" data-expected-width="0" data-expected-height="0"></div>

</body>