Bug 1575806 - Cleanup a bit preference-stylesheet-related code. r=heycam

Some of it was dead code, another was inlining a not very useful function (and
in one case redundant, since EnsureInitialized() happened right after
Refresh()).

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-08-22 23:15:13 +00:00
Родитель 495df615e7
Коммит a3278b6dad
2 изменённых файлов: 3 добавлений и 17 удалений

Просмотреть файл

@ -331,15 +331,6 @@ bool nsPresContext::IsChrome() const {
return Document()->IsInChromeDocShell();
}
bool nsPresContext::IsChromeOriginImage() const {
return Document()->IsBeingUsedAsImage() &&
Document()->IsDocumentURISchemeChrome();
}
void nsPresContext::GetDocumentColorPreferences() {
PreferenceSheet::EnsureInitialized();
}
void nsPresContext::GetUserPreferences() {
if (!GetPresShell()) {
// No presshell means nothing to do here. We'll do this when we
@ -350,8 +341,7 @@ void nsPresContext::GetUserPreferences() {
mAutoQualityMinFontSizePixelsPref =
Preferences::GetInt("browser.display.auto_quality_min_font_size");
// * document colors
GetDocumentColorPreferences();
PreferenceSheet::EnsureInitialized();
mSendAfterPaintToContent = Preferences::GetBool(
"dom.send_after_paint_to_content", mSendAfterPaintToContent);
@ -1336,12 +1326,10 @@ void nsPresContext::SysColorChangedInternal() {
// Invalidate cached '-moz-windows-accent-color-applies' media query:
RefreshSystemMetrics();
// Reset default background and foreground colors for the document since they
// may be using system colors
PreferenceSheet::Refresh();
// Reset default background and foreground colors for the document since
// they may be using system colors
GetDocumentColorPreferences();
// The system color values are computed to colors in the style data,
// so normal style data comparison is sufficient here.
RebuildAllStyleData(nsChangeHint(0), RestyleHint{0});

Просмотреть файл

@ -806,7 +806,6 @@ class nsPresContext : public nsISupports,
// Is this presentation in a chrome docshell?
bool IsChrome() const;
bool IsChromeOriginImage() const;
// Public API for native theme code to get style internals.
bool HasAuthorSpecifiedRules(const nsIFrame* aFrame,
@ -1041,7 +1040,6 @@ class nsPresContext : public nsISupports,
void SetImgAnimations(nsIContent* aParent, uint16_t aMode);
void SetSMILAnimations(mozilla::dom::Document* aDoc, uint16_t aNewMode,
uint16_t aOldMode);
void GetDocumentColorPreferences();
void PreferenceChanged(const char* aPrefName);