Skip to content

Commit

Permalink
Do not propagate body styles when html root or body is contained
Browse files Browse the repository at this point in the history
Per resolution in [1]. Added behind a flag since this is a web facing
change which needs an intent to ship.

[1] w3c/csswg-drafts#5913

Bug: 1215265
Change-Id: I50f142245cdb55b422f8a6f3d9690444bf3648aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897247
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#890175}
  • Loading branch information
Rune Lillesveen authored and chromium-wpt-export-bot committed Jun 8, 2021
1 parent 198dd87 commit 9cbb145
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 0 deletions.
10 changes: 10 additions & 0 deletions css/css-backgrounds/background-color-body-propagation-008.html
@@ -0,0 +1,10 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Backgrounds and Borders Test: Do not propagate body background when html root is contained</title>
<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#special-backgrounds">
<link rel="match" href="../reference/blank.html">
<style>
html { contain: paint; }
body { background: red; }
</style>
<body></body>
4 changes: 4 additions & 0 deletions css/css-overflow/overflow-body-propagation-011-ref.html
@@ -0,0 +1,4 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<div style="overflow:scroll">PASS if BODY has scrollbars, but not viewport.</div>
14 changes: 14 additions & 0 deletions css/css-overflow/overflow-body-propagation-011.html
@@ -0,0 +1,14 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: HTML root containment stops overflow propagation from BODY</title>
<link rel="help" href="https://drafts.csswg.org/css-overflow/#overflow-propagation">
<link rel="match" href="overflow-body-propagation-011-ref.html">
<style>
html {
contain: paint;
}
body {
overflow: scroll;
}
</style>
<body>PASS if BODY has scrollbars, but not viewport.</body>
@@ -0,0 +1,4 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<body style="margin:0">This text should be left aligned.</body>
13 changes: 13 additions & 0 deletions css/css-writing-modes/direction-propagation-body-contain-root.html
@@ -0,0 +1,13 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Writing Modes Test: Do not propagate direction from body when html root is contained</title>
<link rel="help" href="https://drafts.csswg.org/css-writing-modes/#principal-flow">
<link rel="match" href="direction-propagation-body-contain-root-ref.html">
<style>
html { contain: paint; }
body { direction: rtl; display: inline; }
</style>
<body></body>
<script>
document.documentElement.insertBefore(document.createTextNode("This text should be left aligned."), document.body);
</script>
@@ -0,0 +1,4 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<div style="writing-mode:vertical-rl">This text should run vertically on the left side</body>
10 changes: 10 additions & 0 deletions css/css-writing-modes/wm-propagation-body-contain-root.html
@@ -0,0 +1,10 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Writing Modes Test: Do not propagate writing-mode from body when html root is contained</title>
<link rel="help" href="https://drafts.csswg.org/css-writing-modes/#principal-flow">
<link rel="match" href="wm-propagation-body-contain-root-ref.html">
<style>
html { contain: paint; }
body { writing-mode: vertical-rl; }
</style>
<body>This text should run vertically on the left side</body>

0 comments on commit 9cbb145

Please sign in to comment.