Bug 1343298 - Remove nsHTMLScrollFrame::ReloadChildFrames() because it's redundant. r=jfkthame
authorMats Palmgren <mats@mozilla.com>
Wed, 01 Mar 2017 18:03:14 +0100
changeset 374559 beca679d682be56233f8ad362ebcf190626be20d
parent 374558 3cf51d656aef11c9a9d2bb8bc91cb08cd4fa7637
child 374560 5c809b2f8930537446845f548626692a9b7caa9e
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1343298
milestone54.0a1
Bug 1343298 - Remove nsHTMLScrollFrame::ReloadChildFrames() because it's redundant. r=jfkthame The scroll frame is almost always the content's primary frame and if so it already has the correct style values and the nsFrame ctor has set mWritingMode correctly based on those. For the edge cases where it's not the primary frame, e.g. <fieldset style=overflow:scroll>, the UA sheet specifies 'inherit' for the relevant properties so it has the correct style values in this case too. MozReview-Commit-ID: 1FMFNfF0IqU
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -152,48 +152,48 @@ nsHTMLScrollFrame::DestroyFrom(nsIFrame*
   nsContainerFrame::DestroyFrom(aDestructRoot);
 }
 
 void
 nsHTMLScrollFrame::SetInitialChildList(ChildListID  aListID,
                                        nsFrameList& aChildList)
 {
   nsContainerFrame::SetInitialChildList(aListID, aChildList);
-  ReloadChildFrames();
+  mHelper.ReloadChildFrames();
 }
 
 
 void
 nsHTMLScrollFrame::AppendFrames(ChildListID  aListID,
                                 nsFrameList& aFrameList)
 {
   NS_ASSERTION(aListID == kPrincipalList, "Only main list supported");
   mFrames.AppendFrames(nullptr, aFrameList);
-  ReloadChildFrames();
+  mHelper.ReloadChildFrames();
 }
 
 void
 nsHTMLScrollFrame::InsertFrames(ChildListID aListID,
                                 nsIFrame* aPrevFrame,
                                 nsFrameList& aFrameList)
 {
   NS_ASSERTION(aListID == kPrincipalList, "Only main list supported");
   NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this,
                "inserting after sibling frame with different parent");
   mFrames.InsertFrames(nullptr, aPrevFrame, aFrameList);
-  ReloadChildFrames();
+  mHelper.ReloadChildFrames();
 }
 
 void
 nsHTMLScrollFrame::RemoveFrame(ChildListID aListID,
                                nsIFrame* aOldFrame)
 {
   NS_ASSERTION(aListID == kPrincipalList, "Only main list supported");
   mFrames.DestroyFrame(aOldFrame);
-  ReloadChildFrames();
+  mHelper.ReloadChildFrames();
 }
 
 nsSplittableType
 nsHTMLScrollFrame::GetSplittableType() const
 {
   return NS_FRAME_NOT_SPLITTABLE;
 }
 
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -1063,24 +1063,16 @@ protected:
   
   /**
    * Override this to return false if computed bsize/min-bsize/max-bsize
    * should NOT be propagated to child content.
    * nsListControlFrame uses this.
    */
   virtual bool ShouldPropagateComputedBSizeToScrolledContent() const { return true; }
 
-  void ReloadChildFrames()
-  {
-    mHelper.ReloadChildFrames();
-    if (mHelper.mScrolledFrame) {
-      mWritingMode = mHelper.mScrolledFrame->GetWritingMode();
-    }
-  }
-
 private:
   friend class mozilla::ScrollFrameHelper;
   ScrollFrameHelper mHelper;
 };
 
 /**
  * The scroll frame creates and manages the scrolling view
  *