Backout changeset c07445f34e92 (bug 611099, part 1) until bug 668163 is fixed. approval-mozilla-aurora=clegnitto
authorL. David Baron <dbaron@dbaron.org>
Wed, 07 Sep 2011 09:20:27 -0700
changeset 78198 91108b393572
parent 78197 9bad9985b2eb
child 78199 8aa82e4926dc
push id389
push userdbaron@mozilla.com
push dateTue, 27 Sep 2011 23:18:24 +0000
treeherdermozilla-aurora@91108b393572 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs611099, 668163
milestone9.0a2
backs outc07445f34e92
Backout changeset c07445f34e92 (bug 611099, part 1) until bug 668163 is fixed. approval-mozilla-aurora=clegnitto
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;
     }
 
-    // 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;
-      }
+    // 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 PR_FALSE;
 }
 
 nsresult
 nsLineLayout::ReflowFrame(nsIFrame* aFrame,