Remove no-longer-needed code for handling unconstrained containing block widths. (Bug 585715) r=bzbarsky a2.0=blocking+
authorL. David Baron <dbaron@dbaron.org>
Tue, 31 Aug 2010 12:05:12 -0400
changeset 51774 9dc831f46e4c35269c14848982b5206e1197b8eb
parent 51773 400bc943fcf798125e9ed9b7673d1941a39df864
child 51775 253d994413d97700dbea2bd165146a81c2615812
push id15424
push userdbaron@mozilla.com
push dateTue, 31 Aug 2010 16:05:34 +0000
treeherdermozilla-central@4edcf6c4cd03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs585715
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Remove no-longer-needed code for handling unconstrained containing block widths. (Bug 585715) r=bzbarsky a2.0=blocking+
layout/generic/nsHTMLReflowState.cpp
--- a/layout/generic/nsHTMLReflowState.cpp
+++ b/layout/generic/nsHTMLReflowState.cpp
@@ -606,27 +606,16 @@ nsHTMLReflowState::ComputeRelativeOffset
                                           nsPresContext* aPresContext)
 {
   // Compute the 'left' and 'right' values. 'Left' moves the boxes to the right,
   // and 'right' moves the boxes to the left. The computed values are always:
   // left=-right
   PRBool  leftIsAuto = eStyleUnit_Auto == mStylePosition->mOffset.GetLeftUnit();
   PRBool  rightIsAuto = eStyleUnit_Auto == mStylePosition->mOffset.GetRightUnit();
 
-  // Check for percentage based values and an unconstrained containing
-  // block width. Treat them like 'auto'
-  if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) {
-    if (mStylePosition->OffsetHasPercent(NS_SIDE_LEFT)) {
-      leftIsAuto = PR_TRUE;
-    }
-    if (mStylePosition->OffsetHasPercent(NS_SIDE_RIGHT)) {
-      rightIsAuto = PR_TRUE;
-    }
-  }
-
   // If neither 'left' not 'right' are auto, then we're over-constrained and
   // we ignore one of them
   if (!leftIsAuto && !rightIsAuto) {
     if (mCBReflowState &&
         NS_STYLE_DIRECTION_RTL == mCBReflowState->mStyleVisibility->mDirection) {
       leftIsAuto = PR_TRUE;
     } else {
       rightIsAuto = PR_TRUE;
@@ -2158,35 +2147,22 @@ nsHTMLReflowState::CalcLineHeight(nsStyl
 
 void
 nsCSSOffsetState::ComputeMargin(nscoord aContainingBlockWidth)
 {
   // If style style can provide us the margin directly, then use it.
   const nsStyleMargin *styleMargin = frame->GetStyleMargin();
   if (!styleMargin->GetMargin(mComputedMargin)) {
     // We have to compute the value
-    if (NS_UNCONSTRAINEDSIZE == aContainingBlockWidth) {
-      mComputedMargin.left = 0;
-      mComputedMargin.right = 0;
-
-      if (eStyleUnit_Coord == styleMargin->mMargin.GetLeftUnit()) {
-        mComputedMargin.left = styleMargin->mMargin.GetLeft().GetCoordValue();
-      }
-      if (eStyleUnit_Coord == styleMargin->mMargin.GetRightUnit()) {
-        mComputedMargin.right = styleMargin->mMargin.GetRight().GetCoordValue();
-      }
-
-    } else {
-      mComputedMargin.left = nsLayoutUtils::
-        ComputeWidthDependentValue(aContainingBlockWidth,
-                                   styleMargin->mMargin.GetLeft());
-      mComputedMargin.right = nsLayoutUtils::
-        ComputeWidthDependentValue(aContainingBlockWidth,
-                                   styleMargin->mMargin.GetRight());
-    }
+    mComputedMargin.left = nsLayoutUtils::
+      ComputeWidthDependentValue(aContainingBlockWidth,
+                                 styleMargin->mMargin.GetLeft());
+    mComputedMargin.right = nsLayoutUtils::
+      ComputeWidthDependentValue(aContainingBlockWidth,
+                                 styleMargin->mMargin.GetRight());
 
     // According to the CSS2 spec, margin percentages are
     // calculated with respect to the *width* of the containing
     // block, even for margin-top and margin-bottom.
     // XXX This isn't true for page boxes, if we implement them.
     mComputedMargin.top = nsLayoutUtils::
       ComputeWidthDependentValue(aContainingBlockWidth,
                                  styleMargin->mMargin.GetTop());