Bug 1785310 - Remove mozilla/StaticPrefs_layout.h includes from other headers. r=dholbert

Adding layout prefs cause massive rebuilds because of this.

Differential Revision: https://phabricator.services.mozilla.com/D154928
This commit is contained in:
Emilio Cobos Álvarez 2022-08-17 21:26:36 +00:00
parent 20606b0590
commit 534f39ed75
18 changed files with 37 additions and 24 deletions

View file

@ -19,6 +19,7 @@
#include "mozilla/dom/SVGLengthBinding.h" #include "mozilla/dom/SVGLengthBinding.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h" #include "mozilla/RefPtr.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/SVGContentUtils.h" #include "mozilla/SVGContentUtils.h"
using namespace mozilla::gfx; using namespace mozilla::gfx;

View file

@ -21,6 +21,7 @@
#include "mozilla/dom/SVGPathElementBinding.h" #include "mozilla/dom/SVGPathElementBinding.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h" #include "mozilla/RefPtr.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/SVGContentUtils.h" #include "mozilla/SVGContentUtils.h"
NS_IMPL_NS_NEW_SVG_ELEMENT(Path) NS_IMPL_NS_NEW_SVG_ELEMENT(Path)

View file

@ -8,6 +8,7 @@
#include "mozilla/layers/CompositorBridgeParent.h" #include "mozilla/layers/CompositorBridgeParent.h"
#include "mozilla/layers/CompositorThread.h" #include "mozilla/layers/CompositorThread.h"
#include "mozilla/StaticPrefs_layout.h"
namespace mozilla { namespace mozilla {
namespace layers { namespace layers {

View file

@ -15,6 +15,7 @@
#include "mozilla/gfx/PrintTarget.h" #include "mozilla/gfx/PrintTarget.h"
#include "mozilla/Preferences.h" // for Preferences #include "mozilla/Preferences.h" // for Preferences
#include "mozilla/Services.h" // for GetObserverService #include "mozilla/Services.h" // for GetObserverService
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/mozalloc.h" // for operator new #include "mozilla/mozalloc.h" // for operator new
#include "nsCRT.h" // for nsCRT #include "nsCRT.h" // for nsCRT
#include "nsDebug.h" // for NS_ASSERTION, etc #include "nsDebug.h" // for NS_ASSERTION, etc

View file

@ -14,6 +14,7 @@
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "mozilla/StaticPrefs_layout.h"
namespace mozilla { namespace mozilla {

View file

@ -16,6 +16,7 @@
#include "mozilla/FloatingPoint.h" #include "mozilla/FloatingPoint.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/WritingModes.h" #include "mozilla/WritingModes.h"
#include "nsBlockFrame.h" #include "nsBlockFrame.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"

View file

@ -71,6 +71,10 @@
namespace mozilla { namespace mozilla {
RetainedDisplayListData::RetainedDisplayListData()
: mModifiedFrameLimit(
StaticPrefs::layout_display_list_rebuild_frame_limit()) {}
void RetainedDisplayListData::AddModifiedFrame(nsIFrame* aFrame) { void RetainedDisplayListData::AddModifiedFrame(nsIFrame* aFrame) {
MOZ_ASSERT(!aFrame->IsFrameModified()); MOZ_ASSERT(!aFrame->IsFrameModified());
Flags(aFrame) += RetainedDisplayListData::FrameFlag::Modified; Flags(aFrame) += RetainedDisplayListData::FrameFlag::Modified;

View file

@ -26,10 +26,7 @@ struct RetainedDisplayListData {
enum class FrameFlag : uint8_t { Modified, HasProps, HadWillChange }; enum class FrameFlag : uint8_t { Modified, HasProps, HadWillChange };
using FrameFlags = mozilla::EnumSet<FrameFlag, uint8_t>; using FrameFlags = mozilla::EnumSet<FrameFlag, uint8_t>;
RetainedDisplayListData() : mModifiedFrameCount(0) { RetainedDisplayListData();
mModifiedFrameLimit =
StaticPrefs::layout_display_list_rebuild_frame_limit();
}
/** /**
* Adds the frame to modified frames list. * Adds the frame to modified frames list.
@ -86,8 +83,8 @@ struct RetainedDisplayListData {
private: private:
nsTHashMap<nsPtrHashKey<nsIFrame>, FrameFlags> mFrames; nsTHashMap<nsPtrHashKey<nsIFrame>, FrameFlags> mFrames;
uint32_t mModifiedFrameCount; uint32_t mModifiedFrameCount = 0;
uint32_t mModifiedFrameLimit; uint32_t mModifiedFrameLimit; // initialized to a pref value in constructor
}; };
enum class PartialUpdateResult { Failed, NoChange, Updated }; enum class PartialUpdateResult { Failed, NoChange, Updated };

View file

@ -13,7 +13,6 @@
#include "mozilla/CSSEnabledState.h" #include "mozilla/CSSEnabledState.h"
#include "mozilla/Compiler.h" #include "mozilla/Compiler.h"
#include "mozilla/PseudoStyleType.h" #include "mozilla/PseudoStyleType.h"
#include "mozilla/StaticPrefs_layout.h"
// Is this pseudo-element a CSS2 pseudo-element that can be specified // Is this pseudo-element a CSS2 pseudo-element that can be specified
// with the single colon syntax (in addition to the double-colon syntax, // with the single colon syntax (in addition to the double-colon syntax,

View file

@ -3311,6 +3311,15 @@ nsChangeHint nsStyleUIReset::CalcDifference(
return hint; return hint;
} }
StyleScrollbarWidth nsStyleUIReset::ScrollbarWidth() const {
if (MOZ_UNLIKELY(StaticPrefs::layout_css_scrollbar_width_thin_disabled())) {
if (mScrollbarWidth == StyleScrollbarWidth::Thin) {
return StyleScrollbarWidth::Auto;
}
}
return mScrollbarWidth;
}
//----------------------- //-----------------------
// nsStyleEffects // nsStyleEffects
// //

View file

@ -16,7 +16,6 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
#include "mozilla/ServoStyleConstsInlines.h" #include "mozilla/ServoStyleConstsInlines.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "nsColor.h" #include "nsColor.h"
#include "nsCoord.h" #include "nsCoord.h"
@ -1795,15 +1794,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset {
public: public:
mozilla::StyleUserSelect ComputedUserSelect() const { return mUserSelect; } mozilla::StyleUserSelect ComputedUserSelect() const { return mUserSelect; }
mozilla::StyleScrollbarWidth ScrollbarWidth() const { mozilla::StyleScrollbarWidth ScrollbarWidth() const;
if (MOZ_UNLIKELY(
mozilla::StaticPrefs::layout_css_scrollbar_width_thin_disabled())) {
if (mScrollbarWidth == mozilla::StyleScrollbarWidth::Thin) {
return mozilla::StyleScrollbarWidth::Auto;
}
}
return mScrollbarWidth;
}
nsCSSPropertyID GetTransitionProperty(uint32_t aIndex) const { nsCSSPropertyID GetTransitionProperty(uint32_t aIndex) const {
return mTransitions[aIndex % mTransitionPropertyCount].GetProperty(); return mTransitions[aIndex % mTransitionPropertyCount].GetProperty();

View file

@ -9,6 +9,7 @@
#include "gfxUtils.h" #include "gfxUtils.h"
#include "mozilla/ComputedStyle.h" #include "mozilla/ComputedStyle.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/gfx/2D.h" #include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Helpers.h" #include "mozilla/gfx/Helpers.h"
#include "nsTableFrame.h" #include "nsTableFrame.h"

View file

@ -13,6 +13,7 @@
#include "nsIContent.h" #include "nsIContent.h"
#include "mozilla/ComputedStyle.h" #include "mozilla/ComputedStyle.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_layout.h"
using namespace mozilla; using namespace mozilla;

View file

@ -10,6 +10,7 @@
#include "nsTableRowGroupFrame.h" #include "nsTableRowGroupFrame.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "mozilla/ComputedStyle.h" #include "mozilla/ComputedStyle.h"
#include "mozilla/StaticPrefs_layout.h"
#include "nsStyleConsts.h" #include "nsStyleConsts.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsIContent.h" #include "nsIContent.h"

View file

@ -6,6 +6,7 @@
#include "mozilla/ComputedStyle.h" #include "mozilla/ComputedStyle.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs_layout.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsTableRowFrame.h" #include "nsTableRowFrame.h"

View file

@ -6,6 +6,7 @@
#include "ThemeColors.h" #include "ThemeColors.h"
#include "mozilla/RelativeLuminanceUtils.h" #include "mozilla/RelativeLuminanceUtils.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/StaticPrefs_widget.h" #include "mozilla/StaticPrefs_widget.h"
#include "ThemeDrawing.h" #include "ThemeDrawing.h"
#include "nsNativeTheme.h" #include "nsNativeTheme.h"

View file

@ -54,6 +54,7 @@
#include "mozilla/ProfilerLabels.h" #include "mozilla/ProfilerLabels.h"
#include "mozilla/ScopeExit.h" #include "mozilla/ScopeExit.h"
#include "mozilla/StaticPrefs_apz.h" #include "mozilla/StaticPrefs_apz.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/StaticPrefs_mozilla.h" #include "mozilla/StaticPrefs_mozilla.h"
#include "mozilla/StaticPrefs_ui.h" #include "mozilla/StaticPrefs_ui.h"
#include "mozilla/StaticPrefs_widget.h" #include "mozilla/StaticPrefs_widget.h"

View file

@ -26,6 +26,7 @@
#include "mozilla/ServoCSSParser.h" #include "mozilla/ServoCSSParser.h"
#include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_browser.h"
#include "mozilla/StaticPrefs_editor.h" #include "mozilla/StaticPrefs_editor.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/StaticPrefs_ui.h" #include "mozilla/StaticPrefs_ui.h"
#include "mozilla/StaticPrefs_widget.h" #include "mozilla/StaticPrefs_widget.h"
#include "mozilla/dom/Document.h" #include "mozilla/dom/Document.h"