Bug 556446: Remove dead code in layout. r=roc,bz
authorEhren Metcalfe <ehren.m@gmail.com>
Sat, 03 Apr 2010 07:36:19 -0400
changeset 40202 13504a5fc0742c0922b548dce200febd06e358fa
parent 40201 8c573f37efba70863bd4424443e3957182287cb9
child 40203 16d33b6f570eb16bbf62c6d4c155e1f81e0a5fd6
push idunknown
push userunknown
push dateunknown
reviewersroc, bz
bugs556446
milestone1.9.3a4pre
Bug 556446: Remove dead code in layout. r=roc,bz
layout/base/nsBidi.cpp
layout/base/nsBidi.h
layout/base/nsBidiPresUtils.cpp
layout/base/nsBidiPresUtils.h
layout/base/nsDisplayList.cpp
layout/base/nsDisplayList.h
layout/base/nsFrameManager.cpp
layout/base/nsFrameManager.h
layout/base/nsIPresShell.h
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/base/nsPresShell.cpp
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsButtonFrameRenderer.h
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsComboboxControlFrame.h
layout/forms/nsISelectControlFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsListControlFrame.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
layout/generic/nsFrame.cpp
layout/generic/nsFrameList.cpp
layout/generic/nsFrameList.h
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsFrameSetFrame.h
layout/generic/nsIFrame.h
layout/generic/nsILineIterator.h
layout/generic/nsImageMap.cpp
layout/generic/nsIntervalSet.cpp
layout/generic/nsIntervalSet.h
layout/generic/nsLineBox.cpp
layout/generic/nsLineBox.h
layout/mathml/nsIMathMLFrame.h
layout/mathml/nsMathMLFrame.h
layout/style/nsCSSDeclaration.cpp
layout/style/nsCSSDeclaration.h
layout/style/nsCSSLoader.cpp
layout/style/nsCSSLoader.h
layout/style/nsCSSPseudoClasses.cpp
layout/style/nsCSSPseudoClasses.h
layout/style/nsCSSStruct.cpp
layout/style/nsCSSStruct.h
layout/style/nsCSSValue.cpp
layout/style/nsCSSValue.h
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsHTMLStyleSheet.h
layout/tables/nsCellMap.cpp
layout/tables/nsCellMap.h
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableOuterFrame.cpp
layout/tables/nsTableOuterFrame.h
layout/tables/nsTableRowGroupFrame.cpp
layout/tables/nsTableRowGroupFrame.h
layout/xul/base/src/grid/nsGrid.cpp
layout/xul/base/src/grid/nsGrid.h
layout/xul/base/src/grid/nsGridRow.cpp
layout/xul/base/src/grid/nsGridRow.h
layout/xul/base/src/nsBox.cpp
layout/xul/base/src/nsBox.h
layout/xul/base/src/nsBoxFrame.cpp
layout/xul/base/src/nsBoxFrame.h
layout/xul/base/src/nsBoxLayout.cpp
layout/xul/base/src/nsBoxLayout.h
layout/xul/base/src/nsListBoxBodyFrame.h
layout/xul/base/src/nsMenuFrame.h
--- a/layout/base/nsBidi.cpp
+++ b/layout/base/nsBidi.cpp
@@ -165,50 +165,16 @@ static Flags flagO[2]={ DIRPROP_FLAG(LRO
 nsBidi::nsBidi()
 {
   Init();
 
   mMayAllocateText=PR_TRUE;
   mMayAllocateRuns=PR_TRUE;
 }
 
-nsBidi::nsBidi(PRUint32 aMaxLength, PRUint32 aMaxRunCount)
-{
-  Init();
-  nsresult rv = NS_OK;
-
-  /* allocate memory for arrays as requested */
-  if(aMaxLength>0) {
-    if( !GETINITIALDIRPROPSMEMORY(aMaxLength) ||
-        !GETINITIALLEVELSMEMORY(aMaxLength)
-      ) {
-      mMayAllocateText=PR_FALSE;
-      rv = NS_ERROR_OUT_OF_MEMORY;
-    }
-  } else {
-    mMayAllocateText=PR_TRUE;
-  }
-
-  if(aMaxRunCount>0) {
-    if(aMaxRunCount==1) {
-      /* use simpleRuns[] */
-      mRunsSize=sizeof(Run);
-    } else if(!GETINITIALRUNSMEMORY(aMaxRunCount)) {
-      mMayAllocateRuns=PR_FALSE;
-      rv = NS_ERROR_OUT_OF_MEMORY;
-    }
-  } else {
-    mMayAllocateRuns=PR_TRUE;
-  }
-
-  if(NS_FAILED(rv)) {
-    Free();
-  }
-}
-
 nsBidi::~nsBidi()
 {
   Free();
 }
 
 void nsBidi::Init()
 {
   /* reset the object, all pointers NULL, all flags PR_FALSE, all sizes 0 */
--- a/layout/base/nsBidi.h
+++ b/layout/base/nsBidi.h
@@ -438,51 +438,16 @@ public:
    * <code>GetLine()</code>.<p>
    * This object can be reused for as long as it is not destroyed.<p>
    * <code>SetPara()</code> will allocate additional memory for
    * internal structures as necessary.
    *
    */
   nsBidi();
 
-  /** @brief Preallocating constructor
-   * Allocate an <code>nsBidi</code>
-   * object with preallocated memory for internal structures.   This
-   * constructor provides an <code>nsBidi</code> object like
-   * the default constructor, but it also
-   * preallocates memory for internal structures according to the sizings
-   * supplied by the caller.<p> Subsequent functions will not allocate
-   * any more memory, and are thus guaranteed not to fail because of lack
-   * of memory.<p> The preallocation can be limited to some of the
-   * internal memory by setting some values to 0 here. That means that
-   * if, e.g., <code>aMaxRunCount</code> cannot be reasonably
-   * predetermined and should not be set to <code>aMaxLength</code> (the
-   * only failproof value) to avoid wasting memory, then
-   * <code>aMaxRunCount</code> could be set to 0 here and the internal
-   * structures that are associated with it will be allocated on demand,
-   * just like with the default constructor.
-   *
-   * If sufficient memory could not be allocated, no exception is thrown.
-   * Test whether mDirPropsSize == aMaxLength and/or mRunsSize == aMaxRunCount.
-   *
-   * @param aMaxLength is the maximum paragraph or line length that internal memory
-   *      will be preallocated for. An attempt to associate this object with a
-   *      longer text will fail, unless this value is 0, which leaves the allocation
-   *      up to the implementation.
-   *
-   * @param aMaxRunCount is the maximum anticipated number of same-level runs
-   *      that internal memory will be preallocated for. An attempt to access
-   *      visual runs on an object that was not preallocated for as many runs
-   *      as the text was actually resolved to will fail,
-   *      unless this value is 0, which leaves the allocation up to the implementation.<p>
-   *      The number of runs depends on the actual text and maybe anywhere between
-   *      1 and <code>aMaxLength</code>. It is typically small.<p>
-   */
-  nsBidi(PRUint32 aMaxLength, PRUint32 aMaxRunCount);
-
   /** @brief Destructor. */
   virtual ~nsBidi();
 
 
   /**
    * Perform the Unicode Bidi algorithm. It is defined in the
    * <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Technical Report 9</a>,
    * version 5,
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -1392,26 +1392,16 @@ nsBidiPresUtils::CalculateCharType(PRInt
 
       strongTypeFound = PR_TRUE;
       aCharType = charType;
     }
   }
   aOffset = offset;
 }
 
-nsresult nsBidiPresUtils::GetBidiEngine(nsBidi** aBidiEngine)
-{
-  nsresult rv = NS_ERROR_FAILURE;
-  if (mBidiEngine) {
-    *aBidiEngine = mBidiEngine;
-    rv = NS_OK;
-  }
-  return rv; 
-}
-
 nsresult nsBidiPresUtils::ProcessText(const PRUnichar*       aText,
                                       PRInt32                aLength,
                                       nsBidiDirection        aBaseDirection,
                                       nsPresContext*         aPresContext,
                                       BidiProcessor&         aprocessor,
                                       Mode                   aMode,
                                       nsBidiPositionResolve* aPosResolve,
                                       PRInt32                aPosResolveCount,
--- a/layout/base/nsBidiPresUtils.h
+++ b/layout/base/nsBidiPresUtils.h
@@ -194,21 +194,16 @@ public:
    */
   nsresult FormatUnicodeText(nsPresContext* aPresContext,
                              PRUnichar*      aText,
                              PRInt32&        aTextLength,
                              nsCharType      aCharType,
                              PRBool          aIsOddLevel);
 
   /**
-   * Return our nsBidi object (bidi reordering engine)
-   */
-  nsresult GetBidiEngine(nsBidi** aBidiEngine);
-
-  /**
    * Reorder plain text using the Unicode Bidi algorithm and send it to
    * a rendering context for rendering.
    *
    * @param[in] aText  the string to be rendered (in logical order)
    * @param aLength the number of characters in the string
    * @param aBaseDirection the base direction of the string
    *  NSBIDI_LTR - left-to-right string
    *  NSBIDI_RTL - right-to-left string
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -873,23 +873,16 @@ nsDisplayItem* nsDisplayList::RemoveBott
   if (item == mTop) {
     // must have been the only item
     mTop = &mSentinel;
   }
   item->mAbove = nsnull;
   return item;
 }
 
-void nsDisplayList::DeleteBottom() {
-  nsDisplayItem* item = RemoveBottom();
-  if (item) {
-    item->~nsDisplayItem();
-  }
-}
-
 void nsDisplayList::DeleteAll() {
   nsDisplayItem* item;
   while ((item = RemoveBottom()) != nsnull) {
     item->~nsDisplayItem();
   }
 }
 
 nsIFrame* nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, nsPoint aPt,
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -763,20 +763,16 @@ public:
   }
   
   /**
    * Remove an item from the bottom of the list and return it.
    */
   nsDisplayItem* RemoveBottom();
   
   /**
-   * Remove an item from the bottom of the list and call its destructor.
-   */
-  void DeleteBottom();
-  /**
    * Remove all items from the list and call their destructors.
    */
   void DeleteAll();
   
   /**
    * @return the item at the top of the list, or null if the list is empty
    */
   nsDisplayItem* GetTop() const {
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -256,41 +256,16 @@ nsFrameManager::Destroy()
   }
   
   delete mUndisplayedMap;
   mUndisplayedMap = nsnull;
 
   mPresShell = nsnull;
 }
 
-nsIFrame*
-nsFrameManager::GetCanvasFrame()
-{
-  if (mRootFrame) {
-    // walk the children of the root frame looking for a frame with type==canvas
-    // start at the root
-    nsIFrame* childFrame = mRootFrame;
-    while (childFrame) {
-      // get each sibling of the child and check them, startig at the child
-      nsIFrame *siblingFrame = childFrame;
-      while (siblingFrame) {
-        if (siblingFrame->GetType() == nsGkAtoms::canvasFrame) {
-          // this is it
-          return siblingFrame;
-        } else {
-          siblingFrame = siblingFrame->GetNextSibling();
-        }
-      }
-      // move on to the child's child
-      childFrame = childFrame->GetFirstChild(nsnull);
-    }
-  }
-  return nsnull;
-}
-
 //----------------------------------------------------------------------
 
 // Placeholder frame functions
 nsPlaceholderFrame*
 nsFrameManager::GetPlaceholderFrameFor(nsIFrame*  aFrame)
 {
   NS_PRECONDITION(aFrame, "null param unexpected");
 
@@ -487,29 +462,16 @@ nsFrameManager::ClearAllUndisplayedConte
       nsIContent* child = list->GetNodeAt(i);
       if (child->GetParent() != aParentContent) {
         ClearUndisplayedContentIn(child, child->GetParent());
       }
     }
   }
 }
 
-void
-nsFrameManager::ClearUndisplayedContentMap()
-{
-#ifdef DEBUG_UNDISPLAYED_MAP
-  static int i = 0;
-  printf("ClearUndisplayedContentMap(%d)\n", i++);
-#endif
-
-  if (mUndisplayedMap) {
-    mUndisplayedMap->Clear();
-  }
-}
-
 //----------------------------------------------------------------------
 
 nsresult
 nsFrameManager::InsertFrames(nsIFrame*       aParentFrame,
                              nsIAtom*        aListName,
                              nsIFrame*       aPrevFrame,
                              nsFrameList&    aFrameList)
 {
--- a/layout/base/nsFrameManager.h
+++ b/layout/base/nsFrameManager.h
@@ -86,22 +86,16 @@ public:
 
   /*
    * After Destroy is called, it is an error to call any FrameManager methods.
    * Destroy should be called when the frame tree managed by the frame
    * manager is no longer being displayed.
    */
   NS_HIDDEN_(void) Destroy();
 
-  /*
-   * Get the canvas frame, searching from the root frame down.
-   * The canvas frame may or may not exist, so this may return null.
-   */
-  NS_HIDDEN_(nsIFrame*) GetCanvasFrame();
-
   // Placeholder frame functions
   NS_HIDDEN_(nsPlaceholderFrame*) GetPlaceholderFrameFor(nsIFrame* aFrame);
   NS_HIDDEN_(nsresult)
     RegisterPlaceholderFrame(nsPlaceholderFrame* aPlaceholderFrame);
 
   NS_HIDDEN_(void)
     UnregisterPlaceholderFrame(nsPlaceholderFrame* aPlaceholderFrame);
 
@@ -111,17 +105,16 @@ public:
   NS_HIDDEN_(nsStyleContext*) GetUndisplayedContent(nsIContent* aContent);
   NS_HIDDEN_(void) SetUndisplayedContent(nsIContent* aContent,
                                          nsStyleContext* aStyleContext);
   NS_HIDDEN_(void) ChangeUndisplayedContent(nsIContent* aContent,
                                             nsStyleContext* aStyleContext);
   NS_HIDDEN_(void) ClearUndisplayedContentIn(nsIContent* aContent,
                                              nsIContent* aParentContent);
   NS_HIDDEN_(void) ClearAllUndisplayedContentIn(nsIContent* aParentContent);
-  NS_HIDDEN_(void) ClearUndisplayedContentMap();
 
   // Functions for manipulating the frame model
   NS_HIDDEN_(nsresult) AppendFrames(nsIFrame*       aParentFrame,
                                     nsIAtom*        aListName,
                                     nsFrameList&    aFrameList)
   {
     return aParentFrame->AppendFrames(aListName, aFrameList);
   }
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -736,21 +736,16 @@ public:
    */
   static PRBool GetVerifyReflowEnable();
 
   /**
    * Set the verify-reflow enable flag.
    */
   static void SetVerifyReflowEnable(PRBool aEnabled);
 
-  /**
-   * Get the flags associated with the VerifyReflow debug tool
-   */
-  static PRInt32 GetVerifyReflowFlags();
-
   virtual nsIFrame* GetAbsoluteContainingBlock(nsIFrame* aFrame);
 
 #ifdef MOZ_REFLOW_PERF
   virtual NS_HIDDEN_(void) DumpReflows() = 0;
   virtual NS_HIDDEN_(void) CountReflows(const char * aName, nsIFrame * aFrame) = 0;
   virtual NS_HIDDEN_(void) PaintCount(const char * aName,
                                       nsIRenderingContext* aRenderingContext,
                                       nsPresContext * aPresContext,
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1755,73 +1755,16 @@ nsLayoutUtils::GetParentOrPlaceholderFor
   if ((aFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)
       && !aFrame->GetPrevInFlow()) {
     return aFrameManager->GetPlaceholderFrameFor(aFrame);
   }
   return aFrame->GetParent();
 }
 
 nsIFrame*
-nsLayoutUtils::GetClosestCommonAncestorViaPlaceholders(nsIFrame* aFrame1,
-                                                       nsIFrame* aFrame2,
-                                                       nsIFrame* aKnownCommonAncestorHint)
-{
-  NS_PRECONDITION(aFrame1, "aFrame1 must not be null");
-  NS_PRECONDITION(aFrame2, "aFrame2 must not be null");
-
-  nsPresContext* presContext = aFrame1->PresContext();
-  if (presContext != aFrame2->PresContext()) {
-    // different documents, no common ancestor
-    return nsnull;
-  }
-  nsFrameManager* frameManager = presContext->PresShell()->FrameManager();
-
-  nsAutoTArray<nsIFrame*, 8> frame1Ancestors;
-  nsIFrame* f1;
-  for (f1 = aFrame1; f1 && f1 != aKnownCommonAncestorHint;
-       f1 = GetParentOrPlaceholderFor(frameManager, f1)) {
-    frame1Ancestors.AppendElement(f1);
-  }
-  if (!f1 && aKnownCommonAncestorHint) {
-    // So, it turns out aKnownCommonAncestorHint was not an ancestor of f1. Oops.
-    // Never mind. We can continue as if aKnownCommonAncestorHint was null.
-    aKnownCommonAncestorHint = nsnull;
-  }
-
-  nsAutoTArray<nsIFrame*, 8> frame2Ancestors;
-  nsIFrame* f2;
-  for (f2 = aFrame2; f2 && f2 != aKnownCommonAncestorHint;
-       f2 = GetParentOrPlaceholderFor(frameManager, f2)) {
-    frame2Ancestors.AppendElement(f2);
-  }
-  if (!f2 && aKnownCommonAncestorHint) {
-    // So, it turns out aKnownCommonAncestorHint was not an ancestor of f2.
-    // We need to retry with no common ancestor hint.
-    return GetClosestCommonAncestorViaPlaceholders(aFrame1, aFrame2, nsnull);
-  }
-
-  // now frame1Ancestors and frame2Ancestors give us the parent frame chain
-  // up to aKnownCommonAncestorHint, or if that is null, up to and including
-  // the root frame. We need to walk from the end (i.e., the top of the
-  // frame (sub)tree) down to aFrame1/aFrame2 looking for the first difference.
-  nsIFrame* lastCommonFrame = aKnownCommonAncestorHint;
-  PRInt32 last1 = frame1Ancestors.Length() - 1;
-  PRInt32 last2 = frame2Ancestors.Length() - 1;
-  while (last1 >= 0 && last2 >= 0) {
-    nsIFrame* frame1 = frame1Ancestors.ElementAt(last1);
-    if (frame1 != frame2Ancestors.ElementAt(last2))
-      break;
-    lastCommonFrame = frame1;
-    last1--;
-    last2--;
-  }
-  return lastCommonFrame;
-}
-
-nsIFrame*
 nsLayoutUtils::GetNextContinuationOrSpecialSibling(nsIFrame *aFrame)
 {
   nsIFrame *result = aFrame->GetNextContinuation();
   if (result)
     return result;
 
   if ((aFrame->GetStateBits() & NS_FRAME_IS_SPECIAL) != 0) {
     // We only store the "special sibling" annotation with the first
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -725,30 +725,16 @@ public:
   /**
    * If aFrame is an out of flow frame, return its placeholder, otherwise
    * return its parent.
    */
   static nsIFrame* GetParentOrPlaceholderFor(nsFrameManager* aFrameManager,
                                              nsIFrame* aFrame);
 
   /**
-   * Find the closest common ancestor of aFrame1 and aFrame2, following
-   * out of flow frames to their placeholders instead of their parents. Returns
-   * nsnull if the frames are in different frame trees.
-   * 
-   * @param aKnownCommonAncestorHint a frame that is believed to be on the
-   * ancestor chain of both aFrame1 and aFrame2. If null, or a frame that is
-   * not in fact on both ancestor chains, then this function will still return
-   * the correct result, but it will be slower.
-   */
-  static nsIFrame*
-  GetClosestCommonAncestorViaPlaceholders(nsIFrame* aFrame1, nsIFrame* aFrame2,
-                                          nsIFrame* aKnownCommonAncestorHint);
-
-  /**
    * Get a frame's next-in-flow, or, if it doesn't have one, its special sibling.
    */
   static nsIFrame*
   GetNextContinuationOrSpecialSibling(nsIFrame *aFrame);
 
   /**
    * Get the first frame in the continuation-plus-special-sibling chain
    * containing aFrame.
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -1087,21 +1087,16 @@ protected:
   PRIntn mContentScrollVPosition;
   PRIntn mContentScrollHPosition;
 
   class nsDelayedEvent
   {
   public:
     virtual ~nsDelayedEvent() {};
     virtual void Dispatch(PresShell* aShell) {}
-    // This is needed only by nsDelayedFocusBlur.
-    virtual PRBool Equals(nsPIDOMEventTarget* aTarget, PRUint32 aEventType)
-    {
-      return PR_FALSE;
-    }
   };
 
   class nsDelayedInputEvent : public nsDelayedEvent
   {
   public:
     virtual void Dispatch(PresShell* aShell)
     {
       if (mEvent && mEvent->widget) {
@@ -1426,26 +1421,16 @@ nsIPresShell::GetVerifyReflowEnable()
 }
 
 void
 nsIPresShell::SetVerifyReflowEnable(PRBool aEnabled)
 {
   gVerifyReflowEnabled = aEnabled;
 }
 
-PRInt32
-nsIPresShell::GetVerifyReflowFlags()
-{
-#ifdef NS_DEBUG
-  return gVerifyReflowFlags;
-#else
-  return 0;
-#endif
-}
-
 /* virtual */ void
 nsIPresShell::AddWeakFrameExternal(nsWeakFrame* aWeakFrame)
 {
   AddWeakFrameInternal(aWeakFrame);
 }
 
 void
 nsIPresShell::AddWeakFrameInternal(nsWeakFrame* aWeakFrame)
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -344,30 +344,16 @@ nsButtonFrameRenderer::GetButtonInnerFoc
       NS_NOTYETIMPLEMENTED("percentage padding");
     }
     result += mInnerFocusStyle->GetStyleBorder()->GetActualBorder();
   }
 
   return result;
 }
 
-nsMargin
-nsButtonFrameRenderer::GetButtonOutlineBorderAndPadding()
-{
-  nsMargin borderAndPadding(0,0,0,0);
-  return borderAndPadding;
-}
-
-// gets the full size of our border with all the focus borders
-nsMargin
-nsButtonFrameRenderer::GetFullButtonBorderAndPadding()
-{
-  return GetAddedButtonBorderAndPadding() + GetButtonBorderAndPadding();
-}
-
 // gets all the focus borders and padding that will be added to the regular border
 nsMargin
 nsButtonFrameRenderer::GetAddedButtonBorderAndPadding()
 {
   return GetButtonOuterFocusBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
 }
 
 /**
--- a/layout/forms/nsButtonFrameRenderer.h
+++ b/layout/forms/nsButtonFrameRenderer.h
@@ -87,18 +87,16 @@ public:
 
   void GetButtonOuterFocusRect(const nsRect& aRect, nsRect& aResult);
   void GetButtonRect(const nsRect& aRect, nsRect& aResult);
   void GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aResult);
   nsMargin GetButtonOuterFocusBorderAndPadding();
   nsMargin GetButtonBorderAndPadding();
   nsMargin GetButtonInnerFocusMargin();
   nsMargin GetButtonInnerFocusBorderAndPadding();
-  nsMargin GetButtonOutlineBorderAndPadding();
-  nsMargin GetFullButtonBorderAndPadding();
   nsMargin GetAddedButtonBorderAndPadding();
 
   nsStyleContext* GetStyleContext(PRInt32 aIndex) const;
   void SetStyleContext(PRInt32 aIndex, nsStyleContext* aStyleContext);
   void ReResolveStyles(nsPresContext* aPresContext);
 
   nsIFrame* GetFrame();
 
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -895,27 +895,16 @@ nsComboboxControlFrame::RemoveOption(PRI
   if (!weakThis.IsAlive())
     return NS_OK;
 
   nsListControlFrame* lcf = static_cast<nsListControlFrame*>(mDropdownFrame);
   return lcf->RemoveOption(aIndex);
 }
 
 NS_IMETHODIMP
-nsComboboxControlFrame::GetOptionSelected(PRInt32 aIndex, PRBool* aValue)
-{
-  NS_ASSERTION(mDropdownFrame, "No dropdown frame!");
-
-  nsISelectControlFrame* listFrame = do_QueryFrame(mDropdownFrame);
-  NS_ASSERTION(listFrame, "No list frame!");
-
-  return listFrame->GetOptionSelected(aIndex, aValue);
-}
-
-NS_IMETHODIMP
 nsComboboxControlFrame::OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex)
 {
   nsAutoScriptBlocker scriptBlocker;
   RedisplayText(aNewIndex);
   NS_ASSERTION(mDropdownFrame, "No dropdown frame!");
   
   nsISelectControlFrame* listFrame = do_QueryFrame(mDropdownFrame);
   NS_ASSERTION(listFrame, "No list frame!");
--- a/layout/forms/nsComboboxControlFrame.h
+++ b/layout/forms/nsComboboxControlFrame.h
@@ -183,17 +183,16 @@ public:
    */
   NS_IMETHOD RedisplaySelectedText();
   virtual PRInt32 UpdateRecentIndex(PRInt32 aIndex);
   virtual void OnContentReset();
 
   // nsISelectControlFrame
   NS_IMETHOD AddOption(PRInt32 index);
   NS_IMETHOD RemoveOption(PRInt32 index);
-  NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
   NS_IMETHOD DoneAddingChildren(PRBool aIsDone);
   NS_IMETHOD OnOptionSelected(PRInt32 aIndex, PRBool aSelected);
   NS_IMETHOD OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex);
 
   //nsIRollupListener
   /**
    * Hide the dropdown menu and stop capturing mouse events.
    * @note This method might destroy |this|.
--- a/layout/forms/nsISelectControlFrame.h
+++ b/layout/forms/nsISelectControlFrame.h
@@ -59,21 +59,16 @@ public:
 
   /**
    * Removes the option at index.  The caller must have a live script
    * blocker while calling this method.
    */
   NS_IMETHOD RemoveOption(PRInt32 index) = 0; 
 
   /**
-   * Sets the select state of the option at index
-   */
-  NS_IMETHOD GetOptionSelected(PRInt32 index, PRBool* value) = 0;
-
-  /**
    * Sets whether the parser is done adding children
    * @param aIsDone whether the parser is done adding children
    */
   NS_IMETHOD DoneAddingChildren(PRBool aIsDone) = 0;
 
   /**
    * Notify the frame when an option is selected
    */
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1640,24 +1640,16 @@ nsListControlFrame::FireOnChange()
   nsEvent event(PR_TRUE, NS_FORM_CHANGE);
 
   nsCOMPtr<nsIPresShell> presShell = PresContext()->GetPresShell();
   if (presShell) {
     presShell->HandleEventWithTarget(&event, this, nsnull, &status);
   }
 }
 
-// Determine if the specified item in the listbox is selected.
-NS_IMETHODIMP
-nsListControlFrame::GetOptionSelected(PRInt32 aIndex, PRBool* aValue)
-{
-  *aValue = IsContentSelectedByIndex(aIndex);
-  return NS_OK;
-}
-
 NS_IMETHODIMP
 nsListControlFrame::OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex)
 {
   if (mComboboxFrame) {
     // UpdateRecentIndex with NS_SKIP_NOTIFY_INDEX, so that we won't fire an onchange
     // event for this setting of selectedIndex.
     mComboboxFrame->UpdateRecentIndex(NS_SKIP_NOTIFY_INDEX);
   }
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -183,17 +183,16 @@ public:
    * @note This method might destroy |this|.
    */
   virtual void ComboboxFinish(PRInt32 aIndex);
   virtual void OnContentReset();
 
   // nsISelectControlFrame
   NS_IMETHOD AddOption(PRInt32 index);
   NS_IMETHOD RemoveOption(PRInt32 index);
-  NS_IMETHOD GetOptionSelected(PRInt32 aIndex, PRBool* aValue);
   NS_IMETHOD DoneAddingChildren(PRBool aIsDone);
 
   /**
    * Gets the content (an option) by index and then set it as
    * being selected or not selected.
    */
   NS_IMETHOD OnOptionSelected(PRInt32 aIndex, PRBool aSelected);
   NS_IMETHOD OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex);
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -2843,37 +2843,16 @@ nsBlockFrame::ShouldApplyTopMargin(nsBlo
   }
 
   // The line being reflowed is "essentially" the first line in the
   // block. Therefore its top-margin will be collapsed by the
   // generational collapsing logic with its parent (us).
   return PR_FALSE;
 }
 
-nsIFrame*
-nsBlockFrame::GetTopBlockChild(nsPresContext* aPresContext)
-{
-  if (mLines.empty())
-    return nsnull;
-
-  nsLineBox *firstLine = mLines.front();
-  if (firstLine->IsBlock())
-    return firstLine->mFirstChild;
-
-  if (!firstLine->CachedIsEmpty())
-    return nsnull;
-
-  line_iterator secondLine = begin_lines();
-  ++secondLine;
-  if (secondLine == end_lines() || !secondLine->IsBlock())
-    return nsnull;
-
-  return secondLine->mFirstChild;
-}
-
 nsresult
 nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
                                line_iterator aLine,
                                PRBool* aKeepReflowGoing)
 {
   NS_PRECONDITION(*aKeepReflowGoing, "bad caller");
 
   nsresult rv = NS_OK;
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -266,22 +266,16 @@ public:
 
   /**
    * Determines whether the collapsed margin carried out of the last
    * line includes the margin-top of a line with clearance (in which
    * case we must avoid collapsing that margin with our bottom margin)
    */
   PRBool CheckForCollapsedBottomMarginFromClearanceLine();
 
-  /** return the topmost block child based on y-index.
-    * almost always the first or second line, if there is one.
-    * accounts for lines that hold only compressed white space, etc.
-    */
-  nsIFrame* GetTopBlockChild(nsPresContext *aPresContext);
-
   static nsresult GetCurrentLine(nsBlockReflowState *aState, nsLineBox **aOutCurrentLine);
 
   static PRBool BlockIsMarginRoot(nsIFrame* aBlock);
   static PRBool BlockNeedsFloatManager(nsIFrame* aBlock);
 
   /**
    * Returns whether aFrame is a block frame that will wrap its contents
    * around floats intruding on it from the outside.  (aFrame need not
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -704,26 +704,16 @@ nsIFrame::ApplySkipSides(nsMargin& aMarg
     aMargin.right = 0;
   if (skipSides & (1 << NS_SIDE_BOTTOM))
     aMargin.bottom = 0;
   if (skipSides & (1 << NS_SIDE_LEFT))
     aMargin.left = 0;
 }
 
 nsRect
-nsIFrame::GetMarginRect() const
-{
-  nsMargin m(GetUsedMargin());
-  ApplySkipSides(m);
-  nsRect r(mRect);
-  r.Inflate(m);
-  return r;
-}
-
-nsRect
 nsIFrame::GetPaddingRect() const
 {
   nsMargin b(GetUsedBorder());
   ApplySkipSides(b);
   nsRect r(mRect);
   r.Deflate(b);
   return r;
 }
@@ -1198,26 +1188,16 @@ nsIFrame::OverflowClip(nsDisplayListBuil
                        const nsRect&           aClipRect,
                        PRBool                  aClipBorderBackground,
                        PRBool                  aClipAll)
 {
   nsOverflowClipWrapper wrapper(this, aClipRect, aClipBorderBackground, aClipAll);
   return wrapper.WrapLists(aBuilder, this, aFromSet, aToSet);
 }
 
-nsresult
-nsIFrame::Clip(nsDisplayListBuilder*   aBuilder,
-               const nsDisplayListSet& aFromSet,
-               const nsDisplayListSet& aToSet,
-               const nsRect&           aClipRect)
-{
-  nsAbsPosClipWrapper wrapper(this, aClipRect);
-  return wrapper.WrapLists(aBuilder, this, aFromSet, aToSet);
-}
-
 static nsresult
 BuildDisplayListWithOverflowClip(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
     const nsRect& aDirtyRect, const nsDisplayListSet& aSet,
     const nsRect& aClipRect)
 {
   nsDisplayListCollection set;
   nsresult rv = aFrame->BuildDisplayList(aBuilder, aDirtyRect, set);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/layout/generic/nsFrameList.cpp
+++ b/layout/generic/nsFrameList.cpp
@@ -355,34 +355,16 @@ nsFrameList::ContainsFrame(const nsIFram
     if (frame == aFrame) {
       return PR_TRUE;
     }
     frame = frame->GetNextSibling();
   }
   return PR_FALSE;
 }
 
-PRBool
-nsFrameList::ContainsFrameBefore(const nsIFrame* aFrame, const nsIFrame* aEnd) const
-{
-  NS_PRECONDITION(aFrame, "null ptr");
-
-  nsIFrame* frame = mFirstChild;
-  while (frame) {
-    if (frame == aEnd) {
-      return PR_FALSE;
-    }
-    if (frame == aFrame) {
-      return PR_TRUE;
-    }
-    frame = frame->GetNextSibling();
-  }
-  return PR_FALSE;
-}
-
 PRInt32
 nsFrameList::GetLength() const
 {
   PRInt32 count = 0;
   nsIFrame* frame = mFirstChild;
   while (frame) {
     count++;
     frame = frame->GetNextSibling();
@@ -425,38 +407,16 @@ class CompareByContentOrderComparator
     return aA == aB;
   }
   PRBool LessThan(const nsIFrame* aA, const nsIFrame* aB) const {
     return CompareByContentOrder(aA, aB) < 0;
   }
 };
 
 void
-nsFrameList::SortByContentOrder()
-{
-  if (IsEmpty())
-    return;
-
-  nsAutoTArray<nsIFrame*, 8> array;
-  nsIFrame* f;
-  for (f = mFirstChild; f; f = f->GetNextSibling()) {
-    array.AppendElement(f);
-  }
-  array.Sort(CompareByContentOrderComparator());
-  f = mFirstChild = array.ElementAt(0);
-  for (PRUint32 i = 1; i < array.Length(); ++i) {
-    nsIFrame* ff = array.ElementAt(i);
-    f->SetNextSibling(ff);
-    f = ff;
-  }
-  f->SetNextSibling(nsnull);
-  mLastChild = f;
-}
-
-void
 nsFrameList::ApplySetParent(nsIFrame* aParent) const
 {
   NS_ASSERTION(aParent, "null ptr");
 
   for (nsIFrame* f = FirstChild(); f; f = f->GetNextSibling()) {
     f->SetParent(aParent);
   }
 }
--- a/layout/generic/nsFrameList.h
+++ b/layout/generic/nsFrameList.h
@@ -210,24 +210,16 @@ public:
 
   /**
    * Split this frame list such that all the frames coming after the link
    * pointed to by aLink end up in the returned list, while the frames before
    * that link stay in this list.  After this call, aLink is at end.
    */
   nsFrameList ExtractTail(FrameLinkEnumerator& aLink);
 
-  /**
-   * Sort the frames according to content order so that the first
-   * frame in the list is the first in content order. Frames for
-   * the same content will be ordered so that a prev in flow
-   * comes before its next in flow.
-   */
-  void SortByContentOrder();
-
   nsIFrame* FirstChild() const {
     return mFirstChild;
   }
 
   nsIFrame* LastChild() const {
     return mLastChild;
   }
 
@@ -238,17 +230,16 @@ public:
     return nsnull == mFirstChild;
   }
 
   PRBool NotEmpty() const {
     return nsnull != mFirstChild;
   }
 
   PRBool ContainsFrame(const nsIFrame* aFrame) const;
-  PRBool ContainsFrameBefore(const nsIFrame* aFrame, const nsIFrame* aEnd) const;
 
   PRInt32 GetLength() const;
 
   /**
    * If this frame list has only one frame, return that frame.
    * Otherwise, return null.
    */
   nsIFrame* OnlyChild() const {
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -88,26 +88,16 @@ static NS_DEFINE_CID(kLookAndFeelCID, NS
 /*******************************************************************************
  * nsFramesetDrag
  ******************************************************************************/
 nsFramesetDrag::nsFramesetDrag() 
 {
   UnSet();
 }
 
-nsFramesetDrag::nsFramesetDrag(PRBool               aVertical, 
-                               PRInt32              aIndex, 
-                               PRInt32              aChange, 
-                               nsHTMLFramesetFrame* aSource) 
-{
-  mVertical = aVertical;
-  mIndex    = aIndex;
-  mChange   = aChange; 
-  mSource   = aSource;
-}
 void nsFramesetDrag::Reset(PRBool               aVertical, 
                            PRInt32              aIndex, 
                            PRInt32              aChange, 
                            nsHTMLFramesetFrame* aSource) 
 {
   mVertical = aVertical;
   mIndex    = aIndex;
   mChange   = aChange;
--- a/layout/generic/nsFrameSetFrame.h
+++ b/layout/generic/nsFrameSetFrame.h
@@ -82,20 +82,16 @@ enum nsFrameborder {
 struct nsFramesetDrag {
   nsHTMLFramesetFrame* mSource;    // frameset whose border was dragged to cause the resize
   PRInt32              mIndex;     // index of left col or top row of effected area
   PRInt32              mChange;    // pos for left to right or top to bottom, neg otherwise
   PRPackedBool         mVertical;  // vertical if true, otherwise horizontal
   PRPackedBool         mActive;
 
   nsFramesetDrag();
-  nsFramesetDrag(PRBool               aVertical, 
-                 PRInt32              aIndex, 
-                 PRInt32              aChange, 
-                 nsHTMLFramesetFrame* aSource); 
   void Reset(PRBool               aVertical, 
              PRInt32              aIndex, 
              PRInt32              aChange, 
              nsHTMLFramesetFrame* aSource); 
   void UnSet();
 };
 
 /*******************************************************************************
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -883,23 +883,17 @@ public:
    * Apply the result of GetSkipSides() on this frame to an nsMargin by
    * setting to zero any sides that are skipped.
    */
   void ApplySkipSides(nsMargin& aMargin) const;
 
   /**
    * Like the frame's rect (see |GetRect|), which is the border rect,
    * other rectangles of the frame, in app units, relative to the parent.
-   *
-   * Note that GetMarginRect is not meaningful for blocks (anything with
-   * 'display:block', whether block frame or not) because of both the
-   * collapsing and 'auto' issues with GetUsedMargin (on which it
-   * depends).
    */
-  nsRect GetMarginRect() const;
   nsRect GetPaddingRect() const;
   nsRect GetContentRect() const;
 
   /**
    * Get the position of the frame's baseline, relative to the top of
    * the frame (its top border edge).  Only valid when Reflow is not
    * needed and when the frame returned nsHTMLReflowMetrics::
    * ASK_FOR_BASELINE as ascent in its reflow metrics.
@@ -1028,25 +1022,16 @@ public:
    */
   nsresult OverflowClip(nsDisplayListBuilder*   aBuilder,
                         const nsDisplayListSet& aFromSet,
                         const nsDisplayListSet& aToSet,
                         const nsRect&           aClipRect,
                         PRBool                  aClipBorderBackground = PR_FALSE,
                         PRBool                  aClipAll = PR_FALSE);
 
-  /**
-   * Clips the display items of aFromSet, putting the results in aToSet.
-   * All items are clipped.
-   */
-  nsresult Clip(nsDisplayListBuilder* aBuilder,
-                const nsDisplayListSet& aFromSet,
-                const nsDisplayListSet& aToSet,
-                const nsRect& aClipRect);
-
   enum {
     DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT = 0x01,
     DISPLAY_CHILD_FORCE_STACKING_CONTEXT = 0x02,
     DISPLAY_CHILD_INLINE = 0x04
   };
   /**
    * Adjusts aDirtyRect for the child's offset, checks that the dirty rect
    * actually intersects the child (or its descendants), calls BuildDisplayList
--- a/layout/generic/nsILineIterator.h
+++ b/layout/generic/nsILineIterator.h
@@ -103,25 +103,16 @@ public:
                      PRUint32* aLineFlags) = 0;
 
   /**
    * Given a frame that's a child of the block, find which line its on
    * and return that line index. Returns -1 if the frame cannot be found.
    */
   virtual PRInt32 FindLineContaining(nsIFrame* aFrame) = 0;
 
-  /**
-   * Given a Y coordinate relative to the block that provided this
-   * line iterator, return the line that contains the Y
-   * coordinate. Returns -1 in aLineNumberResult if the Y coordinate
-   * is above the first line. Returns N (where N is the number of
-   * lines) if the Y coordinate is below the last line.
-   */
-  virtual PRInt32 FindLineAt(nscoord aY) = 0;
-
   // Given a line number and an X coordinate, find the frame on the
   // line that is nearest to the X coordinate. The
   // aXIsBeforeFirstFrame and aXIsAfterLastFrame flags are updated
   // appropriately.
   NS_IMETHOD FindFrameAt(PRInt32 aLineNumber,
                          nscoord aX,
                          nsIFrame** aFrameFound,
                          PRBool* aXIsBeforeFirstFrame,
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -78,18 +78,16 @@ public:
   virtual void ParseCoords(const nsAString& aSpec);
 
   virtual PRBool IsInside(nscoord x, nscoord y) const = 0;
   virtual void Draw(nsIFrame* aFrame, nsIRenderingContext& aRC) = 0;
   virtual void GetRect(nsIFrame* aFrame, nsRect& aRect) = 0;
 
   void HasFocus(PRBool aHasFocus);
 
-  void GetHREF(nsAString& aHref) const;
-
   nsCOMPtr<nsIContent> mArea;
   nscoord* mCoords;
   PRInt32 mNumCoords;
   PRPackedBool mHasFocus;
 };
 
 Area::Area(nsIContent* aArea)
   : mArea(aArea)
@@ -102,25 +100,16 @@ Area::Area(nsIContent* aArea)
 }
 
 Area::~Area()
 {
   MOZ_COUNT_DTOR(Area);
   delete [] mCoords;
 }
 
-void
-Area::GetHREF(nsAString& aHref) const
-{
-  aHref.Truncate();
-  if (mArea) {
-    mArea->GetAttr(kNameSpaceID_None, nsGkAtoms::href, aHref);
-  }
-}
-
 #include <stdlib.h>
 
 inline PRBool
 is_space(char c)
 {
   return (c == ' ' ||
           c == '\f' ||
           c == '\n' ||
--- a/layout/generic/nsIntervalSet.cpp
+++ b/layout/generic/nsIntervalSet.cpp
@@ -92,27 +92,16 @@ void nsIntervalSet::IncludeInterval(coor
         newInterval->mBegin = NS_MIN(newInterval->mBegin, subsumed->mBegin);
         newInterval->mEnd = NS_MAX(newInterval->mEnd, subsumed->mEnd);
         newInterval->mNext = subsumed->mNext;
         FreeInterval(subsumed);
         subsumed = newInterval->mNext;
     }
 }
 
-PRBool nsIntervalSet::HasPoint(coord_type aPoint) const
-{
-    Interval *current = mList;
-    while (current && current->mBegin <= aPoint) {
-        if (current->mEnd >= aPoint)
-            return PR_TRUE;
-        current = current->mNext;
-    }
-    return PR_FALSE;
-}
-
 PRBool nsIntervalSet::Intersects(coord_type aBegin, coord_type aEnd) const
 {
     Interval *current = mList;
     while (current && current->mBegin <= aEnd) {
         if (current->mEnd >= aBegin)
             return PR_TRUE;
         current = current->mNext;
     }
--- a/layout/generic/nsIntervalSet.h
+++ b/layout/generic/nsIntervalSet.h
@@ -71,21 +71,16 @@ public:
      * Removal of intervals added is not supported because that would
      * require keeping track of the individual intervals that were
      * added (nsIntervalMap should do that).  It would be simple to
      * implement ExcludeInterval if anyone wants it, though.
      */
     void IncludeInterval(coord_type aBegin, coord_type aEnd);
 
     /*
-     * Is the point aPoint contained within the set of intervals?
-     */
-    PRBool HasPoint(coord_type aPoint) const;
-
-    /*
      * Are _some_ points in [aBegin, aEnd] contained within the set
      * of intervals?
      */
     PRBool Intersects(coord_type aBegin, coord_type aEnd) const;
 
     /*
      * Are _all_ points in [aBegin, aEnd] contained within the set
      * of intervals?
--- a/layout/generic/nsLineBox.cpp
+++ b/layout/generic/nsLineBox.cpp
@@ -351,36 +351,16 @@ nsLineBox::DeleteLineList(nsPresContext*
       line->Destroy(shell);
     } while (! aLines.empty());
 #ifdef DEBUG
     NS_ASSERTION(numFrames == 0, "number of frames deleted does not match");
 #endif
   }
 }
 
-nsLineBox*
-nsLineBox::FindLineContaining(nsLineList& aLines, nsIFrame* aFrame,
-                              PRInt32* aFrameIndexInLine)
-{
-  NS_PRECONDITION(aFrameIndexInLine && !aLines.empty() && aFrame, "null ptr");
-  for (nsLineList::iterator line = aLines.begin(),
-                            line_end = aLines.end();
-       line != line_end;
-       ++line)
-  {
-    PRInt32 ix = line->IndexOf(aFrame);
-    if (ix >= 0) {
-      *aFrameIndexInLine = ix;
-      return line;
-    }
-  }
-  *aFrameIndexInLine = -1;
-  return nsnull;
-}
-
 PRBool
 nsLineBox::RFindLineContaining(nsIFrame* aFrame,
                                const nsLineList::iterator& aBegin,
                                nsLineList::iterator& aEnd,
                                nsIFrame* aLastFrameBeforeEnd,
                                PRInt32* aFrameIndexInLine)
 {
   NS_PRECONDITION(aFrame, "null ptr");
@@ -651,33 +631,16 @@ nsLineIterator::FindLineContaining(nsIFr
     if (line->Contains(aFrame)) {
       return lineNumber;
     }
     line = mLines[++lineNumber];
   }
   return -1;
 }
 
-/* virtual */ PRInt32
-nsLineIterator::FindLineAt(nscoord aY)
-{
-  nsLineBox* line = mLines[0];
-  if (!line || (aY < line->mBounds.y)) {
-    return -1;
-  }
-  PRInt32 lineNumber = 0;
-  while (lineNumber != mNumLines) {
-    if ((aY >= line->mBounds.y) && (aY < line->mBounds.YMost())) {
-      return lineNumber;
-    }
-    line = mLines[++lineNumber];
-  }
-  return mNumLines;
-}
-
 #ifdef IBMBIDI
 NS_IMETHODIMP
 nsLineIterator::CheckLineOrder(PRInt32                  aLine,
                                PRBool                   *aIsReordered,
                                nsIFrame                 **aFirstVisual,
                                nsIFrame                 **aLastVisual)
 {
   NS_ASSERTION (aLine >= 0 && aLine < mNumLines, "aLine out of range!");
--- a/layout/generic/nsLineBox.h
+++ b/layout/generic/nsLineBox.h
@@ -429,21 +429,16 @@ public:
 
   nscoord GetHeight() const {
     return mBounds.height;
   }
 
   static void DeleteLineList(nsPresContext* aPresContext, nsLineList& aLines,
                              nsIFrame* aDestructRoot);
 
-  // search from beginning to end
-  // XXX Should switch to API below
-  static nsLineBox* FindLineContaining(nsLineList& aLines, nsIFrame* aFrame,
-                                       PRInt32* aFrameIndexInLine);
-
   // search from end to beginning of [aBegin, aEnd)
   // Returns PR_TRUE if it found the line and PR_FALSE if not.
   // Moves aEnd as it searches so that aEnd points to the resulting line.
   // aLastFrameBeforeEnd is the last frame before aEnd (so if aEnd is
   // the end of the line list, it's just the last frame in the frame
   // list).
   static PRBool RFindLineContaining(nsIFrame* aFrame,
                                     const nsLineList_iterator& aBegin,
@@ -1540,17 +1535,16 @@ public:
   virtual PRInt32 GetNumLines();
   virtual PRBool GetDirection();
   NS_IMETHOD GetLine(PRInt32 aLineNumber,
                      nsIFrame** aFirstFrameOnLine,
                      PRInt32* aNumFramesOnLine,
                      nsRect& aLineBounds,
                      PRUint32* aLineFlags);
   virtual PRInt32 FindLineContaining(nsIFrame* aFrame);
-  virtual PRInt32 FindLineAt(nscoord aY);
   NS_IMETHOD FindFrameAt(PRInt32 aLineNumber,
                          nscoord aX,
                          nsIFrame** aFrameFound,
                          PRBool* aXIsBeforeFirstFrame,
                          PRBool* aXIsAfterLastFrame);
 
   NS_IMETHOD GetNextSiblingOnLine(nsIFrame*& aFrame, PRInt32 aLineNumber);
 #ifdef IBMBIDI
--- a/layout/mathml/nsIMathMLFrame.h
+++ b/layout/mathml/nsIMathMLFrame.h
@@ -79,19 +79,16 @@ public:
   */
   NS_IMETHOD
   GetBoundingMetrics(nsBoundingMetrics& aBoundingMetrics) = 0;
 
   NS_IMETHOD
   SetBoundingMetrics(const nsBoundingMetrics& aBoundingMetrics) = 0;
 
   NS_IMETHOD
-  GetReference(nsPoint& aReference) = 0;
-
-  NS_IMETHOD
   SetReference(const nsPoint& aReference) = 0;
 
   virtual eMathMLFrameType GetMathMLFrameType() = 0;
 
  /* SUPPORT FOR STRETCHY ELEMENTS */
  /*====================================================================*/
 
  /* Stretch :
@@ -112,40 +109,30 @@ public:
   *        of the frame, on output the size after stretching.
   */
   NS_IMETHOD 
   Stretch(nsIRenderingContext& aRenderingContext,
           nsStretchDirection   aStretchDirection,
           nsBoundingMetrics&   aContainerSize,
           nsHTMLReflowMetrics& aDesiredStretchSize) = 0;
 
- /* GetEmbellishData/SetEmbellishData :
-  * Get/Set the mEmbellishData member variable.
-  */
-
+ /* Get the mEmbellishData member variable. */
+ 
   NS_IMETHOD
   GetEmbellishData(nsEmbellishData& aEmbellishData) = 0;
 
-  NS_IMETHOD
-  SetEmbellishData(const nsEmbellishData& aEmbellishData) = 0;
-
 
  /* SUPPORT FOR SCRIPTING ELEMENTS */
  /*====================================================================*/
 
- /* GetPresentationData/SetPresentationData :
-  * Get/Set the mPresentationData member variable.
-  */
+ /* Get the mPresentationData member variable. */
 
   NS_IMETHOD
   GetPresentationData(nsPresentationData& aPresentationData) = 0;
 
-  NS_IMETHOD
-  SetPresentationData(const nsPresentationData& aPresentationData) = 0;
-
   /* InheritAutomaticData() / TransmitAutomaticData() :
    * There are precise rules governing each MathML frame and its children.
    * Properties such as the scriptlevel or the embellished nature of a frame
    * depend on those rules. Also, certain properties that we use to emulate
    * TeX rendering rules are frame-dependent too. These two methods are meant
    * to be implemented by frame classes that need to assert specific properties
    * within their subtrees.
    *
--- a/layout/mathml/nsMathMLFrame.h
+++ b/layout/mathml/nsMathMLFrame.h
@@ -67,22 +67,16 @@ public:
 
   NS_IMETHOD
   SetBoundingMetrics(const nsBoundingMetrics& aBoundingMetrics) {
     mBoundingMetrics = aBoundingMetrics;
     return NS_OK;
   }
 
   NS_IMETHOD
-  GetReference(nsPoint& aReference) {
-    aReference = mReference;
-    return NS_OK;
-  }
-
-  NS_IMETHOD
   SetReference(const nsPoint& aReference) {
     mReference = aReference;
     return NS_OK;
   }
 
   virtual eMathMLFrameType GetMathMLFrameType();
 
   NS_IMETHOD
@@ -94,36 +88,24 @@ public:
     return NS_OK;
   }
 
   NS_IMETHOD
   GetEmbellishData(nsEmbellishData& aEmbellishData) {
     aEmbellishData = mEmbellishData;
     return NS_OK;
   }
- 
-  NS_IMETHOD
-  SetEmbellishData(const nsEmbellishData& aEmbellishData) {
-    mEmbellishData = aEmbellishData;
-    return NS_OK;
-  }
 
   NS_IMETHOD
   GetPresentationData(nsPresentationData& aPresentationData) {
     aPresentationData = mPresentationData;
     return NS_OK;
   }
 
   NS_IMETHOD
-  SetPresentationData(const nsPresentationData& aPresentationData) {
-    mPresentationData = aPresentationData;
-    return NS_OK;
-  }
-
-  NS_IMETHOD
   InheritAutomaticData(nsIFrame* aParent);
 
   NS_IMETHOD
   TransmitAutomaticData()
   {
     return NS_OK;
   }
 
--- a/layout/style/nsCSSDeclaration.cpp
+++ b/layout/style/nsCSSDeclaration.cpp
@@ -113,22 +113,16 @@ nsCSSDeclaration::RemoveProperty(nsCSSPr
     data.ClearProperty(aProperty);
     mOrder.RemoveElement(aProperty);
   }
 
   CompressFrom(&data);
   return NS_OK;
 }
 
-nsresult
-nsCSSDeclaration::AppendComment(const nsAString& aComment)
-{
-  return /* NS_ERROR_NOT_IMPLEMENTED, or not any longer that is */ NS_OK;
-}
-
 PRBool nsCSSDeclaration::AppendValueToString(nsCSSProperty aProperty, nsAString& aResult) const
 {
   nsCSSCompressedDataBlock *data = GetValueIsImportant(aProperty)
                                       ? mImportantData : mData;
   const void *storage = data->StorageFor(aProperty);
   return nsCSSDeclaration::AppendStorageToString(aProperty, storage, aResult);
 }
 
--- a/layout/style/nsCSSDeclaration.h
+++ b/layout/style/nsCSSDeclaration.h
@@ -68,17 +68,16 @@ public:
 
   /**
    * |ValueAppended| must be called to maintain this declaration's
    * |mOrder| whenever a property is parsed into an expanded data block
    * for this declaration.  aProperty must not be a shorthand.
    */
   nsresult ValueAppended(nsCSSProperty aProperty);
 
-  nsresult AppendComment(const nsAString& aComment);
   nsresult RemoveProperty(nsCSSProperty aProperty);
 
   nsresult GetValue(nsCSSProperty aProperty, nsAString& aValue) const;
 
   PRBool HasImportantData() const { return mImportantData != nsnull; }
   PRBool GetValueIsImportant(nsCSSProperty aProperty) const;
   PRBool GetValueIsImportant(const nsAString& aProperty) const;
 
--- a/layout/style/nsCSSLoader.cpp
+++ b/layout/style/nsCSSLoader.cpp
@@ -213,19 +213,19 @@ public:
 
   // mIsLoading is true from the moment we are placed in the loader's
   // "loading datas" table (right after the async channel is opened)
   // to the moment we are removed from said table (due to the load
   // completing or being cancelled).
   PRPackedBool               mIsLoading : 1;
 
   // mIsCancelled is set to true when a sheet load is stopped by
-  // Stop() or StopLoadingSheet().  SheetLoadData::OnStreamComplete()
-  // checks this to avoid parsing sheets that have been cancelled and
-  // such.
+  // Stop() or StopLoadingSheet() (which was removed in Bug 556446).
+  // SheetLoadData::OnStreamComplete() checks this to avoid parsing 
+  // sheets that have been cancelled and such.
   PRPackedBool               mIsCancelled : 1;
 
   // mMustNotify is true if the load data is being loaded async and
   // the original function call that started the load has returned.
   // XXXbz sort our relationship with load/error events!
   PRPackedBool               mMustNotify : 1;
 
   // mWasAlternate is true if the sheet was an alternate when the load data was
@@ -534,24 +534,16 @@ Loader::SetPreferredSheet(const nsAStrin
       --mDatasToNotifyOn;
       LoadSheet(arr[i], eSheetNeedsParser);
     }
   }
 
   return NS_OK;
 }
 
-nsresult
-Loader::GetPreferredSheet(nsAString& aTitle)
-{
-  aTitle.Assign(mPreferredSheet);
-  return NS_OK;
-}
-
-
 static const char kCharsetSym[] = "@charset \"";
 
 static nsresult GetCharsetFromData(const unsigned char* aStyleSheetData,
                                    PRUint32 aDataLength,
                                    nsACString& aCharset)
 {
   aCharset.Truncate();
   if (aDataLength <= sizeof(kCharsetSym) - 1)
@@ -2336,99 +2328,16 @@ Loader::Stop()
   mDatasToNotifyOn += arr.Length();
   for (i = 0; i < arr.Length(); ++i) {
     --mDatasToNotifyOn;
     SheetComplete(arr[i], NS_BINDING_ABORTED);
   }
   return NS_OK;
 }
 
-struct StopLoadingSheetsByURIClosure {
-  StopLoadingSheetsByURIClosure(nsIURI* aURI,
-                                Loader::LoadDataArray& aArray) :
-    uri(aURI), array(aArray)
-  {}
-  
-  nsIURI* uri;
-  Loader::LoadDataArray& array;
-};
-
-static PLDHashOperator
-StopLoadingSheetByURICallback(URIAndPrincipalHashKey* aKey,
-                              SheetLoadData*& aData,
-                              void* aClosure)
-{
-  NS_PRECONDITION(aData, "Must have a data!");
-  NS_PRECONDITION(aClosure, "Must have a loader");
-
-  StopLoadingSheetsByURIClosure* closure =
-    static_cast<StopLoadingSheetsByURIClosure*>(aClosure);
-
-  PRBool equal;
-  if (NS_SUCCEEDED(aData->mURI->Equals(closure->uri, &equal)) &&
-      equal) {
-    aData->mIsLoading = PR_FALSE; // we will handle the removal right here
-    aData->mIsCancelled = PR_TRUE;
-
-    closure->array.AppendElement(aData);
-    return PL_DHASH_REMOVE;
-  }
-
-  return PL_DHASH_NEXT;
-}
-
-nsresult
-Loader::StopLoadingSheet(nsIURI* aURL)
-{
-  NS_ENSURE_TRUE(aURL, NS_ERROR_NULL_POINTER);
-
-  PRUint32 pendingCount =
-    mPendingDatas.IsInitialized() ?  mPendingDatas.Count() : 0;
-  PRUint32 loadingCount =
-    mLoadingDatas.IsInitialized() ? mLoadingDatas.Count() : 0;
-  LoadDataArray arr(pendingCount + loadingCount + mPostedEvents.Length());
-
-  StopLoadingSheetsByURIClosure closure(aURL, arr);
-  if (pendingCount) {
-    mPendingDatas.Enumerate(StopLoadingSheetByURICallback, &closure);
-  }
-  if (loadingCount) {
-    mLoadingDatas.Enumerate(StopLoadingSheetByURICallback, &closure);
-  }
-
-  PRUint32 i;
-  for (i = 0; i < mPostedEvents.Length(); ++i) {
-    SheetLoadData* curData = mPostedEvents[i];
-    PRBool equal;
-    if (curData->mURI && NS_SUCCEEDED(curData->mURI->Equals(aURL, &equal)) &&
-        equal) {
-      curData->mIsCancelled = PR_TRUE;
-      if (arr.AppendElement(curData)) {
-        // SheetComplete() calls Release(), so give this an extra ref.
-        NS_ADDREF(curData);
-      }
-#ifdef DEBUG
-      else {
-        NS_NOTREACHED("We preallocated this memory... shouldn't really fail, "
-                      "except we never check that preallocation succeeds.");
-      }
-#endif
-    }
-  }
-  mPostedEvents.Clear();
-
-  mDatasToNotifyOn += arr.Length();
-  for (i = 0; i < arr.Length(); ++i) {
-    --mDatasToNotifyOn;
-    SheetComplete(arr[i], NS_BINDING_ABORTED);
-  }
-
-  return NS_OK;
-}
-
 PRBool
 Loader::HasPendingLoads()
 {
   return
     (mLoadingDatas.IsInitialized() && mLoadingDatas.Count() != 0) ||
     (mPendingDatas.IsInitialized() && mPendingDatas.Count() != 0) ||
     mPostedEvents.Length() != 0 ||
     mDatasToNotifyOn != 0;
--- a/layout/style/nsCSSLoader.h
+++ b/layout/style/nsCSSLoader.h
@@ -149,17 +149,16 @@ public:
   NS_IMETHOD_(nsrefcnt) Release();
 
   void DropDocumentReference(); // notification that doc is going away
 
   void SetCompatibilityMode(nsCompatibility aCompatMode)
   { mCompatMode = aCompatMode; }
   nsCompatibility GetCompatibilityMode() { return mCompatMode; }
   nsresult SetPreferredSheet(const nsAString& aTitle);
-  nsresult GetPreferredSheet(nsAString& aTitle);
 
   // XXXbz sort out what the deal is with events!  When should they fire?
 
   /**
    * Load an inline style sheet.  If a successful result is returned and
    * *aCompleted is false, then aObserver is guaranteed to be notified
    * asynchronously once the sheet is marked complete.  If an error is
    * returned, or if *aCompleted is true, aObserver will not be notified.  In
@@ -310,20 +309,20 @@ public:
 
   /**
    * Stop loading all sheets.  All nsICSSLoaderObservers involved will be
    * notified with NS_BINDING_ABORTED as the status, possibly synchronously.
    */
   nsresult Stop(void);
 
   /**
-   * Stop loading one sheet.  The nsICSSLoaderObserver involved will be
-   * notified with NS_BINDING_ABORTED as the status, possibly synchronously.
+   * nsresult Loader::StopLoadingSheet(nsIURI* aURL), which notifies the
+   * nsICSSLoaderObserver with NS_BINDING_ABORTED, was removed in Bug 556446. 
+   * It can be found in revision 2c44a32052ad.
    */
-  nsresult StopLoadingSheet(nsIURI* aURL);
 
   /**
    * Whether the loader is enabled or not.
    * When disabled, processing of new styles is disabled and an attempt
    * to do so will fail with a return code of
    * NS_ERROR_NOT_AVAILABLE. Note that this DOES NOT disable
    * currently loading styles or already processed styles.
    */
--- a/layout/style/nsCSSPseudoClasses.cpp
+++ b/layout/style/nsCSSPseudoClasses.cpp
@@ -62,22 +62,16 @@ static const nsStaticAtom CSSPseudoClass
 };
 
 void nsCSSPseudoClasses::AddRefAtoms()
 {
   NS_RegisterStaticAtoms(CSSPseudoClasses_info,
                          NS_ARRAY_LENGTH(CSSPseudoClasses_info));
 }
 
-PRBool nsCSSPseudoClasses::IsPseudoClass(nsIAtom *aAtom)
-{
-  return nsAtomListUtils::IsMember(aAtom,CSSPseudoClasses_info,
-                                   NS_ARRAY_LENGTH(CSSPseudoClasses_info));
-}
-
 PRBool
 nsCSSPseudoClasses::HasStringArg(nsIAtom* aAtom)
 {
   return aAtom == nsCSSPseudoClasses::lang ||
          aAtom == nsCSSPseudoClasses::mozEmptyExceptChildrenWithLocalname ||
          aAtom == nsCSSPseudoClasses::mozSystemMetric ||
          aAtom == nsCSSPseudoClasses::mozLocaleDir;
 }
--- a/layout/style/nsCSSPseudoClasses.h
+++ b/layout/style/nsCSSPseudoClasses.h
@@ -47,17 +47,16 @@
 // require an atom from this atom list.
 class nsICSSPseudoClass : public nsIAtom {};
 
 class nsCSSPseudoClasses {
 public:
 
   static void AddRefAtoms();
 
-  static PRBool IsPseudoClass(nsIAtom *aAtom);
   static PRBool HasStringArg(nsIAtom* aAtom);
   static PRBool HasNthPairArg(nsIAtom* aAtom);
 
 #define CSS_PSEUDO_CLASS(_name, _value) static nsICSSPseudoClass* _name;
 #include "nsCSSPseudoClassList.h"
 #undef CSS_PSEUDO_CLASS
 
   enum Type {
--- a/layout/style/nsCSSStruct.cpp
+++ b/layout/style/nsCSSStruct.cpp
@@ -201,24 +201,16 @@ nsCSSCornerSizes::nsCSSCornerSizes(const
 }
 
 nsCSSCornerSizes::~nsCSSCornerSizes()
 {
   MOZ_COUNT_DTOR(nsCSSCornerSizes);
 }
 
 void
-nsCSSCornerSizes::SetAllCornersTo(const nsCSSValue& aValue)
-{
-  NS_FOR_CSS_FULL_CORNERS(corner) {
-    this->GetFullCorner(corner).SetBothValuesTo(aValue);
-  }
-}
-
-void
 nsCSSCornerSizes::Reset()
 {
   NS_FOR_CSS_FULL_CORNERS(corner) {
     this->GetFullCorner(corner).Reset();
   }
 }
 
 #if NS_CORNER_TOP_LEFT != 0 || NS_CORNER_TOP_RIGHT != 1 || \
--- a/layout/style/nsCSSStruct.h
+++ b/layout/style/nsCSSStruct.h
@@ -201,17 +201,16 @@ struct nsCSSCornerSizes {
   PRBool HasValue() const {
     NS_FOR_CSS_FULL_CORNERS(corner) {
       if (this->GetFullCorner(corner).HasValue())
         return PR_TRUE;
     }
     return PR_FALSE;
   }
 
-  void SetAllCornersTo(const nsCSSValue& aValue);
   void Reset();
 
   nsCSSValuePair mTopLeft;
   nsCSSValuePair mTopRight;
   nsCSSValuePair mBottomRight;
   nsCSSValuePair mBottomLeft;
 
 protected:
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -409,22 +409,16 @@ void nsCSSValue::SetDummyValue()
 }
 
 void nsCSSValue::SetDummyInheritValue()
 {
   Reset();
   mUnit = eCSSUnit_DummyInherit;
 }
 
-void nsCSSValue::SetRectIsAutoValue()
-{
-  Reset();
-  mUnit = eCSSUnit_RectIsAuto;
-}
-
 void nsCSSValue::StartImageLoad(nsIDocument* aDocument) const
 {
   NS_PRECONDITION(eCSSUnit_URL == mUnit, "Not a URL value!");
   nsCSSValue::Image* image =
     new nsCSSValue::Image(mValue.mURL->mURI,
                           mValue.mURL->mString,
                           mValue.mURL->mReferrer,
                           mValue.mURL->mOriginPrincipal,
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -336,17 +336,16 @@ public:
   NS_HIDDEN_(void)  SetInheritValue();
   NS_HIDDEN_(void)  SetInitialValue();
   NS_HIDDEN_(void)  SetNoneValue();
   NS_HIDDEN_(void)  SetAllValue();
   NS_HIDDEN_(void)  SetNormalValue();
   NS_HIDDEN_(void)  SetSystemFontValue();
   NS_HIDDEN_(void)  SetDummyValue();
   NS_HIDDEN_(void)  SetDummyInheritValue();
-  NS_HIDDEN_(void)  SetRectIsAutoValue();
   NS_HIDDEN_(void)  StartImageLoad(nsIDocument* aDocument)
                                    const;  // Not really const, but pretending
 
   // Initializes as a function value with the specified function id.
   NS_HIDDEN_(Array*) InitFunction(nsCSSKeyword aFunctionId, PRUint32 aNumArgs);
   // Checks if this is a function value with the specified function id.
   NS_HIDDEN_(PRBool) EqualsFunction(nsCSSKeyword aFunctionId) const;
 
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -492,52 +492,16 @@ nsHTMLStyleSheet::Reset(nsIURI* aURL)
     PL_DHashTableFinish(&mMappedAttrTable);
     mMappedAttrTable.ops = nsnull;
   }
 
   return NS_OK;
 }
 
 nsresult
-nsHTMLStyleSheet::GetLinkColor(nscolor& aColor)
-{
-  if (!mLinkRule) {
-    return NS_HTML_STYLE_PROPERTY_NOT_THERE;
-  }
-  else {
-    aColor = mLinkRule->mColor;
-    return NS_OK;
-  }
-}
-
-nsresult
-nsHTMLStyleSheet::GetActiveLinkColor(nscolor& aColor)
-{
-  if (!mActiveRule) {
-    return NS_HTML_STYLE_PROPERTY_NOT_THERE;
-  }
-  else {
-    aColor = mActiveRule->mColor;
-    return NS_OK;
-  }
-}
-
-nsresult
-nsHTMLStyleSheet::GetVisitedLinkColor(nscolor& aColor)
-{
-  if (!mVisitedRule) {
-    return NS_HTML_STYLE_PROPERTY_NOT_THERE;
-  }
-  else {
-    aColor = mVisitedRule->mColor;
-    return NS_OK;
-  }
-}
-
-nsresult
 nsHTMLStyleSheet::SetLinkColor(nscolor aColor)
 {
   if (mLinkRule) {
     if (mLinkRule->mColor == aColor)
       return NS_OK;
     NS_RELEASE(mLinkRule);
   }
 
--- a/layout/style/nsHTMLStyleSheet.h
+++ b/layout/style/nsHTMLStyleSheet.h
@@ -88,19 +88,16 @@ public:
   virtual PRBool HasDocumentStateDependentStyle(StateRuleProcessorData* aData);
   virtual nsRestyleHint
     HasAttributeDependentStyle(AttributeRuleProcessorData* aData);
   NS_IMETHOD MediumFeaturesChanged(nsPresContext* aPresContext,
                                    PRBool* aRulesChanged);
 
   nsresult Init(nsIURI* aURL, nsIDocument* aDocument);
   nsresult Reset(nsIURI* aURL);
-  nsresult GetLinkColor(nscolor& aColor);
-  nsresult GetActiveLinkColor(nscolor& aColor);
-  nsresult GetVisitedLinkColor(nscolor& aColor);
   nsresult SetLinkColor(nscolor aColor);
   nsresult SetActiveLinkColor(nscolor aColor);
   nsresult SetVisitedLinkColor(nscolor aColor);
 
   // Mapped Attribute management methods
   already_AddRefed<nsMappedAttributes>
     UniqueMappedAttributes(nsMappedAttributes* aMapped);
   void DropMappedAttributes(nsMappedAttributes* aMapped);
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -907,40 +907,16 @@ PRBool nsTableCellMap::RowHasSpanningCel
       return cellMap->RowHasSpanningCells(rowIndex, aNumEffCols);
     }
     rowIndex -= cellMap->GetRowCount();
     cellMap = cellMap->GetNextSibling();
   }
   return PR_FALSE;
 }
 
-PRBool nsTableCellMap::ColIsSpannedInto(PRInt32 aColIndex) const
-{
-  PRBool result = PR_FALSE;
-
-  PRInt32 colCount = mCols.Length();
-  if ((aColIndex >= 0) && (aColIndex < colCount)) {
-    result = mCols.ElementAt(aColIndex).mNumCellsSpan != 0;
-  }
-  return result;
-}
-
-PRBool nsTableCellMap::ColHasSpanningCells(PRInt32 aColIndex) const
-{
-  NS_PRECONDITION (aColIndex < GetColCount(), "bad col index arg");
-  nsCellMap* cellMap = mFirstMap;
-  while (cellMap) {
-    if (cellMap->ColHasSpanningCells(aColIndex)) {
-      return PR_TRUE;
-    }
-    cellMap = cellMap->GetNextSibling();
-  }
-  return PR_FALSE;
-}
-
 void nsTableCellMap::ExpandZeroColSpans()
 {
   mTableFrame.SetNeedColSpanExpansion(PR_FALSE); // mark the work done
   mTableFrame.SetHasZeroColSpans(PR_FALSE); // reset the bit, if there is a
                                             // zerospan it will be set again.
   nsCellMap* cellMap = mFirstMap;
   while (cellMap) {
     cellMap->ExpandZeroColSpans(*this);
@@ -2640,25 +2616,16 @@ void nsCellMap::Dump(PRBool aIsBorderCol
     }
     printf("\n");
   }
 
   printf("  ***** END GROUP CELL MAP DUMP *****\n");
 }
 #endif
 
-PRBool 
-nsCellMap::IsZeroColSpan(PRInt32 aRowIndex,
-                         PRInt32 aColIndex) const
-{
-  CellData* data =
-    mRows.SafeElementAt(aRowIndex, *sEmptyRow).SafeElementAt(aColIndex);
-  return data && data->IsZeroColSpan();
-}
-
 CellData* 
 nsCellMap::GetDataAt(PRInt32         aMapRowIndex,
                      PRInt32         aColIndex) const
 {
   return
     mRows.SafeElementAt(aMapRowIndex, *sEmptyRow).SafeElementAt(aColIndex);
 }
 
@@ -2774,32 +2741,16 @@ PRBool nsCellMap::RowHasSpanningCells(PR
           }
         }
       }
     }
   }
   return PR_FALSE;
 }
 
-PRBool nsCellMap::ColHasSpanningCells(PRInt32 aColIndex) const
-{
-  for (PRInt32 rowIndex = 0; rowIndex < mContentRowCount; rowIndex++) {
-    CellData* cd = GetDataAt(rowIndex, aColIndex);
-    if (cd && (cd->IsOrig())) { // cell originates 
-      CellData* cd2 = GetDataAt(rowIndex, aColIndex +1);
-      if (cd2 && cd2->IsColSpan()) { // cd2 is spanned by a col
-        if (cd->GetCellFrame() == GetCellFrame(rowIndex , aColIndex + 1, *cd2, PR_FALSE)) {
-          return PR_TRUE;
-        }
-      }
-    }
-  }
-  return PR_FALSE;
-}
-
 void nsCellMap::DestroyCellData(CellData* aData)
 {
   if (!aData) {
     return;
   }
   
   if (mIsBC) {
     BCCellData* bcData = static_cast<BCCellData*>(aData);
--- a/layout/tables/nsCellMap.h
+++ b/layout/tables/nsCellMap.h
@@ -222,19 +222,16 @@ protected:
    */
   void RebuildConsideringRows(nsCellMap*                  aCellMap,
                               PRInt32                     aStartRowIndex,
                               nsTArray<nsTableRowFrame*>* aRowsToInsert,
                               PRInt32                     aNumRowsToRemove,
                               nsRect&                     aDamageArea);
 
 public:
-  PRBool ColIsSpannedInto(PRInt32 aColIndex) const;
-  PRBool ColHasSpanningCells(PRInt32 aColIndex) const;
-
   void ExpandZeroColSpans();
 
   void SetNotTopStart(PRUint8    aSide,
                       nsCellMap& aCellMap,
                       PRUint32   aYPos,
                       PRUint32   aXPos,
                       PRBool     aIsLowerRight = PR_FALSE);
 
@@ -436,18 +433,16 @@ public:
                                   PRInt32*         aColSpan = nsnull) const;
 
   PRBool RowIsSpannedInto(PRInt32 aRowIndex,
                           PRInt32 aNumEffCols) const;
 
   PRBool RowHasSpanningCells(PRInt32 aRowIndex,
                              PRInt32 aNumEffCols) const;
 
-  PRBool ColHasSpanningCells(PRInt32 aColIndex) const;
-
   void ExpandZeroColSpans(nsTableCellMap& aMap);
 
   /** indicate whether the row has more than one cell that either originates
    * or is spanned from the rows above
    */
   PRBool HasMoreThanOneCell(PRInt32 aRowIndex) const;
 
   /* Get the rowspan for a cell starting at aRowIndex and aColIndex. 
@@ -573,19 +568,16 @@ protected:
 
   PRInt32 GetRowSpanForNewCell(nsTableCellFrame* aCellFrameToAdd,
                                PRInt32           aRowIndex,
                                PRBool&           aIsZeroRowSpan) const;
 
   PRInt32 GetColSpanForNewCell(nsTableCellFrame& aCellFrameToAdd, 
                                PRBool&           aIsZeroColSpan) const;
  
-  PRBool IsZeroColSpan(PRInt32 aRowIndex,
-                       PRInt32 aColIndex) const;
-
   // Destroy a CellData struct.  This will handle the case of aData
   // actually being a BCCellData properly.
   void DestroyCellData(CellData* aData);
   // Allocate a CellData struct.  This will handle needing to create a
   // BCCellData properly.
   // @param aOrigCell the originating cell to pass to the celldata constructor
   CellData* AllocCellData(nsTableCellFrame* aOrigCell);
 
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -489,28 +489,16 @@ PRInt32 nsTableFrame::GetEffectiveColSpa
 }
 
 PRBool nsTableFrame::HasMoreThanOneCell(PRInt32 aRowIndex) const
 {
   nsTableCellMap* tableCellMap = GetCellMap(); if (!tableCellMap) ABORT1(1);
   return tableCellMap->HasMoreThanOneCell(aRowIndex);
 }
 
-PRInt32 nsTableFrame::GetEffectiveCOLSAttribute()
-{
-  NS_PRECONDITION (GetCellMap(), "null cellMap.");
-
-  PRInt32 result;
-  result = GetStyleTable()->mCols;
-  PRInt32 numCols = GetColCount();
-  if (result > numCols)
-    result = numCols;
-  return result;
-}
-
 void nsTableFrame::AdjustRowIndices(PRInt32         aRowIndex,
                                     PRInt32         aAdjustment)
 {
   // Iterate over the row groups and adjust the row indices of all rows 
   // whose index is >= aRowIndex.
   RowGroupArray rowGroups;
   OrderRowGroups(rowGroups);
 
@@ -3246,27 +3234,16 @@ nsTableFrame::DistributeHeightToRows(con
       rgFrame->InvalidateOverflowRect();
     }
     yOriginRG = yEndRG;
   }
 
   ResizeCells(*this);
 }
 
-PRBool 
-nsTableFrame::IsPctHeight(nsStyleContext* aStyleContext) 
-{
-  PRBool result = PR_FALSE;
-  if (aStyleContext) {
-    result = (eStyleUnit_Percent ==
-              aStyleContext->GetStylePosition()->mHeight.GetUnit());
-  }
-  return result;
-}
-
 PRInt32 nsTableFrame::GetColumnWidth(PRInt32 aColIndex)
 {
   nsTableFrame * firstInFlow = (nsTableFrame *)GetFirstInFlow();
   NS_ASSERTION(firstInFlow, "illegal state -- no first in flow");
   PRInt32 result = 0;
   if (this == firstInFlow) {
     nsTableColFrame* colFrame = GetColFrame(aColIndex);
     if (colFrame) {
@@ -3275,35 +3252,16 @@ PRInt32 nsTableFrame::GetColumnWidth(PRI
   }
   else {
     result = firstInFlow->GetColumnWidth(aColIndex);
   }
 
   return result;
 }
 
-void nsTableFrame::SetColumnWidth(PRInt32 aColIndex, nscoord aWidth)
-{
-  nsTableFrame* firstInFlow = (nsTableFrame *)GetFirstInFlow();
-  NS_ASSERTION(firstInFlow, "illegal state -- no first in flow");
-
-  if (this == firstInFlow) {
-    nsTableColFrame* colFrame = GetColFrame(aColIndex);
-    if (colFrame) {
-      colFrame->SetFinalWidth(aWidth);
-    }
-    else {
-      NS_ASSERTION(PR_FALSE, "null col frame");
-    }
-  }
-  else {
-    firstInFlow->SetColumnWidth(aColIndex, aWidth);
-  }
-}
-
 // XXX: could cache this.  But be sure to check style changes if you do!
 nscoord nsTableFrame::GetCellSpacingX()
 {
   if (IsBorderCollapse())
     return 0;
 
   return GetStyleTableBorder()->mBorderSpacingX;
 }
@@ -3359,31 +3317,16 @@ nsTableFrame::GetTableFrame(nsIFrame* aS
       }
     }
   }
   NS_NOTREACHED("unable to find table parent");
   return nsnull;
 }
 
 PRBool 
-nsTableFrame::IsAutoWidth(PRBool* aIsPctWidth)
-{
-  const nsStyleCoord& width = GetStylePosition()->mWidth;
-
-  if (aIsPctWidth) {
-    // XXX The old code also made the return value true for 0%, but that
-    // seems silly.
-    *aIsPctWidth = width.GetUnit() == eStyleUnit_Percent &&
-                   width.GetPercentValue() > 0.0f;
-    // Should this handle -moz-available and -moz-fit-content?
-  }
-  return width.GetUnit() == eStyleUnit_Auto;
-}
-
-PRBool 
 nsTableFrame::IsAutoHeight()
 {
   PRBool isAuto = PR_TRUE;  // the default
 
   const nsStylePosition* position = GetStylePosition();
 
   switch (position->mHeight.GetUnit()) {
     case eStyleUnit_Auto:         // specified auto width
@@ -7194,38 +7137,16 @@ PRBool nsTableFrame::RowIsSpannedInto(PR
   nsTableCellMap* cellMap = GetCellMap();
   NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
   if (cellMap) {
     result = cellMap->RowIsSpannedInto(aRowIndex, aNumEffCols);
   }
   return result;
 }
 
-PRBool nsTableFrame::ColHasSpanningCells(PRInt32 aColIndex)
-{
-  PRBool result = PR_FALSE;
-  nsTableCellMap * cellMap = GetCellMap();
-  NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
-  if (cellMap) {
-    result = cellMap->ColHasSpanningCells(aColIndex);
-  }
-  return result;
-}
-
-PRBool nsTableFrame::ColIsSpannedInto(PRInt32 aColIndex)
-{
-  PRBool result = PR_FALSE;
-  nsTableCellMap * cellMap = GetCellMap();
-  NS_PRECONDITION (cellMap, "bad call, cellMap not yet allocated.");
-  if (cellMap) {
-    result = cellMap->ColIsSpannedInto(aColIndex);
-  }
-  return result;
-}
-
 /* static */
 void
 nsTableFrame::InvalidateFrame(nsIFrame* aFrame,
                               const nsRect& aOrigRect,
                               const nsRect& aOrigOverflowRect,
                               PRBool aIsFirstReflow)
 {
   nsIFrame* parent = aFrame->GetParent();
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -235,19 +235,17 @@ public:
                                           nsDisplayTableItem* aDisplayItem,
                                           DisplayGenericTablePartTraversal aTraversal = GenericTraversal);
 
   // Return the closest sibling of aPriorChildFrame (including aPriroChildFrame)
   // of type aChildType.
   static nsIFrame* GetFrameAtOrBefore(nsIFrame*       aParentFrame,
                                       nsIFrame*       aPriorChildFrame,
                                       nsIAtom*        aChildType);
-  PRBool IsAutoWidth(PRBool* aIsPctWidth = nsnull);
   PRBool IsAutoHeight();
-  static PRBool IsPctHeight(nsStyleContext* aStyleContext);
   
   /** @return PR_TRUE if aDisplayType represents a rowgroup of any sort
     * (header, footer, or body)
     */
   PRBool IsRowGroup(PRInt32 aDisplayType) const;
 
   /** Initialize the table frame with a set of children.
     * @see nsIFrame::SetInitialChildList 
@@ -376,19 +374,16 @@ public:
 #ifdef DEBUG
   /** @see nsIFrame::GetFrameName */
   NS_IMETHOD GetFrameName(nsAString& aResult) const;
 #endif
 
   /** return the width of the column at aColIndex    */
   virtual PRInt32 GetColumnWidth(PRInt32 aColIndex);
 
-  /** set the width of the column at aColIndex to aWidth    */
-  virtual void SetColumnWidth(PRInt32 aColIndex, nscoord aWidth);
-
   /** helper to get the cell spacing X style value */
   virtual nscoord GetCellSpacingX();
 
   /** helper to get the cell spacing Y style value */
   virtual nscoord GetCellSpacingY();
  
   virtual nscoord GetBaseline() const;
   /** return the row span of a cell, taking into account row span magic at the bottom
@@ -418,21 +413,16 @@ public:
   virtual PRInt32  GetEffectiveColSpan(const nsTableCellFrame& aCell,
                                        nsCellMap*              aCellMap = nsnull) const;
 
   /** indicate whether the row has more than one cell that either originates
     * or is spanned from the rows above
     */
   PRBool HasMoreThanOneCell(PRInt32 aRowIndex) const;
 
-  /** return the value of the COLS attribute, adjusted for the 
-    * actual number of columns in the table
-    */
-  PRInt32 GetEffectiveCOLSAttribute();
-
   /** return the column frame associated with aColIndex
     * returns nsnull if the col frame has not yet been allocated, or if
     * aColIndex is out of range
     */
   nsTableColFrame* GetColFrame(PRInt32 aColIndex) const;
 
   /** Insert a col frame reference into the colframe cache and adapt the cellmap
     * @param aColFrame    - the column frame
@@ -651,24 +641,16 @@ public:
   // effective columns limits the search up to that column
   PRBool RowIsSpannedInto(PRInt32 aRowIndex, PRInt32 aNumEffCols);
 
   // Returns PR_TRUE if there is a cell originating in aRowIndex
   // which spans into the next row,  the number of effective
   // columns limits the search up to that column
   PRBool RowHasSpanningCells(PRInt32 aRowIndex, PRInt32 aNumEffCols);
 
-  // Returns PR_TRUE if there are any cells to the left of the column at
-  // aColIndex and spanning into the column at aColIndex     
-  PRBool ColIsSpannedInto(PRInt32 aColIndex);
-
-  // Returns PR_TRUE if there is a cell originating in aColIndex
-  // which spans into the next col
-  PRBool ColHasSpanningCells(PRInt32 aColIndex);
-
 protected:
 
   PRBool HaveReflowedColGroups() const;
   void   SetHaveReflowedColGroups(PRBool aValue);
 
 public:
   PRBool IsBorderCollapse() const;
 
--- a/layout/tables/nsTableOuterFrame.cpp
+++ b/layout/tables/nsTableOuterFrame.cpp
@@ -696,81 +696,16 @@ nsTableOuterFrame::SetDesiredSize(PRUint
   }
   else {
     aHeight = NS_MAX(aHeight, captionRect.YMost() + aCaptionMargin.bottom +
                               aInnerMargin.bottom);
   }
 
 }
 
-// XXX This is now unused, but it probably should be used!
-void
-nsTableOuterFrame::BalanceLeftRightCaption(PRUint8         aCaptionSide,
-                                           const nsMargin& aInnerMargin,
-                                           const nsMargin& aCaptionMargin,
-                                           nscoord&        aInnerWidth, 
-                                           nscoord&        aCaptionWidth)
-{
-  
-  /* balance the caption and inner table widths to ensure space for percent widths
-  *  Percent widths for captions or the inner table frame can determine how much of the
-  *  available width is used and how the available width is distributed between those frames
-  *  The inner table frame has already a quite sophisticated treatment of percentage widths 
-  *  (see BasicTableLayoutStrategy.cpp). So it acts as master in the below computations.
-  *  There are four possible scenarios 
-  *  a) None of the frames have a percentage width - then the aInnerWidth and aCaptionwidth will not change
-  *  b) Only the inner frame has a percentage width - this is handled in BasicTableLayoutStrategy.cpp, 
-  *     both widths will not change
-  *  c) Only the caption has a percentage width - then the overall width (ow) will be different depending on
-  *     the caption side. For the left side
-  *     ow = aCaptionMargin.left + aCaptionWidth + aCaptionMargin.right + aInnerwidth + aInnerMargin.right
-  *     aCaptionWidth = capPercent * ow
-  *     solving this equation for aCaptionWidth gives:
-  *     aCaptionWidth = capPercent/(1-capPercent) * 
-  *                      (aCaptionMargin.left + aCaptionMargin.right + aInnerwidth + aInnerMargin.right)
-  *     this result will cause problems for capPercent >= 1, in these cases the algorithm will now bail out
-  *     a similar expression can be found for the right case
-  *  d) both frames have percent widths in this case the caption width will be the inner width multiplied 
-  *     by the weight capPercent/innerPercent
-  */
-    
-
-  float capPercent   = -1.0;
-  float innerPercent = -1.0;
-  const nsStylePosition* position = mCaptionFrame->GetStylePosition();
-  if (eStyleUnit_Percent == position->mWidth.GetUnit()) {
-    capPercent = position->mWidth.GetPercentValue();
-    if (capPercent >= 1.0)
-      return;
-  }
-
-  position = mInnerTableFrame->GetStylePosition();
-  if (eStyleUnit_Percent == position->mWidth.GetUnit()) {
-    innerPercent = position->mWidth.GetPercentValue();
-    if (innerPercent >= 1.0)
-      return;
-  }
-
-  if ((capPercent <= 0.0) && (innerPercent <= 0.0))
-    return;
-
-  
-  if (innerPercent <= 0.0) {
-    if (NS_STYLE_CAPTION_SIDE_LEFT == aCaptionSide) 
-      aCaptionWidth= (nscoord) ((capPercent / (1.0 - capPercent)) * (aCaptionMargin.left + aCaptionMargin.right + 
-                                                          aInnerWidth + aInnerMargin.right));
-    else
-      aCaptionWidth= (nscoord) ((capPercent / (1.0 - capPercent)) * (aCaptionMargin.left + aCaptionMargin.right + 
-                                                          aInnerWidth + aInnerMargin.left)); 
-  } 
-  else {
-    aCaptionWidth = (nscoord) ((capPercent / innerPercent) * aInnerWidth);
-  }
-}
-
 nsresult 
 nsTableOuterFrame::GetCaptionOrigin(PRUint32         aCaptionSide,
                                     const nsSize&    aContainBlockSize,
                                     const nsSize&    aInnerSize, 
                                     const nsMargin&  aInnerMargin,
                                     const nsSize&    aCaptionSize,
                                     nsMargin&        aCaptionMargin,
                                     nsPoint&         aOrigin)
--- a/layout/tables/nsTableOuterFrame.h
+++ b/layout/tables/nsTableOuterFrame.h
@@ -215,22 +215,16 @@ protected:
   PRUint8 GetCaptionVerticalAlign();
 
   void SetDesiredSize(PRUint8         aCaptionSide,
                       const nsMargin& aInnerMargin,
                       const nsMargin& aCaptionMargin,
                       nscoord&        aWidth,
                       nscoord&        aHeight);
 
-  void BalanceLeftRightCaption(PRUint8         aCaptionSide,
-                               const nsMargin& aInnerMargin, 
-                               const nsMargin& aCaptionMargin,
-                               nscoord&        aInnerWidth,
-                               nscoord&        aCaptionWidth);
-
   nsresult   GetCaptionOrigin(PRUint32         aCaptionSide,
                               const nsSize&    aContainBlockSize,
                               const nsSize&    aInnerSize, 
                               const nsMargin&  aInnerMargin,
                               const nsSize&    aCaptionSize,
                               nsMargin&        aCaptionMargin,
                               nsPoint&         aOrigin);
 
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -1690,23 +1690,16 @@ nsTableRowGroupFrame::FindLineContaining
   NS_ENSURE_ARG_POINTER(aFrame);
   
   nsTableRowFrame *rowFrame = do_QueryFrame(aFrame);
   NS_ASSERTION(rowFrame, "RowGroup contains a frame that is not a row");
 
   return rowFrame->GetRowIndex() - GetStartRowIndex();
 }
 
-PRInt32
-nsTableRowGroupFrame::FindLineAt(nscoord  aY)
-{
-  NS_NOTREACHED("Not implemented");
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 #ifdef IBMBIDI
 NS_IMETHODIMP
 nsTableRowGroupFrame::CheckLineOrder(PRInt32                  aLine,
                                      PRBool                   *aIsReordered,
                                      nsIFrame                 **aFirstVisual,
                                      nsIFrame                 **aLastVisual)
 {
   *aIsReordered = PR_FALSE;
--- a/layout/tables/nsTableRowGroupFrame.h
+++ b/layout/tables/nsTableRowGroupFrame.h
@@ -257,21 +257,16 @@ public:
                      PRUint32* aLineFlags);
   
   /** Given a frame that's a child of the rowgroup, find which line its on.
     * @param aFrame       - frame, should be a row
     * @return               row index relative to the row group if this a row
     *                       frame. -1 if the frame cannot be found.
     */
   virtual PRInt32 FindLineContaining(nsIFrame* aFrame);
-  
-  /** not implemented
-    * the function is also not called in our tree
-    */
-  virtual PRInt32 FindLineAt(nscoord aY);
 
   /** Find the orginating cell frame on a row that is the nearest to the
     * coordinate X.
     * @param aLineNumber          - the index of the row relative to the row group
     * @param aX                   - X coordinate in twips relative to the
     *                               origin of the row group
     * @param aFrameFound          - pointer to the cellframe
     * @param aXIsBeforeFirstFrame - the point is before the first originating
--- a/layout/xul/base/src/grid/nsGrid.cpp
+++ b/layout/xul/base/src/grid/nsGrid.cpp
@@ -507,30 +507,16 @@ nsGrid::DirtyRows(nsIBox* aRowBox, nsBox
        if (part) 
           part->DirtyRows(aRowBox, aState);
     }
   }
 
   mMarkingDirty = PR_FALSE;
 }
 
-nsGridRow* nsGrid::GetColumns()
-{
-  RebuildIfNeeded();
-
-  return mColumns;
-}
-
-nsGridRow* nsGrid::GetRows()
-{
-  RebuildIfNeeded();
-
-  return mRows;
-}
-
 nsGridRow*
 nsGrid::GetColumnAt(PRInt32 aIndex, PRBool aIsHorizontal)
 {
   return GetRowAt(aIndex, !aIsHorizontal);
 }
 
 nsGridRow*
 nsGrid::GetRowAt(PRInt32 aIndex, PRBool aIsHorizontal)
--- a/layout/xul/base/src/grid/nsGrid.h
+++ b/layout/xul/base/src/grid/nsGrid.h
@@ -96,18 +96,16 @@ public:
   PRInt32 GetExtraColumnCount(PRBool aIsHorizontal = PR_TRUE);
   PRInt32 GetExtraRowCount(PRBool aIsHorizontal = PR_TRUE);
 
 // accessors
   void SetBox(nsIBox* aBox) { mBox = aBox; }
   nsIBox* GetBox() { return mBox; }
   nsIBox* GetRowsBox() { return mRowsBox; }
   nsIBox* GetColumnsBox() { return mColumnsBox; }
-  nsGridRow* GetColumns();
-  nsGridRow* GetRows();
   PRInt32 GetRowCount(PRInt32 aIsHorizontal = PR_TRUE);
   PRInt32 GetColumnCount(PRInt32 aIsHorizontal = PR_TRUE);
 
   static nsIBox* GetScrolledBox(nsIBox* aChild);
   static nsIBox* GetScrollBox(nsIBox* aChild);
   void GetFirstAndLastRow(nsBoxLayoutState& aState, 
                           PRInt32& aFirstIndex, 
                           PRInt32& aLastIndex, 
--- a/layout/xul/base/src/grid/nsGridRow.cpp
+++ b/layout/xul/base/src/grid/nsGridRow.cpp
@@ -76,30 +76,14 @@ nsGridRow::Init(nsIBox* aBox, PRBool aIs
   mBottomMargin = 0;
 }
 
 nsGridRow::~nsGridRow()
 {
    MOZ_COUNT_DTOR(nsGridRow);
 }
 
-void 
-nsGridRow::MarkDirty(nsBoxLayoutState& aState) 
-{ 
-  mPref = -1;
-  mMin = -1;
-  mMax = -1;
-  mFlex = -1;
-  mTop = -1;
-  mBottom = -1;
-
-  if (mBox) {
-    aState.PresShell()->FrameNeedsReflow(mBox, nsIPresShell::eTreeChange,
-                                         NS_FRAME_IS_DIRTY);
-  }
-}
-
 PRBool 
 nsGridRow::IsCollapsed(nsBoxLayoutState& aState)
 {
   return mBox && mBox->IsCollapsed(aState);
 }
 
--- a/layout/xul/base/src/grid/nsGridRow.h
+++ b/layout/xul/base/src/grid/nsGridRow.h
@@ -55,17 +55,16 @@ class nsBoxLayoutState;
  */
 class nsGridRow
 {
 public:
    nsGridRow();
    ~nsGridRow();
    
    void Init(nsIBox* aBox, PRBool aIsBogus);
-   void MarkDirty(nsBoxLayoutState& aState);
 
 // accessors
    nsIBox* GetBox()   { return mBox;          }
    PRBool IsPrefSet() { return (mPref != -1); }
    PRBool IsMinSet()  { return (mMin  != -1); }
    PRBool IsMaxSet()  { return (mMax  != -1); } 
    PRBool IsFlexSet() { return (mFlex != -1); }
    PRBool IsOffsetSet() { return (mTop != -1 && mBottom != -1); }
--- a/layout/xul/base/src/nsBox.cpp
+++ b/layout/xul/base/src/nsBox.cpp
@@ -405,17 +405,17 @@ nsBox::GetMargin(nsMargin& aMargin)
 void
 nsBox::SizeNeedsRecalc(nsSize& aSize)
 {
   aSize.width  = -1;
   aSize.height = -1;
 }
 
 void
-nsBox::CoordNeedsRecalc(PRInt32& aFlex)
+nsBox::CoordNeedsRecalc(nscoord& aFlex)
 {
   aFlex = -1;
 }
 
 PRBool
 nsBox::DoesNeedRecalc(const nsSize& aSize)
 {
   return (aSize.width == -1 || aSize.height == -1);
@@ -914,22 +914,16 @@ nsIBox::AddCSSFlex(nsBoxLayoutState& aSt
 
 void
 nsBox::AddBorderAndPadding(nsSize& aSize)
 {
   AddBorderAndPadding(this, aSize);
 }
 
 void
-nsBox::AddMargin(nsSize& aSize)
-{
-  AddMargin(this, aSize);
-}
-
-void
 nsBox::AddBorderAndPadding(nsIBox* aBox, nsSize& aSize)
 {
   nsMargin borderPadding(0,0,0,0);
   aBox->GetBorderAndPadding(borderPadding);
   AddMargin(aSize, borderPadding);
 }
 
 void
--- a/layout/xul/base/src/nsBox.h
+++ b/layout/xul/base/src/nsBox.h
@@ -106,17 +106,16 @@ rollbox.
   NS_HIDDEN_(nsresult) SyncLayout(nsBoxLayoutState& aBoxLayoutState);
 
   PRBool DoesNeedRecalc(const nsSize& aSize);
   PRBool DoesNeedRecalc(nscoord aCoord);
   void SizeNeedsRecalc(nsSize& aSize);
   void CoordNeedsRecalc(nscoord& aCoord);
 
   void AddBorderAndPadding(nsSize& aSize);
-  void AddMargin(nsSize& aSize);
 
   static void AddBorderAndPadding(nsIBox* aBox, nsSize& aSize);
   static void AddMargin(nsIBox* aChild, nsSize& aSize);
   static void AddMargin(nsSize& aSize, const nsMargin& aMargin);
 
   static nsSize BoundsCheckMinMax(const nsSize& aMinSize, const nsSize& aMaxSize);
   static nsSize BoundsCheck(const nsSize& aMinSize, const nsSize& aPrefSize, const nsSize& aMaxSize);
   static nscoord BoundsCheck(nscoord aMinSize, nscoord aPrefSize, nscoord aMaxSize);
--- a/layout/xul/base/src/nsBoxFrame.cpp
+++ b/layout/xul/base/src/nsBoxFrame.cpp
@@ -1911,40 +1911,16 @@ nsBoxFrame::RegUnregAccessKey(PRBool aDo
   if (aDoReg)
     rv = esm->RegisterAccessKey(mContent, key);
   else
     rv = esm->UnregisterAccessKey(mContent, key);
 
   return rv;
 }
 
-void
-nsBoxFrame::FireDOMEventSynch(const nsAString& aDOMEventName, nsIContent *aContent)
-{
-  // XXX This will be deprecated, because it is not good to fire synchronous DOM events
-  // from layout. It's better to use nsFrame::FireDOMEvent() which is asynchronous.
-  nsPresContext *presContext = PresContext();
-  nsIContent *content = aContent ? aContent : mContent;
-  if (content && presContext) {
-    // Fire a DOM event
-    nsCOMPtr<nsIDOMEvent> event;
-    if (NS_SUCCEEDED(nsEventDispatcher::CreateEvent(presContext, nsnull,
-                                                    NS_LITERAL_STRING("Events"),
-                                                    getter_AddRefs(event)))) {
-      event->InitEvent(aDOMEventName, PR_TRUE, PR_TRUE);
-
-      nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
-      privateEvent->SetTrusted(PR_TRUE);
-
-      nsEventDispatcher::DispatchDOMEvent(content, nsnull, event,
-                                          presContext, nsnull);
-    }
-  }
-}
-
 PRBool
 nsBoxFrame::SupportsOrdinalsInChildren()
 {
   return PR_TRUE;
 }
 
 static nsIFrame*
 SortedMerge(nsBoxLayoutState& aState, nsIFrame *aLeft, nsIFrame *aRight)
--- a/layout/xul/base/src/nsBoxFrame.h
+++ b/layout/xul/base/src/nsBoxFrame.h
@@ -200,21 +200,16 @@ public:
 #ifdef DEBUG_LAYOUT
     virtual void SetDebugOnChildList(nsBoxLayoutState& aState, nsIBox* aChild, PRBool aDebug);
     nsresult DisplayDebugInfoFor(nsIBox*  aBox, 
                                  nsPoint& aPoint);
 #endif
 
   static nsresult LayoutChildAt(nsBoxLayoutState& aState, nsIBox* aBox, const nsRect& aRect);
 
-  // Fire DOM event. If no aContent argument use frame's mContent.
-  // XXX This will be deprecated, because it is not good to fire synchronous DOM events
-  // from layout. It's better to use nsFrame::FireDOMEvent() which is asynchronous.
-  void FireDOMEventSynch(const nsAString& aDOMEventName, nsIContent *aContent = nsnull);
-
   /**
    * Utility method to redirect events on descendants to this frame.
    * Supports 'allowevents' attribute on descendant elements to allow those
    * elements and their descendants to receive events.
    */
   nsresult WrapListsInRedirector(nsDisplayListBuilder*   aBuilder,
                                  const nsDisplayListSet& aIn,
                                  const nsDisplayListSet& aOut);
--- a/layout/xul/base/src/nsBoxLayout.cpp
+++ b/layout/xul/base/src/nsBoxLayout.cpp
@@ -52,29 +52,16 @@
 #include "nsIFrame.h"
 #include "nsBoxLayout.h"
 
 nsBoxLayout::nsBoxLayout()
 {
 }
 
 void
-nsBoxLayout::GetParentLayout(nsIBox* aBox, nsIBoxLayout** aParent)
-{
-  nsIBox* parent = aBox->GetParentBox();
-  if (parent)
-  {
-    parent->GetLayoutManager(aParent);
-    return;
-  }
-
-  *aParent = nsnull;
-}
-
-void
 nsBoxLayout::AddBorderAndPadding(nsIBox* aBox, nsSize& aSize)
 {
   nsBox::AddBorderAndPadding(aBox, aSize);
 }
 
 void
 nsBoxLayout::AddMargin(nsIBox* aBox, nsSize& aSize)
 {
--- a/layout/xul/base/src/nsBoxLayout.h
+++ b/layout/xul/base/src/nsBoxLayout.h
@@ -59,17 +59,16 @@ public:
                                 nsIBox* aPrevBox,
                                 const nsFrameList::Slice& aNewChildren);
   virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
                                 const nsFrameList::Slice& aNewChildren);
   virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
   virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
   virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState);
 
-  virtual void GetParentLayout(nsIBox* aBox, nsIBoxLayout** aParent);
   virtual void AddBorderAndPadding(nsIBox* aBox, nsSize& aSize);
   virtual void AddMargin(nsIBox* aChild, nsSize& aSize);
   virtual void AddMargin(nsSize& aSize, const nsMargin& aMargin);
 
   static void AddLargestSize(nsSize& aSize, const nsSize& aToAdd);
   static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd);
 };
 
--- a/layout/xul/base/src/nsListBoxBodyFrame.h
+++ b/layout/xul/base/src/nsListBoxBodyFrame.h
@@ -104,17 +104,17 @@ public:
 
   virtual nsSize GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState);
   virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
 
   // size calculation 
   PRInt32 GetRowCount();
   PRInt32 GetRowHeightAppUnits() { return mRowHeight; }
   PRInt32 GetFixedRowSize();
-  void SetRowHeight(PRInt32 aRowHeight);
+  void SetRowHeight(nscoord aRowHeight);
   nscoord GetYPosition();
   nscoord GetAvailableHeight();
   nscoord ComputeIntrinsicWidth(nsBoxLayoutState& aBoxLayoutState);
 
   // scrolling
   nsresult InternalPositionChangedCallback();
   nsresult InternalPositionChanged(PRBool aUp, PRInt32 aDelta);
   // Process pending position changed events, then do the position change.
--- a/layout/xul/base/src/nsMenuFrame.h
+++ b/layout/xul/base/src/nsMenuFrame.h
@@ -118,18 +118,16 @@ public:
   NS_IMETHOD Init(nsIContent*      aContent,
                   nsIFrame*        aParent,
                   nsIFrame*        aPrevInFlow);
 
 #ifdef DEBUG_LAYOUT
   NS_IMETHOD SetDebug(nsBoxLayoutState& aState, PRBool aDebug);
 #endif
 
-  NS_IMETHOD IsActive(PRBool& aResult) { aResult = PR_TRUE; return NS_OK; }
-
   // The following methods are all overridden so that the menupopup
   // can be stored in a separate list, so that it doesn't impact reflow of the
   // actual menu item at all.
   virtual nsFrameList GetChildList(nsIAtom* aListName) const;
   NS_IMETHOD SetInitialChildList(nsIAtom*        aListName,
                                  nsFrameList&    aChildList);
   virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
   virtual void DestroyFrom(nsIFrame* aDestructRoot);