Skip to content

Commit

Permalink
Bug 1621899 [wpt PR 22213] - Add tests for color-scheme and iframes.,…
Browse files Browse the repository at this point in the history
… a=testonly

Automatic update from web-platform-tests
Add tests for color-scheme and iframes.

Iframes where the color-scheme of the iframe element and the iframe
document's root does not match, will get a backdrop matching the color-
scheme of the iframe's root element.

Also adjust existing test according to spec change. See:
w3c/csswg-drafts#4772

Bug: 1058822
Change-Id: I82fd3cc3c2bbf5b4835b157a7522cb22c459ff20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095112
Reviewed-by: Anders Hartvoll Ruud <andruudchromium.org>
Commit-Queue: Rune Lillesveen <futharkchromium.org>
Cr-Commit-Position: refs/heads/master{#750186}

--

wpt-commits: 348adc5c7b2e3abb76763af063fbd921afb99ac5
wpt-pr: 22213

UltraBlame original commit: e0db51ee811dc6abb6d0897bbbf56a8ed8fdb1f0
  • Loading branch information
marco-c committed Mar 16, 2020
1 parent 4eef1b3 commit 7a52f14
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<title>CSS Color Adjustment Test: iframe element with light color-scheme, frame document with dark color-scheme, :root background with alpha</title>
<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-effect">
<link rel="match" href="support/dark-frame-alpha.html">
<link rel="stylesheet" href="support/assert-preferred-dark.css">
<style>
html, body {
margin: 0;
height: 100%;
}
iframe {
margin: 0;
border: 0;
padding: 0;
width: 100%;
height: 100%;
display: block;
}
</style>
<iframe src="support/dark-frame-alpha.html"></iframe>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<title>CSS Color Adjustment Test: Frames with a dark color-scheme should get an opaque background when embedding element and embedded root color-schemes do not match</title>
<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-effect">
<link rel="match" href="support/dark-frame-opaque.html">
<link rel="stylesheet" href="support/assert-preferred-dark.css">
<style>
html, body {
margin: 0;
height: 100%;
}
iframe {
margin: 0;
border: 0;
padding: 0;
width: 100%;
height: 100%;
display: block;
}
</style>
<iframe src="support/dark-frame-opaque.html"></iframe>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!doctype html>
<title>CSS Color Adjustment Test: Frames with a dark color-scheme should still be transparent</title>
<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-processing">
<title>CSS Color Adjustment Test: Frames with a dark color-scheme should still be transparent when embedding element and embedded root color-schemes match</title>
<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-effect">
<link rel="match" href="color-scheme-iframe-background-ref.html">
<link rel="stylesheet" href="support/assert-preferred-dark.css">
<iframe width="600" height="400" src="support/dark-frame.html"></iframe>
<iframe width="600" height="400" style="color-scheme:dark" src="support/dark-frame.html"></iframe>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<style>
:root {
color-scheme: dark;
background-color: rgba(0, 128, 0, 0.5);
}
p { color: lime }
</style>
<p>This text should be lime and the background should be green blended with a dark canvas.</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!doctype html>
<style>
:root { color-scheme: dark }
p { color: green }
</style>
<p>This text should be green and the background should be dark opaque.</p>

0 comments on commit 7a52f14

Please sign in to comment.