Bug 1388939, part 4 - Give clear names to the nsFrameManager methods for updating the registered undisplayed style contexts. r=dholbert draft
authorJonathan Watt <jwatt@jwatt.org>
Thu, 10 Aug 2017 01:45:40 +0100
changeset 643662 4f001c9d5e8e1555a51dcb14ccc12ef1798577a4
parent 643661 69c3bd8d39f91a30176a7873cfebe43947e85e77
child 643663 d9e43324d2b855c8f7232f95116104f996b56b3b
push id73172
push userjwatt@jwatt.org
push dateThu, 10 Aug 2017 00:52:54 +0000
reviewersdholbert
bugs1388939
milestone57.0a1
Bug 1388939, part 4 - Give clear names to the nsFrameManager methods for updating the registered undisplayed style contexts. r=dholbert MozReview-Commit-ID: Bgm32Lfr5v9
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameManager.h
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6076,17 +6076,18 @@ nsCSSFrameConstructor::AddFrameConstruct
 
   if (MOZ_UNLIKELY(bits & FCDATA_IS_CONTENTS)) {
     if (!GetDisplayContentsStyleFor(aContent)) {
       MOZ_ASSERT(styleContext->GetPseudo() || !isGeneratedContent,
                  "Should have had pseudo type");
       aState.mFrameManager->RegisterDisplayContentsStyleFor(aContent,
                                                             styleContext);
     } else {
-      aState.mFrameManager->ChangeDisplayContents(aContent, styleContext);
+      aState.mFrameManager->ChangeRegisteredDisplayContentsStyleFor(aContent,
+                                                                    styleContext);
     }
 
     TreeMatchContext::AutoAncestorPusher ancestorPusher(aState.mTreeMatchContext);
     if (aState.HasAncestorFilter()) {
       ancestorPusher.PushAncestorAndStyleScope(aContent->AsElement());
     } else {
       ancestorPusher.PushStyleScope(aContent->AsElement());
     }
@@ -9652,19 +9653,19 @@ nsCSSFrameConstructor::MaybeRecreateFram
   }
 
   // The parent has a frame, so try resolving a new context.
   RefPtr<nsStyleContext> newContext = mPresShell->StyleSet()->
     ResolveStyleFor(aElement, oldContext->AsGecko()->GetParent(),
                     LazyComputeBehavior::Assert);
 
   if (oldDisplay == StyleDisplay::None) {
-    ChangeUndisplayedContent(aElement, newContext);
+    ChangeRegisteredDisplayNoneStyleFor(aElement, newContext);
   } else {
-    ChangeDisplayContents(aElement, newContext);
+    ChangeRegisteredDisplayContentsStyleFor(aElement, newContext);
   }
 
   const nsStyleDisplay* disp = newContext->StyleDisplay();
   if (oldDisplay == disp->mDisplay) {
     // We can skip trying to recreate frames here, but only if our style
     // context does not have a binding URI that differs from our old one.
     // Otherwise, we should try to recreate, because we may want to apply the
     // new binding
--- a/layout/base/nsFrameManager.h
+++ b/layout/base/nsFrameManager.h
@@ -95,27 +95,27 @@ public:
    * Register the style context for the display:contents content, aContent.
    */
   void RegisterDisplayContentsStyleFor(nsIContent* aContent,
                                        nsStyleContext* aStyleContext);
 
   /**
    * Change the style context for the display:none content, aContent.
    */
-  void ChangeUndisplayedContent(nsIContent* aContent,
-                                nsStyleContext* aStyleContext)
+  void ChangeRegisteredDisplayNoneStyleFor(nsIContent* aContent,
+                                           nsStyleContext* aStyleContext)
   {
     ChangeStyleContextInMap(mDisplayNoneMap, aContent, aStyleContext);
   }
 
   /**
    * Change the style context for the display:contents content, aContent.
    */
-  void ChangeDisplayContents(nsIContent* aContent,
-                             nsStyleContext* aStyleContext)
+  void ChangeRegisteredDisplayContentsStyleFor(nsIContent* aContent,
+                                               nsStyleContext* aStyleContext)
   {
     ChangeStyleContextInMap(mDisplayContentsMap, aContent, aStyleContext);
   }
 
   /**
    * Get the style context for the display:none content, aContent.
    */
   nsStyleContext* GetUndisplayedContent(const nsIContent* aContent)