And merge them from Aurora 9 to Aurora 10.
authorL. David Baron <dbaron@dbaron.org>
Fri, 02 Dec 2011 14:29:18 -0800
changeset 5 57b9b6a35ded
parent 4 7ed4f55aff84
child 6 e0d3d285fe19
push id3
push userdbaron@mozilla.com
push dateFri, 02 Dec 2011 22:30:17 +0000
And merge them from Aurora 9 to Aurora 10.
b1
b2
b3
--- a/b1
+++ b/b1
@@ -1,69 +1,69 @@
 # HG changeset patch
 # User L. David Baron <dbaron@dbaron.org>
 # Date 1315412426 25200
 # Node ID d6c48e7f9b9d5ff5a8ff3f592eb6a65e2d5efedf
-# Parent  2b4f99e468aa1dadce226c880f6415b2879ab842
+# Parent b2cdeab583f605be4953bd6d4d65a317f580c969
 Backout changeset 3af9fed4e33a (bug 611099, part 3) until bug 668163 is fixed.  approval-mozilla-aurora=clegnitto
 
 diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
 --- a/layout/base/nsLayoutUtils.cpp
 +++ b/layout/base/nsLayoutUtils.cpp
 @@ -2638,36 +2638,36 @@ nsLayoutUtils::ComputeSizeWithIntrinsicD
    // Resolve percentage intrinsic width/height as necessary:
  
    NS_ASSERTION(aCBSize.width != NS_UNCONSTRAINEDSIZE,
                 "Our containing block must not have unconstrained width!");
  
-   PRBool hasIntrinsicWidth, hasIntrinsicHeight;
+   bool hasIntrinsicWidth, hasIntrinsicHeight;
    nscoord intrinsicWidth, intrinsicHeight;
  
 -  if (aIntrinsicSize.width.GetUnit() == eStyleUnit_Coord) {
 +  if (aIntrinsicSize.width.GetUnit() == eStyleUnit_Coord ||
 +      aIntrinsicSize.width.GetUnit() == eStyleUnit_Percent) {
-     hasIntrinsicWidth = PR_TRUE;
+     hasIntrinsicWidth = true;
 -    intrinsicWidth = aIntrinsicSize.width.GetCoordValue();
 -    if (intrinsicWidth < 0)
 -      intrinsicWidth = 0;
 +    intrinsicWidth = nsLayoutUtils::ComputeWidthValue(aRenderingContext,
 +                           aFrame, aCBSize.width, 0, boxSizingAdjust.width +
 +                           boxSizingToMarginEdgeWidth, aIntrinsicSize.width);
    } else {
 -    NS_ASSERTION(aIntrinsicSize.width.GetUnit() == eStyleUnit_None,
 -                 "unexpected unit");
-     hasIntrinsicWidth = PR_FALSE;
+     hasIntrinsicWidth = false;
      intrinsicWidth = 0;
    }
  
 -  if (aIntrinsicSize.height.GetUnit() == eStyleUnit_Coord) {
 +  if (aIntrinsicSize.height.GetUnit() == eStyleUnit_Coord ||
 +      (aIntrinsicSize.height.GetUnit() == eStyleUnit_Percent &&
 +       aCBSize.height != NS_AUTOHEIGHT)) {
-     hasIntrinsicHeight = PR_TRUE;
+     hasIntrinsicHeight = true;
 -    intrinsicHeight = aIntrinsicSize.height.GetCoordValue();
 +    intrinsicHeight = nsLayoutUtils::
 +      ComputeHeightDependentValue(aCBSize.height, aIntrinsicSize.height);
      if (intrinsicHeight < 0)
        intrinsicHeight = 0;
    } else {
 -    NS_ASSERTION(aIntrinsicSize.height.GetUnit() == eStyleUnit_None,
 -                 "unexpected unit");
-     hasIntrinsicHeight = PR_FALSE;
+     hasIntrinsicHeight = false;
      intrinsicHeight = 0;
    }
  
    NS_ASSERTION(aIntrinsicRatio.width >= 0 && aIntrinsicRatio.height >= 0,
                 "Intrinsic ratio has a negative component!");
  
    // Now calculate the used values for width and height:
 diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp
 --- a/layout/generic/nsHTMLReflowState.cpp
 +++ b/layout/generic/nsHTMLReflowState.cpp
-@@ -400,17 +400,19 @@ nsHTMLReflowState::InitResizeFlags(nsPre
+@@ -391,17 +391,19 @@ nsHTMLReflowState::InitResizeFlags(nsPre
      (mStylePosition->MinHeightDependsOnContainer() &&
       // FIXME: condition this on not-abspos?
       mStylePosition->mMinHeight.GetUnit() != eStyleUnit_Auto) ||
      (mStylePosition->MaxHeightDependsOnContainer() &&
       // FIXME: condition this on not-abspos?
       mStylePosition->mMaxHeight.GetUnit() != eStyleUnit_Auto) ||
      mStylePosition->OffsetHasPercent(NS_SIDE_TOP) ||
      mStylePosition->mOffset.GetBottomUnit() != eStyleUnit_Auto ||
@@ -77,17 +77,17 @@ diff --git a/layout/generic/nsHTMLReflow
                   NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT,
                   "bad line-height value");
  
      // line-height depends on block height
      frame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_HEIGHT);
 diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h
 --- a/layout/generic/nsIFrame.h
 +++ b/layout/generic/nsIFrame.h
-@@ -1577,19 +1577,20 @@ public:
+@@ -1590,19 +1590,20 @@ public:
        , hPctPadding(0.0f), hPctMargin(0.0f)
      {}
    };
    virtual IntrinsicWidthOffsetData
      IntrinsicWidthOffsets(nsRenderingContext* aRenderingContext) = 0;
  
    /*
     * For replaced elements only. Gets the intrinsic dimensions of this element.
--- a/b2
+++ b/b2
@@ -1,13 +1,13 @@
 # HG changeset patch
 # User L. David Baron <dbaron@dbaron.org>
 # Date 1315412427 25200
 # Node ID 9bad9985b2eb87424ca57d6cf8cef2d8dbd9f4c5
-# Parent  d6c48e7f9b9d5ff5a8ff3f592eb6a65e2d5efedf
+# Parent 774b85ea434515f775c2b1dec40fab676749c194
 Backout changeset 58fe3ede72f8 (bug 611099, part 2) until bug 668163 is fixed.  approval-mozilla-aurora=clegnitto
 
 diff --git a/layout/reftests/svg/as-image/img-novb-height-all-1-ref.html b/layout/reftests/svg/as-image/img-novb-height-all-1-ref.html
 --- a/layout/reftests/svg/as-image/img-novb-height-all-1-ref.html
 +++ b/layout/reftests/svg/as-image/img-novb-height-all-1-ref.html
 @@ -13,25 +13,25 @@
          meetOrSlice: null // This means "use pAR=none"
        };
@@ -617,17 +617,17 @@ diff --git a/layout/svg/base/src/nsSVGOu
    return intrinsicSize;
  }
  
 @@ -306,62 +314,26 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
  /* virtual */ nsSize
  nsSVGOuterSVGFrame::ComputeSize(nsRenderingContext *aRenderingContext,
                                  nsSize aCBSize, nscoord aAvailableWidth,
                                  nsSize aMargin, nsSize aBorder, nsSize aPadding,
-                                 PRBool aShrinkWrap)
+                                 bool aShrinkWrap)
  {
    nsSVGSVGElement* content = static_cast<nsSVGSVGElement*>(mContent);
  
 -  IntrinsicSize intrinsicSize = GetIntrinsicSize();
 -
 -  if (!mContent->GetParent()) {
 -    if (IsRootOfImage() || IsRootOfReplacedElementSubDoc()) {
 -      // The embedding element has done the replaced element sizing,
@@ -647,18 +647,18 @@ diff --git a/layout/svg/base/src/nsSVGOu
 -                          "intrinsic width");
 -        float val = width.GetAnimValInSpecifiedUnits() / 100.0f;
 -        if (val < 0.0f) val = 0.0f;
 -        intrinsicSize.width.SetCoordValue(val * aCBSize.width);
 -      }
 -
 -      nsSVGLength2 &height =
 -        content->mLengthAttributes[nsSVGSVGElement::HEIGHT];
--      NS_ABORT_IF_FALSE(aCBSize.height != NS_AUTOHEIGHT,
--                        "root should not have auto-height containing block");
+-      NS_ASSERTION(aCBSize.height != NS_AUTOHEIGHT,
+-                   "root should not have auto-height containing block");
 -      if (height.IsPercentage()) {
 -        NS_ABORT_IF_FALSE(intrinsicSize.height.GetUnit() == eStyleUnit_None,
 -                          "GetIntrinsicSize should have reported no "
 -                          "intrinsic height");
 -        float val = height.GetAnimValInSpecifiedUnits() / 100.0f;
 -        if (val < 0.0f) val = 0.0f;
 -        intrinsicSize.height.SetCoordValue(val * aCBSize.height);
 -      }
--- a/b3
+++ b/b3
@@ -1,51 +1,51 @@
 # HG changeset patch
 # User L. David Baron <dbaron@dbaron.org>
 # Date 1315412427 25200
 # Node ID 91108b3935720f0f18ec9d9a2fadf6ab9725e302
-# Parent  9bad9985b2eb87424ca57d6cf8cef2d8dbd9f4c5
+# Parent e6f4b9a969e5718105fd37cfffe747d82be2d546
 Backout changeset c07445f34e92 (bug 611099, part 1) until bug 668163 is fixed.  approval-mozilla-aurora=clegnitto
 
 diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp
 --- a/layout/generic/nsLineLayout.cpp
 +++ b/layout/generic/nsLineLayout.cpp
 @@ -700,32 +700,24 @@ IsPercentageAware(const nsIFrame* aFrame
          disp->mDisplay == NS_STYLE_DISPLAY_INLINE_TABLE ||
          fType == nsGkAtoms::HTMLButtonControlFrame ||
          fType == nsGkAtoms::gfxButtonControlFrame ||
          fType == nsGkAtoms::fieldSetFrame ||
          fType == nsGkAtoms::comboboxDisplayFrame) {
-       return PR_TRUE;
+       return true;
      }
  
 -    // Per CSS 2.1, section 10.3.2:
 -    //   If 'height' and 'width' both have computed values of 'auto' and
 -    //   the element has an intrinsic ratio but no intrinsic height or
 -    //   width and the containing block's width does not itself depend
 -    //   on the replaced element's width, then the used value of 'width'
 -    //   is calculated from the constraint equation used for
 -    //   block-level, non-replaced elements in normal flow. 
 -    nsIFrame *f = const_cast<nsIFrame*>(aFrame);
 -    if (f->GetIntrinsicRatio() != nsSize(0, 0) &&
 -        // Some percents are treated like 'auto', so check != coord
 -        pos->mHeight.GetUnit() != eStyleUnit_Coord) {
 -      const nsIFrame::IntrinsicSize &intrinsicSize = f->GetIntrinsicSize();
 -      if (intrinsicSize.width.GetUnit() == eStyleUnit_None &&
 -          intrinsicSize.height.GetUnit() == eStyleUnit_None) {
--        return PR_TRUE;
+-        return true;
 -      }
 +    // Handle SVG, which doesn't map width/height into style
 +    if ((
 +         fType == nsGkAtoms::svgOuterSVGFrame ||
 +         fType == nsGkAtoms::imageFrame ||
 +         fType == nsGkAtoms::subDocumentFrame) &&
 +        const_cast<nsIFrame*>(aFrame)->GetIntrinsicSize().width.GetUnit() ==
 +        eStyleUnit_Percent) {
-+      return PR_TRUE;
++      return true;
      }
    }
  
-   return PR_FALSE;
+   return false;
  }
  
  nsresult
  nsLineLayout::ReflowFrame(nsIFrame* aFrame,