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 73134 9b664712d5f4397ad1674519d95b851500c9a2bf
parent 73133 e02f6a872b6001410562dfce636140c1d040010b
child 73135 922315e4df836b1d2eefd9dda9cfd58646917a73
push id212
push userdbaron@mozilla.com
push dateWed, 07 Sep 2011 16:22:35 +0000
treeherdermozilla-beta@9b664712d5f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs611099, 668163
milestone7.0
backs outc07445f34e926477e6c61885b2781d8922a898d9
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
@@ -698,32 +698,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,