Bug 1621899 [wpt PR 22213] - Add tests for color-scheme and iframes., a=testonly
authorRune Lillesveen <futhark@chromium.org>
Sat, 14 Mar 2020 11:30:02 +0000
changeset 518859 e0db51ee811dc6abb6d0897bbbf56a8ed8fdb1f0
parent 518858 b2faa06cd912b3d9fdeae3e0ce1d4f03d8f88124
child 518860 f37f560e6540db8fc57a651d595becb686687af6
push id37217
push userccoroiu@mozilla.com
push dateSun, 15 Mar 2020 21:37:59 +0000
treeherdermozilla-central@f9fc9427476e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1621899, 22213, 1058822, 2095112, 750186
milestone76.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1621899 [wpt PR 22213] - Add tests for color-scheme and iframes., 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: https://github.com/w3c/csswg-drafts/issues/4772 Bug: 1058822 Change-Id: I82fd3cc3c2bbf5b4835b157a7522cb22c459ff20 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095112 Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#750186} -- wpt-commits: 348adc5c7b2e3abb76763af063fbd921afb99ac5 wpt-pr: 22213
testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-alpha.html
testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-opaque.html
testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background.html
testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-alpha.html
testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-opaque.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-alpha.html
@@ -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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background-mismatch-opaque.html
@@ -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>
--- a/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background.html
+++ b/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/color-scheme-iframe-background.html
@@ -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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-alpha.html
@@ -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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-color-adjust/rendering/dark-color-scheme/support/dark-frame-opaque.html
@@ -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>