Bug 1223232 - Use GetUsedBorder() instead of the computed border value when calculating CB size. r=roc
authorMats Palmgren <mats@mozilla.com>
Wed, 11 Nov 2015 22:28:53 +0100
changeset 308444 5e5a5420f0e14cd2a0c298b8970db228d7d2b503
parent 308443 d12f758f5f362ffed1aa195d266289e1ed2a1123
child 308445 81e5c1bef9e33761f7502ee0befce953da367f2a
push id7470
push users.kaspari@gmail.com
push dateThu, 12 Nov 2015 12:51:02 +0000
reviewersroc
bugs1223232
milestone45.0a1
Bug 1223232 - Use GetUsedBorder() instead of the computed border value when calculating CB size. r=roc
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -4609,22 +4609,23 @@ nsFrame::ReflowAbsoluteFrames(nsPresCont
 {
   if (HasAbsolutelyPositionedChildren()) {
     nsAbsoluteContainingBlock* absoluteContainer = GetAbsoluteContainingBlock();
 
     // Let the absolutely positioned container reflow any absolutely positioned
     // child frames that need to be reflowed
 
     // The containing block for the abs pos kids is formed by our padding edge.
-    nsMargin computedBorder =
-      aReflowState.ComputedPhysicalBorderPadding() - aReflowState.ComputedPhysicalPadding();
+    nsMargin usedBorder = GetUsedBorder();
     nscoord containingBlockWidth =
-      aDesiredSize.Width() - computedBorder.LeftRight();
+      aDesiredSize.Width() - usedBorder.LeftRight();
+    MOZ_ASSERT(containingBlockWidth >= 0);
     nscoord containingBlockHeight =
-      aDesiredSize.Height() - computedBorder.TopBottom();
+      aDesiredSize.Height() - usedBorder.TopBottom();
+    MOZ_ASSERT(containingBlockHeight >= 0);
 
     nsContainerFrame* container = do_QueryFrame(this);
     NS_ASSERTION(container, "Abs-pos children only supported on container frames for now");
 
     nsRect containingBlock(0, 0, containingBlockWidth, containingBlockHeight);
     absoluteContainer->Reflow(container, aPresContext, aReflowState, aStatus,
                               containingBlock,
                               aConstrainBSize, true, true, // XXX could be optimized