Bug 63895 (Part 4) - Propagate overflow of relatively positioned table parts to the table frame. r=dbaron, a=lsblakk
authorSeth Fowler <seth@mozilla.com>
Wed, 19 Mar 2014 11:04:23 +0800
changeset 192270 eef4866eba7b96e8f75dd2bf6fe9bed564a0e401
parent 192269 af2b86deaf5daf393c9101b99f04939442a5785f
child 192271 d4248a320f3efcf0f880c86c606e6bc4a3ae0c63
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, lsblakk
bugs63895
milestone30.0a2
Bug 63895 (Part 4) - Propagate overflow of relatively positioned table parts to the table frame. r=dbaron, a=lsblakk
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -1889,17 +1889,17 @@ nsresult nsTableFrame::Reflow(nsPresCont
   SetColumnDimensions(aDesiredSize.Height(), borderPadding);
   if (NeedToCollapse() &&
       (NS_UNCONSTRAINEDSIZE != aReflowState.AvailableWidth())) {
     AdjustForCollapsingRowsCols(aDesiredSize, borderPadding);
   }
 
   // If there are any relatively-positioned table parts, we need to reflow their
   // absolutely-positioned descendants now that their dimensions are final.
-  FixupPositionedTableParts(aPresContext, aReflowState);
+  FixupPositionedTableParts(aPresContext, aDesiredSize, aReflowState);
 
   // make sure the table overflow area does include the table rect.
   nsRect tableRect(0, 0, aDesiredSize.Width(), aDesiredSize.Height()) ;
 
   if (!ShouldApplyOverflowClipping(this, aReflowState.mStyleDisplay)) {
     // collapsed border may leak out
     nsMargin bcMargin = GetExcludedOuterBCBorder();
     tableRect.Inflate(bcMargin);
@@ -1912,17 +1912,18 @@ nsresult nsTableFrame::Reflow(nsPresCont
   }
 
   FinishAndStoreOverflow(&aDesiredSize);
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
   return rv;
 }
 
 void
-nsTableFrame::FixupPositionedTableParts(nsPresContext* aPresContext,
+nsTableFrame::FixupPositionedTableParts(nsPresContext*           aPresContext,
+                                        nsHTMLReflowMetrics&     aDesiredSize,
                                         const nsHTMLReflowState& aReflowState)
 {
   auto positionedParts =
     static_cast<FrameTArray*>(Properties().Get(PositionedTablePartArray()));
   if (!positionedParts) {
     return;
   }
 
@@ -1960,16 +1961,21 @@ nsTableFrame::FixupPositionedTableParts(
                                                     desiredSize,
                                                     reflowState,
                                                     reflowStatus,
                                                     true);
   }
 
   // Propagate updated overflow areas up the tree.
   overflowTracker.Flush();
+
+  // Update our own overflow areas. (OverflowChangedTracker doesn't update the
+  // subtree root itself.)
+  aDesiredSize.SetOverflowAreasToDesiredBounds();
+  nsLayoutUtils::UnionChildOverflow(this, aDesiredSize.mOverflowAreas);
 }
 
 bool
 nsTableFrame::UpdateOverflow()
 {
   nsRect bounds(nsPoint(0, 0), GetSize());
 
   // As above in Reflow, make sure the table overflow area includes the table
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -567,18 +567,18 @@ protected:
   void AdjustForCollapsingRowsCols(nsHTMLReflowMetrics& aDesiredSize,
                                    nsMargin             aBorderPadding);
 
   /** FixupPositionedTableParts is called at the end of table reflow to reflow
    *  the absolutely positioned descendants of positioned table parts. This is
    *  necessary because the dimensions of table parts may change after they've
    *  been reflowed (e.g. in AdjustForCollapsingRowsCols).
    */
-
-  void FixupPositionedTableParts(nsPresContext* aPresContext,
+  void FixupPositionedTableParts(nsPresContext*           aPresContext,
+                                 nsHTMLReflowMetrics&     aDesiredSize,
                                  const nsHTMLReflowState& aReflowState);
 
   // Clears the list of positioned table parts.
   void ClearAllPositionedTableParts();
 
   nsITableLayoutStrategy* LayoutStrategy() const {
     return static_cast<nsTableFrame*>(FirstInFlow())->
       mTableLayoutStrategy;