Backout changeset c07445f34e92 (bug 611099, part 1) until bug 668163 is fixed. approval-mozilla-beta=clegnitto
authorL. David Baron <dbaron@dbaron.org>
Wed, 07 Sep 2011 09:20:27 -0700
changeset 76261 8cb916f96ffd
parent 76260 e8378f974c3e
child 76262 2d1e082d176a
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs611099, 668163
milestone8.0
backs outc07445f34e92
Backout changeset c07445f34e92 (bug 611099, part 1) until bug 668163 is fixed. approval-mozilla-beta=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,