Skip to content

Commit 4e7e807

Browse files
authored
1 parent 89a75cc commit 4e7e807

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>CSS Grid Test: Sibling nested subgrids with overflow:hidden leaf contribute equally to their tracks</title>
6+
<link rel="help" href="https://drafts.csswg.org/css-grid-2/#subgrid-item-contribution">
7+
<link rel="help" href="https://drafts.csswg.org/css-grid-2/#subgrids">
8+
<meta name="assert" content="Test passes if the row heights of nested-subgrid leaves with overflow:hidden are identical across sibling subgrids, regardless of each sibling's position in the outer grid. This test only checks row sizing; column sizing is not exercised.">
9+
<script src="/resources/testharness.js"></script>
10+
<script src="/resources/testharnessreport.js"></script>
11+
<style>
12+
.grid {
13+
display: grid;
14+
gap: 16px;
15+
width: 400px;
16+
}
17+
.card {
18+
border: 1px solid black;
19+
display: grid;
20+
grid-template-rows: subgrid;
21+
grid-row: span 3;
22+
row-gap: 0;
23+
}
24+
.content {
25+
display: grid;
26+
grid-template-rows: subgrid;
27+
grid-row: span 2;
28+
padding: 16px;
29+
}
30+
.footer {
31+
overflow: hidden;
32+
}
33+
</style>
34+
</head>
35+
<body>
36+
<div class="grid">
37+
<div class="card">
38+
<h2>Top</h2>
39+
<div class="content">
40+
<div class="footer" id="f1">
41+
Long text long enough to wrap onto multiple lines so that overflow:hidden can clip the overflowing portion
42+
</div>
43+
</div>
44+
</div>
45+
<div class="card">
46+
<h2>Top</h2>
47+
<div class="content">
48+
<div class="footer" id="f2">
49+
Long text long enough to wrap onto multiple lines so that overflow:hidden can clip the overflowing portion
50+
</div>
51+
</div>
52+
</div>
53+
<div class="card">
54+
<h2>Top</h2>
55+
<div class="content">
56+
<div class="footer" id="f3">
57+
Long text long enough to wrap onto multiple lines so that overflow:hidden can clip the overflowing portion
58+
</div>
59+
</div>
60+
</div>
61+
</div>
62+
<script>
63+
test(() => {
64+
const h1 = document.getElementById("f1").getBoundingClientRect().height;
65+
const h2 = document.getElementById("f2").getBoundingClientRect().height;
66+
const h3 = document.getElementById("f3").getBoundingClientRect().height;
67+
assert_equals(h2, h1, "Second card's .footer height matches the first's");
68+
assert_equals(h3, h1, "Third card's .footer height matches the first's");
69+
}, "Sibling nested subgrids with overflow:hidden leaves must size their rows identically");
70+
</script>
71+
</body>
72+
</html>

0 commit comments

Comments
 (0)