Commit 422d540f authored by Tom Ritter's avatar Tom Ritter
Browse files

Bug 1634602 - Exempt about:black from color scheme preference in RFP mode. r=emilio, a=jcristau

Differential Revision: https://phabricator.services.mozilla.com/D77833
parent 8d6637b4
......@@ -16320,8 +16320,9 @@ void Document::RemoveToplevelLoadingDocument(Document* aDoc) {
}
}
 
StylePrefersColorScheme Document::PrefersColorScheme() const {
if (nsContentUtils::ShouldResistFingerprinting(this)) {
StylePrefersColorScheme Document::PrefersColorScheme(
Document::IgnoreRFP aIgnoreRFP /* = IgnoreRFP::No */) const {
if (aIgnoreRFP == IgnoreRFP::No && nsContentUtils::ShouldResistFingerprinting(this)) {
return StylePrefersColorScheme::Light;
}
 
......
......@@ -3868,7 +3868,8 @@ class Document : public nsINode,
nsIPermissionDelegateHandler* PermDelegateHandler();
// CSS prefers-color-scheme media feature for this document.
StylePrefersColorScheme PrefersColorScheme() const;
enum class IgnoreRFP { No, Yes };
StylePrefersColorScheme PrefersColorScheme(IgnoreRFP aIgnoreRFP = IgnoreRFP::No) const;
// Returns true if we use overlay scrollbars on the system wide or on the
// given document.
......
......@@ -5161,7 +5161,7 @@ nscolor PresShell::GetDefaultBackgroundColorToDraw() {
BrowsingContext* bc = doc->GetBrowsingContext();
if (bc && bc->IsTop() && !bc->HasOpener() && doc->GetDocumentURI() &&
NS_IsAboutBlank(doc->GetDocumentURI()) &&
doc->PrefersColorScheme() == StylePrefersColorScheme::Dark) {
doc->PrefersColorScheme(Document::IgnoreRFP::Yes) == StylePrefersColorScheme::Dark) {
// Use --in-content-page-background for prefers-color-scheme: dark.
return NS_RGB(0x2A, 0x2A, 0x2E);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment