Backed out changeset a329aa4bc026; r=bustage
authorMs2ger <ms2ger@gmail.com>
Sat, 31 Mar 2012 13:23:37 +0200
changeset 94092 2195f743e7dcb69f975a2b557baacb4d74b98b17
parent 94091 a329aa4bc02608f8eda463dcbddd75f342865f37
child 94093 d151eaf1985c19a1c7aff1c37018de81f7ce72a0
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
milestone14.0a1
backs outa329aa4bc02608f8eda463dcbddd75f342865f37
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset a329aa4bc026; r=bustage
layout/svg/base/src/nsSVGPatternFrame.cpp
layout/svg/crashtests/740627-1.svg
layout/svg/crashtests/740627-2.svg
layout/svg/crashtests/crashtests.list
--- a/layout/svg/base/src/nsSVGPatternFrame.cpp
+++ b/layout/svg/base/src/nsSVGPatternFrame.cpp
@@ -575,25 +575,21 @@ nsSVGPatternFrame::ConstructCTM(const gf
   } else {
     if (targetContent->IsSVG()) {
       ctx = static_cast<nsSVGElement*>(targetContent)->GetCtx();
     }
     float scale = nsSVGUtils::MaxExpansion(callerCTM);
     tCTM.Scale(scale, scale);
   }
 
-  const nsSVGViewBox& viewBox = GetViewBox();
-  if (!viewBox.IsValid()) {
+  const nsSVGViewBoxRect viewBox = GetViewBox().GetAnimValue();
+
+  if (viewBox.height <= 0.0f || viewBox.width <= 0.0f) {
     return tCTM;
   }
-  const nsSVGViewBoxRect viewBoxRect = GetViewBox().GetAnimValue();
-
-  if (viewBoxRect.height <= 0.0f || viewBoxRect.width <= 0.0f) {
-    return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular
-  }
 
   float viewportWidth, viewportHeight;
   if (targetContent->IsSVG()) {
     // If we're dealing with an SVG target only retrieve the context once.
     // Calling the nsIFrame* variant of GetAnimValue would look it up on
     // every call.
     viewportWidth =
       GetLengthValue(nsSVGPatternElement::WIDTH)->GetAnimValue(ctx);
@@ -601,26 +597,21 @@ nsSVGPatternFrame::ConstructCTM(const gf
       GetLengthValue(nsSVGPatternElement::HEIGHT)->GetAnimValue(ctx);
   } else {
     // No SVG target, call the nsIFrame* variant of GetAnimValue.
     viewportWidth =
       GetLengthValue(nsSVGPatternElement::WIDTH)->GetAnimValue(aTarget);
     viewportHeight =
       GetLengthValue(nsSVGPatternElement::HEIGHT)->GetAnimValue(aTarget);
   }
-
-  if (viewportWidth <= 0.0f || viewportHeight <= 0.0f) {
-    return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular
-  }
-
   gfxMatrix tm = nsSVGUtils::GetViewBoxTransform(
     static_cast<nsSVGPatternElement*>(mContent),
     viewportWidth, viewportHeight,
-    viewBoxRect.x, viewBoxRect.y,
-    viewBoxRect.width, viewBoxRect.height,
+    viewBox.x, viewBox.y,
+    viewBox.width, viewBox.height,
     GetPreserveAspectRatio());
 
   return tm * tCTM;
 }
 
 // Given the matrix for the pattern element's own transform, this returns a
 // combined matrix including the transforms applicable to its target.
 gfxMatrix
deleted file mode 100644
--- a/layout/svg/crashtests/740627-1.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <pattern id="test" viewBox="0 0 10 10" height="-65%">
-    <rect/>
-  </pattern>
-  <rect width="100" height="100" fill="url(#test)"/>
-</svg>
deleted file mode 100644
--- a/layout/svg/crashtests/740627-2.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <pattern id="test" viewBox="0 0 10 10" width="-65%">
-    <rect/>
-  </pattern>
-  <rect width="100" height="100" fill="url(#test)"/>
-</svg>
--- a/layout/svg/crashtests/crashtests.list
+++ b/layout/svg/crashtests/crashtests.list
@@ -120,10 +120,8 @@ load 692203-1.svg
 load 692203-2.svg
 load 693424-1.svg
 load 709920-1.svg
 load 709920-2.svg
 load 713413-1.svg
 load 722003-1.svg
 load 725918-1.svg
 load 732836-1.svg
-load 740627-1.svg
-load 740627-2.svg