Bug 842138 - Propagate rotate="" values even if rotations were specified on a parent element. r=roc
authorCameron McCormack <cam@mcc.id.au>
Tue, 19 Feb 2013 10:44:26 +1100
changeset 132162 412fa61ea374c3b7a5619874178f8784aaba40b6
parent 132161 ea99e1b1d574bbd05b5428d5194ceaea506e2caa
child 132163 5060a8ce0be450649a5ef4a8163c3eab701bcdc4
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs842138
milestone21.0a1
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
Bug 842138 - Propagate rotate="" values even if rotations were specified on a parent element. r=roc
layout/reftests/svg/reftest.list
layout/reftests/svg/text-layout-08-ref.svg
layout/reftests/svg/text-layout-08.svg
layout/svg/nsSVGTextFrame2.cpp
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -282,16 +282,17 @@ skip-if(B2G) != text-language-00.xhtml t
 skip-if(B2G) random-if(gtk2Widget) != text-language-01.xhtml text-language-01-ref.xhtml # Fails on Linux tryserver due to lack of CJK fonts.
 fuzzy-if(OSX==10.7,6,2) fuzzy-if(OSX==10.8,46,26) == text-layout-01.svg text-layout-01-ref.svg
 == text-layout-02.svg text-layout-02-ref.svg
 == text-layout-03.svg text-layout-03-ref.svg
 == text-layout-04.svg text-layout-04-ref.svg
 == text-layout-05.svg text-layout-05-ref.svg
 fuzzy-if(cocoaWidget&&layersGPUAccelerated,1,3) == text-layout-06.svg text-layout-06-ref.svg
 == text-layout-07.svg text-layout-07-ref.svg
+pref(svg.text.css-frames.enabled,true) == text-layout-08.svg text-layout-08-ref.svg
 == text-scale-01.svg text-scale-01-ref.svg
 HTTP(..) == text-scale-02.svg text-scale-02-ref.svg
 HTTP(..) == text-scale-03.svg text-scale-03-ref.svg
 == text-stroke-scaling-01.svg text-stroke-scaling-01-ref.svg
 == stroke-dasharray-and-pathLength-01.svg pass.svg
 == stroke-dasharray-and-text-01.svg stroke-dasharray-and-text-01-ref.svg 
 == stroke-linecap-square-w-zero-length-segs-01.svg pass.svg
 == stroke-linecap-square-w-zero-length-segs-02.svg pass.svg
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/text-layout-08-ref.svg
@@ -0,0 +1,7 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg xmlns="http://www.w3.org/2000/svg">
+  <text x="100" y="100" rotate="-10 -10 10 10 10" style="font: 48px sans-serif">A B C</text>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/text-layout-08.svg
@@ -0,0 +1,10 @@
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<svg xmlns="http://www.w3.org/2000/svg">
+  <text x="100" y="100" rotate="-10 -10 -10 -10 -10" style="font: 48px sans-serif">
+    A 
+    <tspan rotate="10">B C</tspan>
+  </text>
+</svg>
--- a/layout/svg/nsSVGTextFrame2.cpp
+++ b/layout/svg/nsSVGTextFrame2.cpp
@@ -3964,19 +3964,17 @@ nsSVGTextFrame2::ResolvePositions(nsICon
         if (!mPositions[aIndex + j].mUnaddressable) {
           mPositions[aIndex + j].mAngle = M_PI * (*rotate)[i] / 180.0;
           i++;
         }
         j++;
       }
       // Propagate final rotate="" value to the end of this element.
       while (j < count) {
-        if (!mPositions[aIndex + j].IsAngleSpecified()) {
-          mPositions[aIndex + j].mAngle = mPositions[aIndex + j - 1].mAngle;
-        }
+        mPositions[aIndex + j].mAngle = mPositions[aIndex + j - 1].mAngle;
         j++;
       }
     }
   }
 
   // Recurse to children.
   bool inTextPath = aInTextPath || aContent->Tag() == nsGkAtoms::textPath;
   for (nsIContent* child = aContent->GetFirstChild();