style: Centralize logic to ignore document colors.

This was a follow-up from the backplate stuff which I requested but didn't
happen.

Differential Revision: https://phabricator.services.mozilla.com/D53170
This commit is contained in:
Emilio Cobos Álvarez 2019-11-15 13:39:08 +00:00
parent 0cfc91d6ce
commit bb06ed7206
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A

View file

@ -274,13 +274,7 @@ impl Device {
if doc.mIsBeingUsedAsImage() {
return true;
}
let document_color_use = static_prefs::pref!("browser.display.document_color_use");
let prefs = self.pref_sheet_prefs();
match document_color_use {
1 => true,
2 => prefs.mIsChrome,
_ => !prefs.mUseAccessibilityTheme,
}
self.pref_sheet_prefs().mUseDocumentColors
}
/// Returns the default background color.