Bug 1573268 - remove the varcache definition for svg.transform-box.enabled. r=njn
authorKristen Wright <kwright@mozilla.com>
Wed, 14 Aug 2019 00:17:04 +0000
changeset 488025 c657ac21f56a770e35b92501679c559fc4e5a054
parent 488024 33dd94200b51e9b96f88c38b36ca2028e70b597d
child 488026 def3d7b5c6369629e59f12370f90f7749edb0b18
push id36434
push usercbrindusan@mozilla.com
push dateThu, 15 Aug 2019 09:44:30 +0000
treeherdermozilla-central@144fbfb409b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1573268
milestone70.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 1573268 - remove the varcache definition for svg.transform-box.enabled. r=njn svg.transform-box.enabled is already a static pref, so I removed the varcache definition of it in nsLayoutUtils. Differential Revision: https://phabricator.services.mozilla.com/D41850
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/style/nsStyleTransformMatrix.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -179,18 +179,16 @@ using mozilla::dom::HTMLMediaElement_Bin
 // TODO: remove, see bug 598468.
 bool nsLayoutUtils::gPreventAssertInCompareTreePosition = false;
 #endif  // DEBUG
 
 typedef ScrollableLayerGuid::ViewID ViewID;
 typedef nsStyleTransformMatrix::TransformReferenceBox TransformReferenceBox;
 
 /* static */
-bool nsLayoutUtils::sSVGTransformBoxEnabled;
-/* static */
 uint32_t nsLayoutUtils::sIdlePeriodDeadlineLimit;
 /* static */
 uint32_t nsLayoutUtils::sQuiescentFramesBeforeIdlePeriod;
 
 static ViewID sScrollIdCounter = ScrollableLayerGuid::START_SCROLL_ID;
 
 typedef nsDataHashtable<nsUint64HashKey, nsIContent*> ContentMap;
 static ContentMap* sContentMap = nullptr;
@@ -7958,18 +7956,16 @@ size_t nsLayoutUtils::SizeOfTextRunsForF
       total += SizeOfTextRunsForFrames(e.get(), aMallocSizeOf, clear);
     }
   }
   return total;
 }
 
 /* static */
 void nsLayoutUtils::Initialize() {
-  Preferences::AddBoolVarCache(&sSVGTransformBoxEnabled,
-                               "svg.transform-box.enabled");
   Preferences::AddUintVarCache(&sIdlePeriodDeadlineLimit,
                                "layout.idle_period.time_limit",
                                DEFAULT_IDLE_PERIOD_TIME_LIMIT);
   Preferences::AddUintVarCache(&sQuiescentFramesBeforeIdlePeriod,
                                "layout.idle_period.required_quiescent_frames",
                                DEFAULT_QUIESCENT_FRAMES);
 
   nsComputedDOMStyle::RegisterPrefChangeCallbacks();
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2437,18 +2437,16 @@ class nsLayoutUtils {
    * aMinFontSize must be the result of one of the
    *   InflationMinFontSizeFor methods above.
    */
   static float FontSizeInflationInner(const nsIFrame* aFrame,
                                       nscoord aMinFontSize);
 
   static bool FontSizeInflationEnabled(nsPresContext* aPresContext);
 
-  static bool SVGTransformBoxEnabled() { return sSVGTransformBoxEnabled; }
-
   static uint32_t IdlePeriodDeadlineLimit() { return sIdlePeriodDeadlineLimit; }
 
   static uint32_t QuiescentFramesBeforeIdlePeriod() {
     return sQuiescentFramesBeforeIdlePeriod;
   }
 
   /**
    * Returns true if the nglayout.debug.invalidation pref is set to true.
@@ -2989,17 +2987,16 @@ class nsLayoutUtils {
 
   /**
    * Generate the motion path transform result.
    **/
   static mozilla::Maybe<mozilla::MotionPathData> ResolveMotionPath(
       const nsIFrame* aFrame);
 
  private:
-  static bool sSVGTransformBoxEnabled;
   static uint32_t sIdlePeriodDeadlineLimit;
   static uint32_t sQuiescentFramesBeforeIdlePeriod;
 
   /**
    * Helper function for LogTestDataForPaint().
    */
   static void DoLogTestDataForPaint(mozilla::layers::LayerManager* aManager,
                                     ViewID aScrollId, const std::string& aKey,
--- a/layout/style/nsStyleTransformMatrix.cpp
+++ b/layout/style/nsStyleTransformMatrix.cpp
@@ -8,16 +8,17 @@
  * A class used for intermediate representations of the -moz-transform property.
  */
 
 #include "nsStyleTransformMatrix.h"
 #include "nsLayoutUtils.h"
 #include "nsPresContext.h"
 #include "nsSVGUtils.h"
 #include "mozilla/ServoBindings.h"
+#include "mozilla/StaticPrefs_svg.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "gfxMatrix.h"
 #include "gfxQuaternion.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
 namespace nsStyleTransformMatrix {
@@ -42,17 +43,17 @@ void TransformReferenceBox::EnsureDimens
     return;
   }
 
   MOZ_ASSERT(mFrame);
 
   mIsCached = true;
 
   if (mFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) {
-    if (!nsLayoutUtils::SVGTransformBoxEnabled()) {
+    if (!StaticPrefs::svg_transform_box_enabled()) {
       mX = -mFrame->GetPosition().x;
       mY = -mFrame->GetPosition().y;
       Size contextSize = nsSVGUtils::GetContextSize(mFrame);
       mWidth = nsPresContext::CSSPixelsToAppUnits(contextSize.width);
       mHeight = nsPresContext::CSSPixelsToAppUnits(contextSize.height);
     } else if (mFrame->StyleDisplay()->mTransformBox ==
                StyleGeometryBox::FillBox) {
       // Percentages in transforms resolve against the SVG bbox, and the