Skip to content

Commit 00ccaab

Browse files
lilleschromium-wpt-export-bot
authored andcommitted
Handle display:contents for viewport propagation.
When documentElement/body doe not generate a box, its background will not propagate to the viewport (see [1]). This removes the need for calling EnsureComputedStyle() on documentElement/body. The CSSWG has also resolved that to be the case also for other properties propagated to the viewport[2]. Some of the wpt tests for body propagation didn't actually have a body element. Added. [1] https://drafts.csswg.org/css-backgrounds/#special-backgrounds [2] w3c/csswg-drafts#3779 (comment) Bug: 987207 Change-Id: I06e618e2acd2926b5ae4831bf5825e13e970d035
1 parent 99422b9 commit 00ccaab

10 files changed

+58
-0
lines changed

css/css-backgrounds/background-color-body-propagation-004.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
display: none
99
}
1010
style>
11+
<body>body>

css/css-backgrounds/background-color-body-propagation-005.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
html { display: none; }
77
body { background: red; }
88
style>
9+
<body>body>

css/css-backgrounds/background-color-body-propagation-006.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
}));
1515
};
1616
script>
17+
<body>body>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
>
2+
<title>CSS Backgrounds and Borders Test: don't propagate body background when display:contentstitle>
3+
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#special-backgrounds">
4+
<link rel="match" href="../reference/blank.html">
5+
<style>
6+
body {
7+
background: red;
8+
display: contents
9+
}
10+
style>
11+
<body>body>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
>
2+
<title>CSS Overflow Test: Propagation of body overflow to viewporttitle>
3+
<link rel="help" href="https://drafts.csswg.org/css-overflow/#overflow-propagation">
4+
<link rel="match" href="reference/overflow-body-propagation-ref.html">
5+
<style>
6+
body {
7+
overflow: scroll;
8+
margin-top: 100px;
9+
}
10+
style>
11+
<body>The viewport should have scrollbars, not the body.body>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
>
2+
<title>CSS Overflow Test: Do not propagate overflow of display:none body to viewporttitle>
3+
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#overflow-propagation">
4+
<link rel="match" href="/css/reference/blank.html">
5+
<body style="display:none; overflow:scroll">body>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
>
2+
<title>CSS Overflow Test: Do not propagate overflow of display:contents body to viewporttitle>
3+
<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#overflow-propagation">
4+
<link rel="match" href="/css/reference/blank.html">
5+
<body style="display:contents; overflow:scroll">body>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
>
2+
<link rel="help" href="https://drafts.csswg.org/css-overflow/#overflow-propagation">
3+
<link rel="match" href="reference/overflow-body-no-propagation-ref.html">
4+
<style>
5+
html {
6+
overflow: hidden;
7+
}
8+
body {
9+
overflow: scroll;
10+
margin-top: 100px;
11+
}
12+
style>
13+
<body>The body should have scrollbars, not the viewport.body>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
>
2+
<html style="overflow:auto">
3+
<title>CSS Overflow Test Referencetitle>
4+
<body style="margin-top:100px;overflow:scroll">The body should have scrollbars, not the viewport.body>
5+
html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
>
2+
<html style="overflow:scroll">
3+
<title>CSS Overflow Test Referencetitle>
4+
<body style="margin-top:100px">The viewport should have scrollbars, not the body.body>
5+
html>

0 commit comments

Comments
 (0)