Bug 1388939, part 7 - Give clear names to the nsFrameManager methods for unregistering undisplayed style contexts. r=dholbert draft
authorJonathan Watt <jwatt@jwatt.org>
Thu, 10 Aug 2017 01:50:24 +0100
changeset 643665 e81377cf1f6a056875b8520324a959f11416dbaa
parent 643664 41bd96aeec6f6e50d0d9feaa1999fe006caa5270
child 643691 8746dbcae1445687ccf141fb83e961441a10ad92
push id73172
push userjwatt@jwatt.org
push dateThu, 10 Aug 2017 00:52:54 +0000
reviewersdholbert
bugs1388939
milestone57.0a1
Bug 1388939, part 7 - Give clear names to the nsFrameManager methods for unregistering undisplayed style contexts. r=dholbert MozReview-Commit-ID: JqRf6FTMWZM
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameManager.cpp
layout/base/nsFrameManager.h
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -8636,17 +8636,17 @@ nsCSSFrameConstructor::ContentRemoved(ns
     }
   }
 #endif
 
   nsIFrame* childFrame = aChild->GetPrimaryFrame();
   if (!childFrame || childFrame->GetContent() != aChild) {
     // XXXbz the GetContent() != aChild check is needed due to bug 135040.
     // Remove it once that's fixed.
-    ClearUndisplayedContentIn(aChild, aContainer);
+    UnregisterDisplayNoneStyleFor(aChild, aContainer);
   }
   MOZ_ASSERT(!childFrame || !GetDisplayContentsStyleFor(aChild),
              "display:contents nodes shouldn't have a frame");
   if (!childFrame && GetDisplayContentsStyleFor(aChild)) {
     nsIContent* ancestor = aContainer;
     MOZ_ASSERT(ancestor, "display: contents on the root?");
     while (!ancestor->GetPrimaryFrame()) {
       // FIXME(emilio): Should this use the flattened tree parent instead?
@@ -8672,17 +8672,17 @@ nsCSSFrameConstructor::ContentRemoved(ns
         LAYOUT_PHASE_TEMP_EXIT();
         ContentRemoved(aChild, c, nullptr, aFlags, aDidReconstruct, aDestroyedFramesFor);
         LAYOUT_PHASE_TEMP_REENTER();
         if (aFlags != REMOVE_DESTROY_FRAMES && *aDidReconstruct) {
           return;
         }
       }
     }
-    ClearDisplayContentsIn(aChild, aContainer);
+    UnregisterDisplayContentsStyleFor(aChild, aContainer);
   }
 
 #ifdef MOZ_XUL
   if (NotifyListBoxBody(presContext, aContainer, aChild, aOldNextSibling,
                         childFrame, CONTENT_REMOVED)) {
     if (aFlags == REMOVE_DESTROY_FRAMES) {
       CaptureStateForFramesOf(aChild, mTempFrameTreeState);
     }
@@ -8831,17 +8831,17 @@ nsCSSFrameConstructor::ContentRemoved(ns
       // simpler.
       RemoveLetterFrames(mPresShell, containingBlock);
 
       // Recover childFrame and parentFrame
       childFrame = aChild->GetPrimaryFrame();
       if (!childFrame || childFrame->GetContent() != aChild) {
         // XXXbz the GetContent() != aChild check is needed due to bug 135040.
         // Remove it once that's fixed.
-        ClearUndisplayedContentIn(aChild, aContainer);
+        UnregisterDisplayNoneStyleFor(aChild, aContainer);
         return;
       }
       parentFrame = childFrame->GetParent();
       parentType = parentFrame->Type();
 
 #ifdef NOISY_FIRST_LETTER
       printf("  ==> revised parentFrame=");
       nsFrame::ListTag(stdout, parentFrame);
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -238,18 +238,18 @@ nsFrameManager::ChangeStyleContextInMap(
       return;
     }
   }
 
   MOZ_CRASH("couldn't find the entry to change");
 }
 
 void
-nsFrameManager::ClearUndisplayedContentIn(nsIContent* aContent,
-                                          nsIContent* aParentContent)
+nsFrameManager::UnregisterDisplayNoneStyleFor(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 (!mDisplayNoneMap) {
     return;
@@ -300,18 +300,18 @@ nsFrameManager::ClearAllMapsFor(nsIConte
   // Need to look at aParentContent's content list due to XBL insertions.
   // Nodes in aParentContent's content list do not have aParentContent as a
   // parent, but are treated as children of aParentContent. We iterate over
   // the flattened content list and just ignore any nodes we don't care about.
   FlattenedChildIterator iter(aParentContent);
   for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
     auto parent = child->GetParent();
     if (parent != aParentContent) {
-      ClearUndisplayedContentIn(child, parent);
-      ClearDisplayContentsIn(child, parent);
+      UnregisterDisplayNoneStyleFor(child, parent);
+      UnregisterDisplayContentsStyleFor(child, parent);
     }
   }
 }
 
 //----------------------------------------------------------------------
 
 void
 nsFrameManager::RegisterDisplayContentsStyleFor(nsIContent* aContent,
@@ -325,18 +325,18 @@ nsFrameManager::RegisterDisplayContentsS
 
 UndisplayedNode*
 nsFrameManager::GetAllRegisteredDisplayContentsStylesIn(nsIContent* aParentContent)
 {
   return GetAllUndisplayedNodesInMapFor(mDisplayContentsMap, aParentContent);
 }
 
 void
-nsFrameManager::ClearDisplayContentsIn(nsIContent* aContent,
-                                       nsIContent* aParentContent)
+nsFrameManager::UnregisterDisplayContentsStyleFor(nsIContent* aContent,
+                                                  nsIContent* aParentContent)
 {
 #ifdef DEBUG_DISPLAY_CONTENTS_MAP
   static int i = 0;
   printf("ClearDisplayContents(%d): content=%p parent=%p --> ", i++, (void *)aContent, (void*)aParentContent);
 #endif
 
   if (!mDisplayContentsMap) {
     return;
--- a/layout/base/nsFrameManager.h
+++ b/layout/base/nsFrameManager.h
@@ -163,26 +163,26 @@ public:
     return GetUndisplayedNodeInMapFor(mDisplayContentsMap, aContent);
   }
 
   /**
    * Unregister the style context for the display:none content, aContent,
    * if any.  If found, then also unregisters the style contexts for any
    * display:contents and display:none descendants of aContent.
    */
-  void ClearUndisplayedContentIn(nsIContent* aContent,
-                                 nsIContent* aParentContent);
+  void UnregisterDisplayNoneStyleFor(nsIContent* aContent,
+                                     nsIContent* aParentContent);
 
   /**
    * Unregister the style context for the display:contents content, aContent,
    * if any.  If found, then also unregisters the style contexts for any
    * display:contents and display:none descendants of aContent.
    */
-  void ClearDisplayContentsIn(nsIContent* aContent,
-                              nsIContent* aParentContent);
+  void UnregisterDisplayContentsStyleFor(nsIContent* aContent,
+                                         nsIContent* aParentContent);
 
 
   // Functions for manipulating the frame model
   void AppendFrames(nsContainerFrame* aParentFrame,
                     ChildListID aListID,
                     nsFrameList& aFrameList);
 
   void InsertFrames(nsContainerFrame* aParentFrame,