Backout changeset c07445f34e92 (bug 611099, part 1) until bug 668163 is fixed. approval-mozilla-aurora=clegnitto
authorL. David Baron <dbaron@dbaron.org>
Fri, 02 Dec 2011 14:32:56 -0800
changeset 80727 5f445a3e6205
parent 80726 9942cb258707
child 80728 dc25872e832d
push id569
push userdbaron@mozilla.com
push dateFri, 02 Dec 2011 22:33:16 +0000
treeherdermozilla-aurora@5f445a3e6205 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs611099, 668163
milestone10.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 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 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 true;
     }
   }
 
   return false;
 }
 
 nsresult
 nsLineLayout::ReflowFrame(nsIFrame* aFrame,