Bug 1497589 Part 2: Rename Flex API classes to avoid namespace collision with nsFlexContainerFrame classes. r=dholbert
authorBrad Werth <bwerth@mozilla.com>
Wed, 17 Oct 2018 20:22:26 +0000
changeset 500399 d0b82fc9252d1c017cfd7e3381873c9e2ee9ee8f
parent 500398 c597d36a2d7ac1b32de3d57054a87176737ae814
child 500400 082aaca611f9f0e13cd82d6cc708b687cfd35b7c
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1497589
milestone64.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 1497589 Part 2: Rename Flex API classes to avoid namespace collision with nsFlexContainerFrame classes. r=dholbert Depends on D9022 Differential Revision: https://phabricator.services.mozilla.com/D9023
dom/chrome-webidl/Flex.webidl
dom/flex/Flex.cpp
dom/flex/Flex.h
dom/flex/FlexItem.cpp
dom/flex/FlexItem.h
dom/flex/FlexItemValues.cpp
dom/flex/FlexItemValues.h
dom/flex/FlexLine.cpp
dom/flex/FlexLine.h
dom/flex/FlexLineValues.cpp
dom/flex/FlexLineValues.h
dom/flex/moz.build
--- a/dom/chrome-webidl/Flex.webidl
+++ b/dom/chrome-webidl/Flex.webidl
@@ -7,47 +7,47 @@
 /**
  * These objects support visualization of flex containers by the
  * dev tools.
  */
 
 [ChromeOnly]
 interface Flex
 {
-  sequence<FlexLine> getLines();
+  sequence<FlexLineValues> getLines();
 };
 
 /**
  * Lines with items that have been shrunk are shrinking; with items
  * that have grown are growing, and all others are unchanged.
  */
 enum FlexLineGrowthState { "unchanged", "shrinking", "growing" };
 
 [ChromeOnly]
-interface FlexLine
+interface FlexLineValues
 {
   readonly attribute FlexLineGrowthState growthState;
   readonly attribute double crossStart;
   readonly attribute double crossSize;
 
   // firstBaselineOffset measures from flex-start edge.
   readonly attribute double firstBaselineOffset;
 
   // lastBaselineOffset measures from flex-end edge.
   readonly attribute double lastBaselineOffset;
 
   /**
-   * getItems() returns FlexItems only for the Elements in this Flex
-   * container -- ignoring struts and abs-pos Elements.
+   * getItems() returns FlexItemValues only for the Elements in
+   * this Flex container -- ignoring struts and abs-pos Elements.
    */
-  sequence<FlexItem> getItems();
+  sequence<FlexItemValues> getItems();
 };
 
 [ChromeOnly]
-interface FlexItem
+interface FlexItemValues
 {
   readonly attribute Node? node;
   readonly attribute double mainBaseSize;
   readonly attribute double mainDeltaSize;
   readonly attribute double mainMinSize;
   readonly attribute double mainMaxSize;
   readonly attribute double crossMinSize;
   readonly attribute double crossMaxSize;
--- a/dom/flex/Flex.cpp
+++ b/dom/flex/Flex.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Flex.h"
 
-#include "FlexLine.h"
+#include "FlexLineValues.h"
 #include "mozilla/dom/FlexBinding.h"
 #include "nsFlexContainerFrame.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Flex, mParent, mLines)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(Flex)
@@ -32,28 +32,28 @@ Flex::Flex(Element* aParent,
   // going to keep it around.
   const ComputedFlexContainerInfo* containerInfo =
     aFrame->GetFlexContainerInfo();
   MOZ_ASSERT(containerInfo, "Should only be passed a frame with info.");
 
   mLines.SetLength(containerInfo->mLines.Length());
   uint32_t index = 0;
   for (auto&& l : containerInfo->mLines) {
-    FlexLine* line = new FlexLine(this, &l);
+    FlexLineValues* line = new FlexLineValues(this, &l);
     mLines.ElementAt(index) = line;
     index++;
   }
 }
 
 JSObject*
 Flex::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return Flex_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 void
-Flex::GetLines(nsTArray<RefPtr<FlexLine>>& aResult)
+Flex::GetLines(nsTArray<RefPtr<FlexLineValues>>& aResult)
 {
   aResult.AppendElements(mLines);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/flex/Flex.h
+++ b/dom/flex/Flex.h
@@ -11,17 +11,17 @@
 #include "nsISupports.h"
 #include "nsWrapperCache.h"
 
 class nsFlexContainerFrame;
 
 namespace mozilla {
 namespace dom {
 
-class FlexLine;
+class FlexLineValues;
 
 class Flex : public nsISupports
            , public nsWrapperCache
 {
 public:
   explicit Flex(Element* aParent, nsFlexContainerFrame* aFrame);
 
 protected:
@@ -32,19 +32,19 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Flex)
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
   Element* GetParentObject()
   {
     return mParent;
   }
 
-  void GetLines(nsTArray<RefPtr<FlexLine>>& aResult);
+  void GetLines(nsTArray<RefPtr<FlexLineValues>>& aResult);
 
 protected:
   nsCOMPtr<Element> mParent;
-  nsTArray<RefPtr<FlexLine>> mLines;
+  nsTArray<RefPtr<FlexLineValues>> mLines;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_Flex_h */
rename from dom/flex/FlexItem.cpp
rename to dom/flex/FlexItemValues.cpp
--- a/dom/flex/FlexItem.cpp
+++ b/dom/flex/FlexItemValues.cpp
@@ -1,26 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "FlexItem.h"
+#include "FlexItemValues.h"
 
 #include "mozilla/dom/FlexBinding.h"
 #include "nsFlexContainerFrame.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexItem, mParent)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexItem)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexItem)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexItem)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexItemValues, mParent)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexItemValues)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexItemValues)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexItemValues)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 /**
  * Utility function to convert a nscoord size to CSS pixel values, with
  * graceful treatment of NS_UNCONSTRAINEDSIZE (which this function converts to
  * the double "positive infinity" value).
@@ -33,18 +33,18 @@ static double
 ToPossiblyUnconstrainedPixels(nscoord aSize)
 {
   if (aSize == NS_UNCONSTRAINEDSIZE) {
     return std::numeric_limits<double>::infinity();
   }
   return nsPresContext::AppUnitsToDoubleCSSPixels(aSize);
 }
 
-FlexItem::FlexItem(FlexLine* aParent,
-                   const ComputedFlexItemInfo* aItem)
+FlexItemValues::FlexItemValues(FlexLineValues* aParent,
+                               const ComputedFlexItemInfo* aItem)
   : mParent(aParent)
 {
   MOZ_ASSERT(aItem,
     "Should never be instantiated with a null ComputedFlexLineInfo.");
 
   // Eagerly copy values from aItem, because we're not
   // going to keep it around.
   mNode = aItem->mNode;
@@ -58,57 +58,57 @@ FlexItem::FlexItem(FlexLine* aParent,
     aItem->mMainMinSize);
   mMainMaxSize = ToPossiblyUnconstrainedPixels(aItem->mMainMaxSize);
   mCrossMinSize = nsPresContext::AppUnitsToDoubleCSSPixels(
     aItem->mCrossMinSize);
   mCrossMaxSize = ToPossiblyUnconstrainedPixels(aItem->mCrossMaxSize);
 }
 
 JSObject*
-FlexItem::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
+FlexItemValues::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return FlexItem_Binding::Wrap(aCx, this, aGivenProto);
+  return FlexItemValues_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 nsINode*
-FlexItem::GetNode() const
+FlexItemValues::GetNode() const
 {
   return mNode;
 }
 
 double
-FlexItem::MainBaseSize() const
+FlexItemValues::MainBaseSize() const
 {
   return mMainBaseSize;
 }
 
 double
-FlexItem::MainDeltaSize() const
+FlexItemValues::MainDeltaSize() const
 {
   return mMainDeltaSize;
 }
 
 double
-FlexItem::MainMinSize() const
+FlexItemValues::MainMinSize() const
 {
   return mMainMinSize;
 }
 
 double
-FlexItem::MainMaxSize() const
+FlexItemValues::MainMaxSize() const
 {
   return mMainMaxSize;
 }
 
 double
-FlexItem::CrossMinSize() const
+FlexItemValues::CrossMinSize() const
 {
   return mCrossMinSize;
 }
 
 double
-FlexItem::CrossMaxSize() const
+FlexItemValues::CrossMaxSize() const
 {
   return mCrossMaxSize;
 }
 
 } // namespace dom
 } // namespace mozilla
rename from dom/flex/FlexItem.h
rename to dom/flex/FlexItemValues.h
--- a/dom/flex/FlexItem.h
+++ b/dom/flex/FlexItemValues.h
@@ -1,65 +1,65 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_FlexItem_h
-#define mozilla_dom_FlexItem_h
+#ifndef mozilla_dom_FlexItemValues_h
+#define mozilla_dom_FlexItemValues_h
 
 #include "mozilla/dom/FlexBinding.h"
 #include "nsISupports.h"
 #include "nsWrapperCache.h"
 
 struct ComputedFlexItemInfo;
 
 namespace mozilla {
 namespace dom {
 
-class FlexLine;
+class FlexLineValues;
 
-class FlexItem : public nsISupports
-               , public nsWrapperCache
+class FlexItemValues : public nsISupports
+                     , public nsWrapperCache
 {
 public:
-  explicit FlexItem(FlexLine* aParent,
-                    const ComputedFlexItemInfo* aItem);
+  explicit FlexItemValues(FlexLineValues* aParent,
+                          const ComputedFlexItemInfo* aItem);
 
 protected:
-  virtual ~FlexItem() = default;
+  virtual ~FlexItemValues() = default;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexItem)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexItemValues)
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
-  FlexLine* GetParentObject()
+  FlexLineValues* GetParentObject()
   {
     return mParent;
   }
 
   nsINode* GetNode() const;
   double MainBaseSize() const;
   double MainDeltaSize() const;
   double MainMinSize() const;
   double MainMaxSize() const;
   double CrossMinSize() const;
   double CrossMaxSize() const;
 
 protected:
-  RefPtr<FlexLine> mParent;
+  RefPtr<FlexLineValues> mParent;
   RefPtr<nsINode> mNode;
 
   // These sizes are all CSS pixel units.
   double mMainBaseSize;
   double mMainDeltaSize;
   double mMainMinSize;
   double mMainMaxSize;
   double mCrossMinSize;
   double mCrossMaxSize;
 };
 
 } // namespace dom
 } // namespace mozilla
 
-#endif /* mozilla_dom_FlexItem_h */
+#endif /* mozilla_dom_FlexItemValues_h */
rename from dom/flex/FlexLine.cpp
rename to dom/flex/FlexLineValues.cpp
--- a/dom/flex/FlexLine.cpp
+++ b/dom/flex/FlexLineValues.cpp
@@ -1,33 +1,33 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "FlexLine.h"
+#include "FlexLineValues.h"
 
-#include "FlexItem.h"
+#include "FlexItemValues.h"
 #include "mozilla/dom/FlexBinding.h"
 #include "nsFlexContainerFrame.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexLine, mParent, mItems)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexLine)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexLine)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexLine)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FlexLineValues, mParent, mItems)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(FlexLineValues)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(FlexLineValues)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlexLineValues)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
-FlexLine::FlexLine(Flex* aParent,
-                   const ComputedFlexLineInfo* aLine)
+FlexLineValues::FlexLineValues(Flex* aParent,
+                               const ComputedFlexLineInfo* aLine)
   : mParent(aParent)
 {
   MOZ_ASSERT(aLine,
     "Should never be instantiated with a null ComputedFlexLineInfo.");
 
   // Eagerly copy values from aLine, because we're not
   // going to keep it around.
   switch (aLine->mGrowthState) {
@@ -51,58 +51,58 @@ FlexLine::FlexLine(Flex* aParent,
   mFirstBaselineOffset = nsPresContext::AppUnitsToDoubleCSSPixels(
     aLine->mFirstBaselineOffset);
   mLastBaselineOffset = nsPresContext::AppUnitsToDoubleCSSPixels(
     aLine->mLastBaselineOffset);
 
   mItems.SetLength(aLine->mItems.Length());
   uint32_t index = 0;
   for (auto&& i : aLine->mItems) {
-    FlexItem* item = new FlexItem(this, &i);
+    FlexItemValues* item = new FlexItemValues(this, &i);
     mItems.ElementAt(index) = item;
     index++;
   }
 }
 
 JSObject*
-FlexLine::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
+FlexLineValues::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return FlexLine_Binding::Wrap(aCx, this, aGivenProto);
+  return FlexLineValues_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 FlexLineGrowthState
-FlexLine::GrowthState() const
+FlexLineValues::GrowthState() const
 {
   return mGrowthState;
 }
 
 double
-FlexLine::CrossStart() const
+FlexLineValues::CrossStart() const
 {
   return mCrossStart;
 }
 
 double
-FlexLine::CrossSize() const
+FlexLineValues::CrossSize() const
 {
   return mCrossSize;
 }
 
 double
-FlexLine::FirstBaselineOffset() const
+FlexLineValues::FirstBaselineOffset() const
 {
   return mFirstBaselineOffset;
 }
 
 double
-FlexLine::LastBaselineOffset() const
+FlexLineValues::LastBaselineOffset() const
 {
   return mLastBaselineOffset;
 }
 
 void
-FlexLine::GetItems(nsTArray<RefPtr<FlexItem>>& aResult)
+FlexLineValues::GetItems(nsTArray<RefPtr<FlexItemValues>>& aResult)
 {
   aResult.AppendElements(mItems);
 }
 
 } // namespace dom
 } // namespace mozilla
rename from dom/flex/FlexLine.h
rename to dom/flex/FlexLineValues.h
--- a/dom/flex/FlexLine.h
+++ b/dom/flex/FlexLineValues.h
@@ -1,65 +1,65 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_dom_FlexLine_h
-#define mozilla_dom_FlexLine_h
+#ifndef mozilla_dom_FlexLineValues_h
+#define mozilla_dom_FlexLineValues_h
 
 #include "mozilla/dom/FlexBinding.h"
 #include "nsISupports.h"
 #include "nsWrapperCache.h"
 
 struct ComputedFlexLineInfo;
 
 namespace mozilla {
 namespace dom {
 
 class Flex;
-class FlexItem;
+class FlexItemValues;
 
-class FlexLine : public nsISupports
-               , public nsWrapperCache
+class FlexLineValues : public nsISupports
+                     , public nsWrapperCache
 {
 public:
-  explicit FlexLine(Flex* aParent,
-                    const ComputedFlexLineInfo* aLine);
+  explicit FlexLineValues(Flex* aParent,
+                          const ComputedFlexLineInfo* aLine);
 
 protected:
-  virtual ~FlexLine() = default;
+  virtual ~FlexLineValues() = default;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexLine)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexLineValues)
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
   Flex* GetParentObject()
   {
     return mParent;
   }
 
   FlexLineGrowthState GrowthState() const;
   double CrossStart() const;
   double CrossSize() const;
   double FirstBaselineOffset() const;
   double LastBaselineOffset() const;
 
-  void GetItems(nsTArray<RefPtr<FlexItem>>& aResult);
+  void GetItems(nsTArray<RefPtr<FlexItemValues>>& aResult);
 
 protected:
   RefPtr<Flex> mParent;
 
   FlexLineGrowthState mGrowthState;
   double mCrossStart;
   double mCrossSize;
   double mFirstBaselineOffset;
   double mLastBaselineOffset;
 
-  nsTArray<RefPtr<FlexItem>> mItems;
+  nsTArray<RefPtr<FlexItemValues>> mItems;
 };
 
 } // namespace dom
 } // namespace mozilla
 
-#endif /* mozilla_dom_FlexLine_h */
+#endif /* mozilla_dom_FlexLineValues_h */
--- a/dom/flex/moz.build
+++ b/dom/flex/moz.build
@@ -6,23 +6,23 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "CSS Parsing and Computation")
 
 MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
 
 EXPORTS.mozilla.dom += [
     'Flex.h',
-    'FlexItem.h',
-    'FlexLine.h',
+    'FlexItemValues.h',
+    'FlexLineValues.h',
 ]
 
 UNIFIED_SOURCES += [
     'Flex.cpp',
-    'FlexItem.cpp',
-    'FlexLine.cpp',
+    'FlexItemValues.cpp',
+    'FlexLineValues.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/layout/generic',
 ]
 
 FINAL_LIBRARY = 'xul'