Bug 1607135 - Don't require TriggerImageLoads method when not needed. r=emilio
authorXidorn Quan <me@upsuper.org>
Tue, 07 Jan 2020 08:51:19 +0000
changeset 509057 c329b1a50ac1321b749f6604d23d0ae395807606
parent 509056 279c75cdf40bd55f87c126f0f3e2cdb4bdb05454
child 509058 655c310bdfe00c74da7dd48a2a11b31e57e075fb
push id104411
push usermozilla@upsuper.org
push dateTue, 07 Jan 2020 08:51:59 +0000
treeherderautoland@c329b1a50ac1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1607135
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1607135 - Don't require TriggerImageLoads method when not needed. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D58707
layout/style/ComputedStyleInlines.h
layout/style/nsStyleStruct.h
--- a/layout/style/ComputedStyleInlines.h
+++ b/layout/style/ComputedStyleInlines.h
@@ -16,24 +16,37 @@
 
 #include "mozilla/ComputedStyle.h"
 #include "mozilla/ServoComputedDataInlines.h"
 #include "mozilla/ServoUtils.h"
 #include "nsPresContext.h"
 
 namespace mozilla {
 
+namespace detail {
+template <typename T, const T* (ComputedStyle::*Method)() const>
+void TriggerImageLoads(dom::Document& aDocument, const ComputedStyle* aOldStyle,
+                       ComputedStyle* aStyle) {
+  if constexpr (T::kHasTriggerImageLoads) {
+    auto* old = aOldStyle ? (aOldStyle->*Method)() : nullptr;
+    auto* current = const_cast<T*>((aStyle->*Method)());
+    current->TriggerImageLoads(aDocument, old);
+  } else {
+    Unused << aOldStyle;
+    Unused << aStyle;
+  }
+}
+}  // namespace detail
+
 void ComputedStyle::StartImageLoads(dom::Document& aDocument,
                                     const ComputedStyle* aOldStyle) {
   MOZ_ASSERT(NS_IsMainThread());
-#define STYLE_STRUCT(name_)                                      \
-  if (nsStyle##name_::kHasTriggerImageLoads) {                   \
-    auto* old = aOldStyle ? aOldStyle->Style##name_() : nullptr; \
-    auto* current = const_cast<nsStyle##name_*>(Style##name_()); \
-    current->TriggerImageLoads(aDocument, old);                  \
-  }
+
+#define STYLE_STRUCT(name_)                                                \
+  detail::TriggerImageLoads<nsStyle##name_, &ComputedStyle::Style##name_>( \
+      aDocument, aOldStyle, this);
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 }
 
 }  // namespace mozilla
 
 #endif  // ComputedStyleInlines_h
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -75,18 +75,17 @@ inline Position Position::FromPercentage
 }
 
 }  // namespace mozilla
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleFont {
   nsStyleFont(const nsStyleFont& aStyleFont);
   explicit nsStyleFont(const mozilla::dom::Document&);
   ~nsStyleFont() { MOZ_COUNT_DTOR(nsStyleFont); }
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleFont*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleFont& aNewData) const;
 
   /**
    * Return aSize multiplied by the current text zoom factor (in aPresContext).
    * aSize is allowed to be negative, but the caller is expected to deal with
    * negative results.  The result is clamped to nscoord_MIN .. nscoord_MAX.
    */
@@ -588,17 +587,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   explicit nsStyleBackground(const mozilla::dom::Document&);
   nsStyleBackground(const nsStyleBackground& aOther);
   ~nsStyleBackground();
 
   // Resolves and tracks the images in mImage.  Only called with a Servo-backed
   // style system, where those images must be resolved later than the OMT
   // nsStyleBackground constructor call.
   void TriggerImageLoads(mozilla::dom::Document&, const nsStyleBackground*);
-  const static bool kHasTriggerImageLoads = true;
+  static constexpr bool kHasTriggerImageLoads = true;
 
   nsChangeHint CalcDifference(const nsStyleBackground& aNewData) const;
 
   // Return the background color as nscolor.
   nscolor BackgroundColor(const nsIFrame* aFrame) const;
   nscolor BackgroundColor(mozilla::ComputedStyle* aStyle) const;
 
   // True if this background is completely transparent.
@@ -622,18 +621,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   nsStyleImageLayers mImage;
   mozilla::StyleColor mBackgroundColor;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleMargin {
   explicit nsStyleMargin(const mozilla::dom::Document&);
   nsStyleMargin(const nsStyleMargin& aMargin);
   ~nsStyleMargin() { MOZ_COUNT_DTOR(nsStyleMargin); }
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleMargin*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleMargin& aNewData) const;
 
   bool GetMargin(nsMargin& aMargin) const {
     bool convertsToLength = mMargin.All(
         [](const auto& aLength) { return aLength.ConvertsToLength(); });
 
     if (!convertsToLength) {
@@ -661,18 +659,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   mozilla::StyleRect<mozilla::LengthPercentageOrAuto> mMargin;
   mozilla::StyleRect<mozilla::StyleLength> mScrollMargin;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePadding {
   explicit nsStylePadding(const mozilla::dom::Document&);
   nsStylePadding(const nsStylePadding& aPadding);
   ~nsStylePadding() { MOZ_COUNT_DTOR(nsStylePadding); }
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStylePadding*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStylePadding& aNewData) const;
 
   mozilla::StyleRect<mozilla::NonNegativeLengthPercentage> mPadding;
   mozilla::StyleRect<mozilla::NonNegativeLengthPercentageOrAuto> mScrollPadding;
 
   inline bool IsWidthDependent() const {
     return !mPadding.All(
@@ -708,17 +705,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   explicit nsStyleBorder(const mozilla::dom::Document&);
   nsStyleBorder(const nsStyleBorder& aBorder);
   ~nsStyleBorder();
 
   // Resolves and tracks mBorderImageSource.  Only called with a Servo-backed
   // style system, where those images must be resolved later than the OMT
   // nsStyleBorder constructor call.
   void TriggerImageLoads(mozilla::dom::Document&, const nsStyleBorder*);
-  const static bool kHasTriggerImageLoads = true;
+  static constexpr bool kHasTriggerImageLoads = true;
 
   nsChangeHint CalcDifference(const nsStyleBorder& aNewData) const;
 
   // Return whether aStyle is a visible style.  Invisible styles cause
   // the relevant computed border width to be 0.
   // Note that this does *not* consider the effects of 'border-image':
   // if border-style is none, but there is a loaded border image,
   // HasVisibleStyle will be false even though there *is* a border.
@@ -874,18 +871,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   nsStyleBorder& operator=(const nsStyleBorder& aOther) = delete;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleOutline {
   explicit nsStyleOutline(const mozilla::dom::Document&);
   nsStyleOutline(const nsStyleOutline& aOutline);
   ~nsStyleOutline() { MOZ_COUNT_DTOR(nsStyleOutline); }
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleOutline*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleOutline& aNewData) const;
 
   mozilla::StyleBorderRadius mOutlineRadius;
 
   // This is the specified value of outline-width, but with length values
   // computed to absolute.  mActualOutlineWidth stores the outline-width
   // value used by layout.  (We must store mOutlineWidth for the same
@@ -920,17 +916,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleList {
   explicit nsStyleList(const mozilla::dom::Document&);
   nsStyleList(const nsStyleList& aStyleList);
   ~nsStyleList();
 
   void TriggerImageLoads(mozilla::dom::Document&, const nsStyleList*);
-  const static bool kHasTriggerImageLoads = true;
+  static constexpr bool kHasTriggerImageLoads = true;
 
   nsChangeHint CalcDifference(const nsStyleList& aNewData,
                               const nsStyleDisplay& aOldDisplay) const;
 
   imgRequestProxy* GetListStyleImage() const {
     return mListStyleImage ? mListStyleImage->get() : nullptr;
   }
 
@@ -967,18 +963,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   using StyleMaxSize = mozilla::StyleMaxSize;
   using StyleFlexBasis = mozilla::StyleFlexBasis;
   using WritingMode = mozilla::WritingMode;
   using StyleImplicitGridTracks = mozilla::StyleImplicitGridTracks;
 
   explicit nsStylePosition(const mozilla::dom::Document&);
   nsStylePosition(const nsStylePosition& aOther);
   ~nsStylePosition();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStylePosition*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(
       const nsStylePosition& aNewData,
       const nsStyleVisibility& aOldStyleVisibility) const;
 
   // Returns whether we need to compute an hypothetical position if we were
   // absolutely positioned.
   bool NeedsHypotheticalPositionIfAbsPos() const {
@@ -1094,18 +1089,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
            aCoord.AsLengthPercentage().HasPercent();
   }
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTextReset {
   explicit nsStyleTextReset(const mozilla::dom::Document&);
   nsStyleTextReset(const nsStyleTextReset& aOther);
   ~nsStyleTextReset();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleTextReset*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   // Note the difference between this and
   // ComputedStyle::HasTextDecorationLines.
   bool HasTextDecorationLines() const {
     return mTextDecorationLine != mozilla::StyleTextDecorationLine::NONE &&
            mTextDecorationLine !=
                mozilla::StyleTextDecorationLine::COLOR_OVERRIDE;
   }
@@ -1122,18 +1116,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   mozilla::StyleColor mTextDecorationColor;
   mozilla::StyleTextDecorationLength mTextDecorationThickness;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleText {
   explicit nsStyleText(const mozilla::dom::Document&);
   nsStyleText(const nsStyleText& aOther);
   ~nsStyleText();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleText*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleText& aNewData) const;
 
   mozilla::StyleRGBA mColor;
   mozilla::StyleTextTransform mTextTransform;
   uint8_t mTextAlign;      // NS_STYLE_TEXT_ALIGN_*
   uint8_t mTextAlignLast;  // NS_STYLE_TEXT_ALIGN_*
   mozilla::StyleTextJustify mTextJustify;
@@ -1256,18 +1249,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   mozilla::LogicalSide TextEmphasisSide(mozilla::WritingMode aWM) const;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleVisibility {
   explicit nsStyleVisibility(const mozilla::dom::Document&);
   nsStyleVisibility(const nsStyleVisibility& aVisibility);
   ~nsStyleVisibility() { MOZ_COUNT_DTOR(nsStyleVisibility); }
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleVisibility*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleVisibility& aNewData) const;
 
   mozilla::StyleImageOrientation mImageOrientation;
   uint8_t mDirection;  // NS_STYLE_DIRECTION_*
   mozilla::StyleVisibility mVisible;
   uint8_t mImageRendering;  // NS_STYLE_IMAGE_RENDERING_*
   uint8_t mWritingMode;     // NS_STYLE_WRITING_MODE_*
@@ -1474,17 +1466,17 @@ struct StyleShapeSource final {
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay {
   typedef mozilla::StyleGeometryBox StyleGeometryBox;
 
   explicit nsStyleDisplay(const mozilla::dom::Document&);
   nsStyleDisplay(const nsStyleDisplay& aOther);
   ~nsStyleDisplay();
 
   void TriggerImageLoads(mozilla::dom::Document&, const nsStyleDisplay*);
-  const static bool kHasTriggerImageLoads = true;
+  static constexpr bool kHasTriggerImageLoads = true;
 
   nsChangeHint CalcDifference(const nsStyleDisplay& aNewData,
                               const nsStylePosition& aOldPosition) const;
 
   nsStyleAutoArray<mozilla::StyleTransition> mTransitions;
   // The number of elements in mTransitions that are not from repeating
   // a list due to another property being longer.
   uint32_t mTransitionTimingFunctionCount;
@@ -1893,50 +1885,46 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   void GenerateCombinedIndividualTransform();
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTable {
   explicit nsStyleTable(const mozilla::dom::Document&);
   nsStyleTable(const nsStyleTable& aOther);
   ~nsStyleTable();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleTable*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleTable& aNewData) const;
 
   uint8_t mLayoutStrategy;  // NS_STYLE_TABLE_LAYOUT_*
   int32_t mXSpan;  // The number of columns spanned by a colgroup or col
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTableBorder {
   explicit nsStyleTableBorder(const mozilla::dom::Document&);
   nsStyleTableBorder(const nsStyleTableBorder& aOther);
   ~nsStyleTableBorder();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleTableBorder*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleTableBorder& aNewData) const;
 
   nscoord mBorderSpacingCol;
   nscoord mBorderSpacingRow;
   mozilla::StyleBorderCollapse mBorderCollapse;
   uint8_t mCaptionSide;
   uint8_t mEmptyCells;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleContent {
   using CounterPair = mozilla::StyleGenericCounterPair<int32_t>;
 
   explicit nsStyleContent(const mozilla::dom::Document&);
   nsStyleContent(const nsStyleContent& aContent);
   ~nsStyleContent();
-
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleContent*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   size_t ContentCount() const {
     return mContent.IsItems() ? mContent.AsItems().Length() : 0;
   }
 
   const mozilla::StyleContentItem& ContentAt(size_t aIndex) const {
     return mContent.AsItems().AsSpan()[aIndex];
   }
@@ -1948,18 +1936,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   mozilla::StyleCounterSetOrReset mCounterReset;
   mozilla::StyleCounterSetOrReset mCounterSet;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset {
   explicit nsStyleUIReset(const mozilla::dom::Document&);
   nsStyleUIReset(const nsStyleUIReset& aOther);
   ~nsStyleUIReset();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleUIReset*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const;
 
   mozilla::StyleUserSelect mUserSelect;  // [reset](selection-style)
   mozilla::StyleScrollbarWidth mScrollbarWidth;
   uint8_t mForceBrokenImageIcon;  // (0 if not forcing, otherwise forcing)
   mozilla::StyleImeMode mIMEMode;
   mozilla::StyleWindowDragging mWindowDragging;
@@ -1988,17 +1975,17 @@ struct nsCursorImage {
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUI {
   explicit nsStyleUI(const mozilla::dom::Document&);
   nsStyleUI(const nsStyleUI& aOther);
   ~nsStyleUI();
 
   void TriggerImageLoads(mozilla::dom::Document&, const nsStyleUI*);
-  const static bool kHasTriggerImageLoads = true;
+  static constexpr bool kHasTriggerImageLoads = true;
 
   nsChangeHint CalcDifference(const nsStyleUI& aNewData) const;
 
   mozilla::StyleUserInput mUserInput;
   mozilla::StyleUserModify mUserModify;  // (modify-content)
   mozilla::StyleUserFocus mUserFocus;    // (auto-select)
   mozilla::StylePointerEvents mPointerEvents;
 
@@ -2013,35 +2000,33 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   bool HasCustomScrollbars() const { return !mScrollbarColor.IsAuto(); }
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleXUL {
   explicit nsStyleXUL(const mozilla::dom::Document&);
   nsStyleXUL(const nsStyleXUL& aSource);
   ~nsStyleXUL();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleXUL*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleXUL& aNewData) const;
 
   float mBoxFlex;
   int32_t mBoxOrdinal;
   mozilla::StyleBoxAlign mBoxAlign;
   mozilla::StyleBoxDirection mBoxDirection;
   mozilla::StyleBoxOrient mBoxOrient;
   mozilla::StyleBoxPack mBoxPack;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleColumn {
   explicit nsStyleColumn(const mozilla::dom::Document&);
   nsStyleColumn(const nsStyleColumn& aSource);
   ~nsStyleColumn();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleColumn*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleColumn& aNewData) const;
 
   // This is the maximum number of columns we can process. It's used in
   // nsColumnSetFrame.
   static const uint32_t kMaxColumnCount = 1000;
 
   // This represents the value of column-count: auto.
@@ -2077,18 +2062,17 @@ enum nsStyleSVGOpacitySource : uint8_t {
   eStyleSVGOpacitySource_ContextFillOpacity,
   eStyleSVGOpacitySource_ContextStrokeOpacity
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleSVG {
   explicit nsStyleSVG(const mozilla::dom::Document&);
   nsStyleSVG(const nsStyleSVG& aSource);
   ~nsStyleSVG();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleSVG*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleSVG& aNewData) const;
 
   mozilla::StyleSVGPaint mFill;
   mozilla::StyleSVGPaint mStroke;
   mozilla::StyleUrlOrNone mMarkerEnd;
   mozilla::StyleUrlOrNone mMarkerMid;
   mozilla::StyleUrlOrNone mMarkerStart;
@@ -2182,17 +2166,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   explicit nsStyleSVGReset(const mozilla::dom::Document&);
   nsStyleSVGReset(const nsStyleSVGReset& aSource);
   ~nsStyleSVGReset();
 
   // Resolves and tracks the images in mMask.  Only called with a Servo-backed
   // style system, where those images must be resolved later than the OMT
   // nsStyleSVGReset constructor call.
   void TriggerImageLoads(mozilla::dom::Document&, const nsStyleSVGReset*);
-  const static bool kHasTriggerImageLoads = true;
+  static constexpr bool kHasTriggerImageLoads = true;
 
   nsChangeHint CalcDifference(const nsStyleSVGReset& aNewData) const;
 
   bool HasClipPath() const {
     return mClipPath.GetType() != mozilla::StyleShapeSourceType::None;
   }
 
   bool HasMask() const;
@@ -2222,18 +2206,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   uint8_t mVectorEffect;  // NS_STYLE_VECTOR_EFFECT_*
   uint8_t mMaskType;      // NS_STYLE_MASK_TYPE_*
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleEffects {
   explicit nsStyleEffects(const mozilla::dom::Document&);
   nsStyleEffects(const nsStyleEffects& aSource);
   ~nsStyleEffects();
-  void TriggerImageLoads(mozilla::dom::Document&, const nsStyleEffects*) {}
-  const static bool kHasTriggerImageLoads = false;
+  static constexpr bool kHasTriggerImageLoads = false;
 
   nsChangeHint CalcDifference(const nsStyleEffects& aNewData) const;
 
   bool HasFilters() const { return !mFilters.IsEmpty(); }
 
   bool HasBackdropFilters() const { return !mBackdropFilters.IsEmpty(); }
 
   bool HasBoxShadowWithInset(bool aInset) const {