Skip to content

Commit

Permalink
Propagate preferred color-scheme to non-top frames.
Browse files Browse the repository at this point in the history
The ColorSchemeMode::Preferred change doesn't make a difference (that
is, always use the preferred one), since when we only propagate from
top's embedder the embedder is chrome, which always has the preferred
color-scheme.

Differential Revision: https://phabricator.services.mozilla.com/D154931

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1782596
gecko-commit: 495ffb27c683fe2219b559708d3eb415847faa10
gecko-reviewers: jwatt
  • Loading branch information
emilio authored and pull[bot] committed Dec 12, 2023
1 parent 6900a58 commit 1412395
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<title>CSS Test Reference</title>
<style>
div {
width: 100px;
height: 100px;
}
</style>
<div style="background-color: purple"></div>
<div style="background-color: blue"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<title>prefers-color-scheme propagation</title>
<link rel="help" href="https://drafts.csswg.org/css-color-adjust/#color-scheme-effect">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/4772">
<link rel="match" href="color-scheme-iframe-preferred-ref.html">
<style>
iframe {
display: block;
border: none;
width: 100px;
height: 100px;
}
</style>
<iframe style="color-scheme: dark" src="support/prefers-color-scheme-blue-purple.html"></iframe>
<iframe style="color-scheme: light" src="support/prefers-color-scheme-blue-purple.html"></iframe>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<style>
:root { background-color: blue }
@media (prefers-color-scheme: dark) {
:root { background-color: purple }
}
</style>

0 comments on commit 1412395

Please sign in to comment.