Backout Bug 649114 - Reftest failures
authorRobert Longson <longsonr@gmail.com>
Mon, 23 Jan 2012 20:40:09 +0000
changeset 86361 1efdc864bce257b69b8aab23baee4a1a75217f78
parent 86360 886f040f2844f96399ad56e1c793c759bae38d43
child 86362 0049666222dee49144171edc40da978cd78db2ba
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs649114
milestone12.0a1
Backout Bug 649114 - Reftest failures
layout/reftests/svg/reftest.list
layout/svg/base/src/nsSVGAFrame.cpp
layout/svg/base/src/nsSVGGFrame.cpp
layout/svg/base/src/nsSVGTextFrame.cpp
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -95,17 +95,16 @@ include svg-integration/reftest.list
 == dynamic-switch-01.svg pass.svg
 == dynamic-text-01.svg dynamic-text-01-ref.svg
 == dynamic-text-02.svg dynamic-text-02-ref.svg
 == dynamic-text-03.svg dynamic-text-03-ref.svg
 random-if(/^Windows\x20NT\x205\.1/.test(http.oscpu)) == dynamic-text-04.svg dynamic-text-04-ref.svg # bug 421587 for WinXP
 == dynamic-text-05.svg pass.svg
 == dynamic-text-06.svg pass.svg
 == dynamic-text-07.svg dynamic-text-07-ref.svg
-== dynamic-text-08.svg dynamic-text-08-ref.svg
 == dynamic-textPath-01.svg dynamic-textPath-01-ref.svg
 == dynamic-use-01.svg pass.svg
 == dynamic-use-02.svg pass.svg
 == dynamic-use-03.svg pass.svg
 == dynamic-use-04.svg pass.svg
 == dynamic-use-05.svg pass.svg
 random == dynamic-use-nested-01.svg dynamic-use-nested-01-ref.svg # bug 467498
 == dynamic-use-remove-width.svg dynamic-use-remove-width-ref.svg
--- a/layout/svg/base/src/nsSVGAFrame.cpp
+++ b/layout/svg/base/src/nsSVGAFrame.cpp
@@ -133,20 +133,26 @@ nsSVGAFrame::Init(nsIContent* aContent,
 }
 #endif /* DEBUG */
 
 NS_IMETHODIMP
 nsSVGAFrame::AttributeChanged(PRInt32         aNameSpaceID,
                               nsIAtom*        aAttribute,
                               PRInt32         aModType)
 {
-  if (aNameSpaceID == kNameSpaceID_None &&
-      aAttribute == nsGkAtoms::transform) {
+  if (aNameSpaceID != kNameSpaceID_None)
+    return NS_OK;
 
-    NotifySVGChanged(TRANSFORM_CHANGED);
+  if (aAttribute == nsGkAtoms::transform) {
+    // transform has changed
+
+    // make sure our cached transform matrix gets (lazily) updated
+    mCanvasTM = nsnull;
+    
+    nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
   }
 
  return NS_OK;
 }
 
 nsIAtom *
 nsSVGAFrame::GetType() const
 {
--- a/layout/svg/base/src/nsSVGGFrame.cpp
+++ b/layout/svg/base/src/nsSVGGFrame.cpp
@@ -106,14 +106,16 @@ nsSVGGFrame::GetCanvasTM()
 
 NS_IMETHODIMP
 nsSVGGFrame::AttributeChanged(PRInt32         aNameSpaceID,
                               nsIAtom*        aAttribute,
                               PRInt32         aModType)
 {
   if (aNameSpaceID == kNameSpaceID_None &&
       aAttribute == nsGkAtoms::transform) {
+    // make sure our cached transform matrix gets (lazily) updated
+    mCanvasTM = nsnull;
 
-    NotifySVGChanged(TRANSFORM_CHANGED);
+    nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
   }
   
   return NS_OK;
 }
--- a/layout/svg/base/src/nsSVGTextFrame.cpp
+++ b/layout/svg/base/src/nsSVGTextFrame.cpp
@@ -84,18 +84,22 @@ NS_IMETHODIMP
 nsSVGTextFrame::AttributeChanged(PRInt32         aNameSpaceID,
                                  nsIAtom*        aAttribute,
                                  PRInt32         aModType)
 {
   if (aNameSpaceID != kNameSpaceID_None)
     return NS_OK;
 
   if (aAttribute == nsGkAtoms::transform) {
+    // transform has changed
 
-    NotifySVGChanged(TRANSFORM_CHANGED);
+    // make sure our cached transform matrix gets (lazily) updated
+    mCanvasTM = nsnull;
+
+    nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
    
   } else if (aAttribute == nsGkAtoms::x ||
              aAttribute == nsGkAtoms::y ||
              aAttribute == nsGkAtoms::dx ||
              aAttribute == nsGkAtoms::dy ||
              aAttribute == nsGkAtoms::rotate) {
     NotifyGlyphMetricsChange();
   }
@@ -176,40 +180,24 @@ nsSVGTextFrame::GetRotationOfChar(PRUint
 }
 
 //----------------------------------------------------------------------
 // nsISVGChildFrame methods
 
 void
 nsSVGTextFrame::NotifySVGChanged(PRUint32 aFlags)
 {
-  bool updateGlyphMetrics = false;
-  
-  if (aFlags & COORD_CONTEXT_CHANGED) {
-    updateGlyphMetrics = true;
-  }
-
   if (aFlags & TRANSFORM_CHANGED) {
-    if (mCanvasTM && mCanvasTM->IsSingular()) {
-      // We won't have calculated the glyph positions correctly
-      updateGlyphMetrics = true;
-    }
     // make sure our cached transform matrix gets (lazily) updated
     mCanvasTM = nsnull;
   }
 
-  if (updateGlyphMetrics) {
-    // NotifyGlyphMetricsChange will invalidate all children.
-    // No need for them to invalidate themselves
-    aFlags |= SUPPRESS_INVALIDATION;
-  }
-
   nsSVGTextFrameBase::NotifySVGChanged(aFlags);
 
-  if (updateGlyphMetrics) {
+  if (aFlags & COORD_CONTEXT_CHANGED) {
     // If we are positioned using percentage values we need to update our
     // position whenever our viewport's dimensions change.
 
     // XXX We could check here whether the text frame or any of its children
     // have any percentage co-ordinates and only update if they don't. This
     // may not be worth it as we might need to check each glyph
     NotifyGlyphMetricsChange();
   }