Bug 1388939, part 1 - Rename nsFrameManagerBase::mUndisplayedMap to mDisplayNoneMap. r=dholbert draft
authorJonathan Watt <jwatt@jwatt.org>
Thu, 10 Aug 2017 01:39:37 +0100
changeset 643659 c31a7ef655ceb304111efa3ec3cf419c97cf99df
parent 643325 ec16e8357305e1b1737bfe195ff22e23b5b48de2
child 643660 b51659c11d3e6a782cde04f4286fa9a4cce740c3
push id73172
push userjwatt@jwatt.org
push dateThu, 10 Aug 2017 00:52:54 +0000
reviewersdholbert
bugs1388939
milestone57.0a1
Bug 1388939, part 1 - Rename nsFrameManagerBase::mUndisplayedMap to mDisplayNoneMap. r=dholbert MozReview-Commit-ID: 8ZQqRZUMuDo
layout/base/nsFrameManager.cpp
layout/base/nsFrameManager.h
layout/base/nsFrameManagerBase.h
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -44,17 +44,17 @@
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 
 nsFrameManagerBase::nsFrameManagerBase()
   : mPresShell(nullptr)
   , mRootFrame(nullptr)
-  , mUndisplayedMap(nullptr)
+  , mDisplayNoneMap(nullptr)
   , mDisplayContentsMap(nullptr)
   , mIsDestroyingFrames(false)
 {
 }
 
 //----------------------------------------------------------------------
 
 /**
@@ -117,18 +117,18 @@ nsFrameManager::Destroy()
   // Destroy the frame hierarchy.
   mPresShell->SetIgnoreFrameDestruction(true);
 
   if (mRootFrame) {
     mRootFrame->Destroy();
     mRootFrame = nullptr;
   }
 
-  delete mUndisplayedMap;
-  mUndisplayedMap = nullptr;
+  delete mDisplayNoneMap;
+  mDisplayNoneMap = nullptr;
   delete mDisplayContentsMap;
   mDisplayContentsMap = nullptr;
 
   mPresShell = nullptr;
 }
 
 //----------------------------------------------------------------------
 
@@ -174,17 +174,17 @@ nsFrameManager::GetAllUndisplayedNodesIn
                                                nsIContent* aParentContent)
 {
   return aMap ? aMap->GetFirstNode(aParentContent) : nullptr;
 }
 
 UndisplayedNode*
 nsFrameManager::GetAllUndisplayedContentIn(nsIContent* aParentContent)
 {
-  return GetAllUndisplayedNodesInMapFor(mUndisplayedMap, aParentContent);
+  return GetAllUndisplayedNodesInMapFor(mDisplayNoneMap, aParentContent);
 }
 
 /* static */ void
 nsFrameManager::SetStyleContextInMap(UndisplayedMap* aMap,
                                      nsIContent* aContent,
                                      nsStyleContext* aStyleContext)
 {
   MOZ_ASSERT(!aStyleContext->GetPseudo(),
@@ -208,20 +208,20 @@ nsFrameManager::SetStyleContextInMap(Und
 #endif
   aMap->AddNodeFor(parent, aContent, aStyleContext);
 }
 
 void
 nsFrameManager::SetUndisplayedContent(nsIContent* aContent,
                                       nsStyleContext* aStyleContext)
 {
-  if (!mUndisplayedMap) {
-    mUndisplayedMap = new UndisplayedMap;
+  if (!mDisplayNoneMap) {
+    mDisplayNoneMap = new UndisplayedMap;
   }
-  SetStyleContextInMap(mUndisplayedMap, aContent, aStyleContext);
+  SetStyleContextInMap(mDisplayNoneMap, aContent, aStyleContext);
 }
 
 /* static */ void
 nsFrameManager::ChangeStyleContextInMap(UndisplayedMap* aMap,
                                         nsIContent* aContent,
                                         nsStyleContext* aStyleContext)
 {
   MOZ_ASSERT(aMap, "expecting a map");
@@ -246,24 +246,24 @@ void
 nsFrameManager::ClearUndisplayedContentIn(nsIContent* aContent,
                                           nsIContent* aParentContent)
 {
 #ifdef DEBUG_UNDISPLAYED_MAP
   static int i = 0;
   printf("ClearUndisplayedContent(%d): content=%p parent=%p --> ", i++, (void *)aContent, (void*)aParentContent);
 #endif
 
-  if (!mUndisplayedMap) {
+  if (!mDisplayNoneMap) {
     return;
   }
 
-  for (UndisplayedNode* node = mUndisplayedMap->GetFirstNode(aParentContent);
+  for (UndisplayedNode* node = mDisplayNoneMap->GetFirstNode(aParentContent);
        node; node = node->getNext()) {
     if (node->mContent == aContent) {
-      mUndisplayedMap->RemoveNodeFor(aParentContent, node);
+      mDisplayNoneMap->RemoveNodeFor(aParentContent, node);
 
 #ifdef DEBUG_UNDISPLAYED_MAP
       printf( "REMOVED!\n");
 #endif
       // make sure that there are no more entries for the same content
       MOZ_ASSERT(!GetUndisplayedContent(aContent),
                  "Found more undisplayed content data after removal");
       return;
@@ -278,18 +278,18 @@ nsFrameManager::ClearUndisplayedContentI
 void
 nsFrameManager::ClearAllMapsFor(nsIContent* aParentContent)
 {
 #if defined(DEBUG_UNDISPLAYED_MAP) || defined(DEBUG_DISPLAY_CONTENTS_MAP)
   static int i = 0;
   printf("ClearAllMapsFor(%d): parent=%p \n", i++, aParentContent);
 #endif
 
-  if (mUndisplayedMap) {
-    mUndisplayedMap->RemoveNodesFor(aParentContent);
+  if (mDisplayNoneMap) {
+    mDisplayNoneMap->RemoveNodesFor(aParentContent);
   }
   if (mDisplayContentsMap) {
     nsAutoPtr<LinkedList<UndisplayedNode>> list =
       mDisplayContentsMap->UnlinkNodesFor(aParentContent);
     if (list) {
       while (UndisplayedNode* node = list->popFirst()) {
         ClearAllMapsFor(node->mContent);
         delete node;
--- a/layout/base/nsFrameManager.h
+++ b/layout/base/nsFrameManager.h
@@ -76,29 +76,29 @@ public:
    * Destroy should be called when the frame tree managed by the frame
    * manager is no longer being displayed.
    */
   void Destroy();
 
   // Mapping undisplayed content
   nsStyleContext* GetUndisplayedContent(const nsIContent* aContent)
   {
-    if (!mUndisplayedMap) {
+    if (!mDisplayNoneMap) {
       return nullptr;
     }
-    return GetStyleContextInMap(mUndisplayedMap, aContent);
+    return GetStyleContextInMap(mDisplayNoneMap, aContent);
   }
   mozilla::UndisplayedNode*
     GetAllUndisplayedContentIn(nsIContent* aParentContent);
   void SetUndisplayedContent(nsIContent* aContent,
                              nsStyleContext* aStyleContext);
   void ChangeUndisplayedContent(nsIContent* aContent,
                                 nsStyleContext* aStyleContext)
   {
-    ChangeStyleContextInMap(mUndisplayedMap, aContent, aStyleContext);
+    ChangeStyleContextInMap(mDisplayNoneMap, aContent, aStyleContext);
   }
 
   void ClearUndisplayedContentIn(nsIContent* aContent,
                                  nsIContent* aParentContent);
 
   // display:contents related methods:
   /**
    * Return the registered display:contents style context for aContent, if any.
--- a/layout/base/nsFrameManagerBase.h
+++ b/layout/base/nsFrameManagerBase.h
@@ -46,14 +46,14 @@ public:
   }
 
 protected:
   class UndisplayedMap;
 
   // weak link, because the pres shell owns us
   nsIPresShell* MOZ_NON_OWNING_REF mPresShell;
   nsIFrame*                       mRootFrame;
-  UndisplayedMap*                 mUndisplayedMap;
+  UndisplayedMap*                 mDisplayNoneMap;
   UndisplayedMap*                 mDisplayContentsMap;
   bool                            mIsDestroyingFrames;  // The frame manager is destroying some frame(s).
 };
 
 #endif