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) { ...@@ -16320,8 +16320,9 @@ void Document::RemoveToplevelLoadingDocument(Document* aDoc) {
} }
} }
   
StylePrefersColorScheme Document::PrefersColorScheme() const { StylePrefersColorScheme Document::PrefersColorScheme(
if (nsContentUtils::ShouldResistFingerprinting(this)) { Document::IgnoreRFP aIgnoreRFP /* = IgnoreRFP::No */) const {
if (aIgnoreRFP == IgnoreRFP::No && nsContentUtils::ShouldResistFingerprinting(this)) {
return StylePrefersColorScheme::Light; return StylePrefersColorScheme::Light;
} }
   
......
...@@ -3868,7 +3868,8 @@ class Document : public nsINode, ...@@ -3868,7 +3868,8 @@ class Document : public nsINode,
nsIPermissionDelegateHandler* PermDelegateHandler(); nsIPermissionDelegateHandler* PermDelegateHandler();
// CSS prefers-color-scheme media feature for this document. // 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 // Returns true if we use overlay scrollbars on the system wide or on the
// given document. // given document.
......
...@@ -5161,7 +5161,7 @@ nscolor PresShell::GetDefaultBackgroundColorToDraw() { ...@@ -5161,7 +5161,7 @@ nscolor PresShell::GetDefaultBackgroundColorToDraw() {
BrowsingContext* bc = doc->GetBrowsingContext(); BrowsingContext* bc = doc->GetBrowsingContext();
if (bc && bc->IsTop() && !bc->HasOpener() && doc->GetDocumentURI() && if (bc && bc->IsTop() && !bc->HasOpener() && doc->GetDocumentURI() &&
NS_IsAboutBlank(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. // Use --in-content-page-background for prefers-color-scheme: dark.
return NS_RGB(0x2A, 0x2A, 0x2E); return NS_RGB(0x2A, 0x2A, 0x2E);
} }
......
Supports Markdown
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