Bug 508473 Part I: Remove nsIFrame::RemovedAsPrimary r=bz sr=roc
authorfantasai <fantasai.cvs@inkedblade.net>
Thu, 24 Dec 2009 00:20:20 -0500
changeset 36645 5c0c836b0d06157dc1c9410aa534dcb5c675bbec
parent 36644 7a68e56bb96a082845105d9a8c3f721b185bbaf5
child 36646 912c5206ca3e735bb39494edcc0e489d5baea510
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbz, roc
bugs508473
milestone1.9.3a1pre
Bug 508473 Part I: Remove nsIFrame::RemovedAsPrimary r=bz sr=roc
layout/base/nsFrameManager.cpp
layout/base/nsFrameManager.h
layout/forms/nsTextControlFrame.cpp
layout/forms/nsTextControlFrame.h
layout/generic/nsIFrame.h
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -466,18 +466,16 @@ nsFrameManager::RemoveAsPrimaryFrame(nsI
     PrimaryFrameMapEntry *entry = static_cast<PrimaryFrameMapEntry*>
                                              (PL_DHashTableOperate(&mPrimaryFrameMap, aContent, PL_DHASH_LOOKUP));
     if (PL_DHASH_ENTRY_IS_BUSY(entry) && entry->frame == aPrimaryFrame) {
       // Don't use PL_DHashTableRawRemove, since we want the table to
       // shrink as needed.
       PL_DHashTableOperate(&mPrimaryFrameMap, aContent, PL_DHASH_REMOVE);
     }
   }
-
-  aPrimaryFrame->RemovedAsPrimaryFrame();
 }
 
 void
 nsFrameManager::ClearPrimaryFrameMap()
 {
   if (mPrimaryFrameMap.ops) {
     PL_DHashTableFinish(&mPrimaryFrameMap);
     mPrimaryFrameMap.ops = nsnull;
--- a/layout/base/nsFrameManager.h
+++ b/layout/base/nsFrameManager.h
@@ -115,18 +115,17 @@ public:
   NS_HIDDEN_(nsIFrame*) GetPrimaryFrameFor(nsIContent* aContent,
                                            PRInt32 aIndexHint);
   // aPrimaryFrame must not be null.  If you're trying to remove a primary frame
   // mapping, use RemoveAsPrimaryFrame.
   NS_HIDDEN_(nsresult)  SetPrimaryFrameFor(nsIContent* aContent,
                                            nsIFrame* aPrimaryFrame);
   // If aPrimaryFrame is the current primary frame for aContent, remove the
   // relevant hashtable entry.  If the current primary frame for aContent is
-  // null, this does nothing.  aPrimaryFrame must not be null, and this method
-  // handles calling RemovedAsPrimaryFrame on aPrimaryFrame.
+  // null, this does nothing.  aPrimaryFrame must not be null.
   NS_HIDDEN_(void)      RemoveAsPrimaryFrame(nsIContent* aContent,
                                              nsIFrame* aPrimaryFrame);
   NS_HIDDEN_(void)      ClearPrimaryFrameMap();
 
   // Placeholder frame functions
   NS_HIDDEN_(nsPlaceholderFrame*) GetPlaceholderFrameFor(nsIFrame* aFrame);
   NS_HIDDEN_(nsresult)
     RegisterPlaceholderFrame(nsPlaceholderFrame* aPlaceholderFrame);
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -1114,25 +1114,16 @@ nsTextControlFrame::Destroy()
   }
   if (mFrameSel) {
     mFrameSel->SetScrollableViewProvider(nsnull);
   }
   nsContentUtils::DestroyAnonymousContent(&mAnonymousDiv);
   nsBoxFrame::Destroy();
 }
 
-void 
-nsTextControlFrame::RemovedAsPrimaryFrame()
-{
-  if (!mDidPreDestroy) {
-    PreDestroy();
-  }
-  else NS_ASSERTION(PR_FALSE, "RemovedAsPrimaryFrame called after PreDestroy");
-}
-
 nsIAtom*
 nsTextControlFrame::GetType() const 
 { 
   return nsGkAtoms::textInputFrame;
 } 
 
 // XXX: wouldn't it be nice to get this from the style context!
 PRBool nsTextControlFrame::IsSingleLineTextControl() const
--- a/layout/forms/nsTextControlFrame.h
+++ b/layout/forms/nsTextControlFrame.h
@@ -69,18 +69,16 @@ class nsTextControlFrame : public nsStac
 
 {
 public:
   NS_DECL_FRAMEARENA_HELPERS
 
   nsTextControlFrame(nsIPresShell* aShell, nsStyleContext* aContext);
   virtual ~nsTextControlFrame();
 
-  virtual void RemovedAsPrimaryFrame(); 
-
   virtual void Destroy();
 
   virtual nscoord GetMinWidth(nsIRenderingContext* aRenderingContext);
   virtual nsSize ComputeAutoSize(nsIRenderingContext *aRenderingContext,
                                  nsSize aCBSize, nscoord aAvailableWidth,
                                  nsSize aMargin, nsSize aBorder,
                                  nsSize aPadding, PRBool aShrinkWrap);
 
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -520,21 +520,16 @@ public:
                    nsIFrame*        aPrevInFlow) = 0;
 
   /**
    * Destroys this frame and each of its child frames (recursively calls
    * Destroy() for each child)
    */
   virtual void Destroy() = 0;
 
-  /*
-   * Notify the frame that it has been removed as the primary frame for its content
-   */
-  virtual void RemovedAsPrimaryFrame() {}
-
   /**
    * Called to set the initial list of frames. This happens after the frame
    * has been initialized.
    *
    * This is only called once for a given child list, and won't be called
    * at all for child lists with no initial list of frames.
    *
    * @param   aListName the name of the child list. A NULL pointer for the atom