Bug 1388939, part 5 - Rename nsFrameManager::GetUndisplayedContent to GetDisplayNoneStyleFor. r=dholbert
authorJonathan Watt <jwatt@jwatt.org>
Tue, 01 Aug 2017 15:27:59 +0100
changeset 373930 4d13c2c742628dbd497e6a5d6248882e7bae04e5
parent 373929 8a86aaef19f75c1d808be5ce0f20d2198e09055d
child 373931 6f02e4c2fc42fd97a4c31ab268424bd4aa6ed9b0
push id32311
push userkwierso@gmail.com
push dateFri, 11 Aug 2017 01:14:57 +0000
treeherdermozilla-central@253a8560dc34 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1388939
milestone57.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 1388939, part 5 - Rename nsFrameManager::GetUndisplayedContent to GetDisplayNoneStyleFor. r=dholbert MozReview-Commit-ID: Kpe6DcBP8yX
dom/xbl/nsXBLResourceLoader.cpp
dom/xbl/nsXBLService.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameManager.cpp
layout/base/nsFrameManager.h
--- a/dom/xbl/nsXBLResourceLoader.cpp
+++ b/dom/xbl/nsXBLResourceLoader.cpp
@@ -253,20 +253,19 @@ nsXBLResourceLoader::NotifyBoundElements
         // construction.)  So we have to check both whether the element
         // has a primary frame and whether it's in the undisplayed map
         // before sending a ContentInserted notification, or bad things
         // will happen.
         nsIPresShell *shell = doc->GetShell();
         if (shell) {
           nsIFrame* childFrame = content->GetPrimaryFrame();
           if (!childFrame) {
-            // Check to see if it's in the undisplayed content map, or the
-            // display: contents map.
+            // Check if it's in the display:none or display:contents maps.
             nsStyleContext* sc =
-              shell->FrameManager()->GetUndisplayedContent(content);
+              shell->FrameManager()->GetDisplayNoneStyleFor(content);
 
             if (!sc) {
               sc = shell->FrameManager()->GetDisplayContentsStyleFor(content);
             }
 
             if (!sc) {
               if (ServoStyleSet* servoSet = shell->StyleSet()->GetAsServo()) {
                 // Ensure the element has servo data so that
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -140,21 +140,20 @@ public:
     // construction.)  So we have to check both whether the element
     // has a primary frame and whether it's in the frame manager maps
     // before sending a ContentInserted notification, or bad things
     // will happen.
     MOZ_ASSERT(shell == doc->GetShell());
     if (shell) {
       nsIFrame* childFrame = mBoundElement->GetPrimaryFrame();
       if (!childFrame) {
-        // Check to see if it's in the undisplayed content map...
+        // Check if it's in the display:none or display:contents maps.
         nsFrameManager* fm = shell->FrameManager();
-        nsStyleContext* sc = fm->GetUndisplayedContent(mBoundElement);
+        nsStyleContext* sc = fm->GetDisplayNoneStyleFor(mBoundElement);
         if (!sc) {
-          // or in the display:contents map.
           sc = fm->GetDisplayContentsStyleFor(mBoundElement);
         }
         if (!sc) {
           shell->CreateFramesFor(destroyedFramesFor);
         }
       }
     }
   }
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -5827,17 +5827,17 @@ nsCSSFrameConstructor::SetAsUndisplayedC
     if (aIsGeneratedContent) {
       aContent->UnbindFromTree();
     }
     return;
   }
   NS_ASSERTION(!aIsGeneratedContent, "Should have had pseudo type");
 
   if (aState.mCreatingExtraFrames) {
-    MOZ_ASSERT(GetUndisplayedContent(aContent),
+    MOZ_ASSERT(GetDisplayNoneStyleFor(aContent),
                "should have called RegisterDisplayNoneStyleFor earlier");
     return;
   }
   aList.AppendUndisplayedItem(aContent, aStyleContext);
 }
 
 void
 nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState& aState,
@@ -7243,17 +7243,17 @@ nsCSSFrameConstructor::MaybeConstructLaz
 #endif
   while (content &&
          !content->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
 #ifdef DEBUG
     if (content->GetPrimaryFrame() && content->GetPrimaryFrame()->IsLeaf()) {
       noPrimaryFrame = needsFrameBitSet = false;
     }
     if (!noPrimaryFrame && !content->GetPrimaryFrame()) {
-      nsStyleContext* sc = GetUndisplayedContent(content);
+      nsStyleContext* sc = GetDisplayNoneStyleFor(content);
       noPrimaryFrame = !GetDisplayContentsStyleFor(content) &&
         (sc && !sc->IsInDisplayNoneSubtree());
     }
     if (!needsFrameBitSet && content->HasFlag(NODE_NEEDS_FRAME)) {
       needsFrameBitSet = true;
     }
 #endif
     content->SetFlags(NODE_DESCENDANTS_NEED_FRAMES);
@@ -7405,17 +7405,17 @@ nsCSSFrameConstructor::IssueSingleInsert
                                                     nsIContent* aStartChild,
                                                     nsIContent* aEndChild,
                                                     bool aAllowLazyConstruction,
                                                     bool aForReconstruction)
 {
   for (nsIContent* child = aStartChild;
        child != aEndChild;
        child = child->GetNextSibling()) {
-    if ((child->GetPrimaryFrame() || GetUndisplayedContent(child) ||
+    if ((child->GetPrimaryFrame() || GetDisplayNoneStyleFor(child) ||
          GetDisplayContentsStyleFor(child))
 #ifdef MOZ_XUL
         //  Except listboxes suck, so do NOT skip anything here if
         //  we plan to notify a listbox.
         && !MaybeGetListBoxBodyFrame(aContainer, child)
 #endif
         ) {
       // Already have a frame or undisplayed entry for this content; a
@@ -9637,17 +9637,17 @@ DefinitelyEqualURIsAndPrincipal(mozilla:
 {
   return aURI1 == aURI2 ||
          (aURI1 && aURI2 && aURI1->DefinitelyEqualURIsAndPrincipal(*aURI2));
 }
 
 nsStyleContext*
 nsCSSFrameConstructor::MaybeRecreateFramesForElement(Element* aElement)
 {
-  RefPtr<nsStyleContext> oldContext = GetUndisplayedContent(aElement);
+  RefPtr<nsStyleContext> oldContext = GetDisplayNoneStyleFor(aElement);
   StyleDisplay oldDisplay = StyleDisplay::None;
   if (!oldContext) {
     oldContext = GetDisplayContentsStyleFor(aElement);
     if (!oldContext) {
       return nullptr;
     }
     oldDisplay = StyleDisplay::Contents;
   }
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -259,17 +259,17 @@ nsFrameManager::ClearUndisplayedContentI
        node; node = node->getNext()) {
     if (node->mContent == aContent) {
       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),
+      MOZ_ASSERT(!GetDisplayNoneStyleFor(aContent),
                  "Found more undisplayed content data after removal");
       return;
     }
   }
 
 #ifdef DEBUG_UNDISPLAYED_MAP
   printf( "not found.\n");
 #endif
--- a/layout/base/nsFrameManager.h
+++ b/layout/base/nsFrameManager.h
@@ -113,17 +113,17 @@ public:
                                                nsStyleContext* aStyleContext)
   {
     ChangeStyleContextInMap(mDisplayContentsMap, aContent, aStyleContext);
   }
 
   /**
    * Get the style context for the display:none content, aContent, if any.
    */
-  nsStyleContext* GetUndisplayedContent(const nsIContent* aContent)
+  nsStyleContext* GetDisplayNoneStyleFor(const nsIContent* aContent)
   {
     if (!mDisplayNoneMap) {
       return nullptr;
     }
     return GetStyleContextInMap(mDisplayNoneMap, aContent);
   }
 
   /**