Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not propagate body styles when html root or body is contained
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
1 parent
198dd87
commit 9cbb145
Showing
7 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
css/css-backgrounds/background-color-body-propagation-008.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
4 changes: 4 additions & 0 deletions
4
css/css-writing-modes/direction-propagation-body-contain-root-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
13
css/css-writing-modes/direction-propagation-body-contain-root.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
4 changes: 4 additions & 0 deletions
4
css/css-writing-modes/wm-propagation-body-contain-root-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
10
css/css-writing-modes/wm-propagation-body-contain-root.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |