Backout d00f9ead1848 (bug 839958) for Windows reftest failure on pattern-content.svg.
authorCameron McCormack <cam@mcc.id.au>
Sun, 19 May 2013 12:50:30 +1000
changeset 143835 82a243758a1d5bb78e9861656e21662f1a638291
parent 143834 9178f40ffa6395e6663b512529a6194df6bbcd0f
child 143836 069ca251c989faa4e14eb77b4c887ef307a710ed
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs839958
milestone24.0a1
backs outd00f9ead1848f879908bf6f355d837bdc8351ced
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
Backout d00f9ead1848 (bug 839958) for Windows reftest failure on pattern-content.svg.
layout/reftests/svg/text/pattern-content-ref.svg
layout/reftests/svg/text/pattern-content.svg
layout/reftests/svg/text/reftest.list
layout/svg/nsSVGTextFrame2.cpp
--- a/layout/reftests/svg/text/pattern-content-ref.svg
+++ b/layout/reftests/svg/text/pattern-content-ref.svg
@@ -5,12 +5,12 @@
 <svg xmlns="http://www.w3.org/2000/svg">
   <defs>
     <pattern id="p2" width="8" height="8" patternUnits="userSpaceOnUse">
       <rect x="-1" y="-1" width="10" height="10" fill="yellow"/>
       <rect width="4" height="4"/>
       <rect x="4" y="4" width="4" height="4"/>
     </pattern>
   </defs>
-  <g transform="scale(2)translate(50,120)scale(4)">
+  <g transform="scale(2,1)translate(50,120)scale(4)">
     <text style="font: bold 48px sans-serif; fill: url(#p2)">a</text>
   </g>
 </svg>
--- a/layout/reftests/svg/text/pattern-content.svg
+++ b/layout/reftests/svg/text/pattern-content.svg
@@ -10,10 +10,10 @@
       <rect x="4" y="4" width="4" height="4"/>
     </pattern>
     <pattern id="p" width="200" height="200" patternUnits="userSpaceOnUse">
       <g transform="translate(50,120)scale(4)">
         <text style="font: bold 48px sans-serif; fill: url(#p2)">a</text>
       </g>
     </pattern>
   </defs>
-  <rect width="200" height="200" fill="url(#p)" transform="scale(2)"/>
+  <rect width="200" height="200" fill="url(#p)" transform="scale(2,1)"/>
 </svg>
--- a/layout/reftests/svg/text/reftest.list
+++ b/layout/reftests/svg/text/reftest.list
@@ -148,24 +148,24 @@ HTTP(../..) == simple-transform-rotate.s
 
 # dynamic document changes
 == dynamic-font-size.svg dynamic-font-size-ref.svg
 == dynamic-dominant-baseline.svg dynamic-dominant-baseline-ref.svg
 == dynamic-multiple-x.svg dynamic-multiple-x-ref.svg
 
 # text and masks
 HTTP(../..) == mask-applied.svg mask-applied-ref.svg
-fails HTTP(../..) == mask-content.svg mask-content-ref.svg  # fails due to invalidation problem - bug 873806
+# HTTP(../..) == mask-content.svg mask-content-ref.svg  # disabled due to infinite invalidation loop bug
 
 # text and clipPaths
 HTTP(../..) == clipPath-applied.svg clipPath-applied-ref.svg
-fails HTTP(../..) == clipPath-content.svg clipPath-content-ref.svg  # fails due to invalidation problem - bug 873806
+# HTTP(../..) == clipPath-content.svg clipPath-content-ref.svg  # disabled due to infinite invalidation loop bug
 
 # text and patterns
-== pattern-content.svg pattern-content-ref.svg
+# == pattern-content.svg pattern-content-ref.svg  # disabled due to infinite invalidation loop bug
 
 # text and filters
 HTTP(../..) == filter-applied.svg filter-applied-ref.svg
 
 # selection
 needs-focus == selectSubString.svg selectSubString-ref.svg
 needs-focus == selectSubString-2.svg selectSubString-2-ref.svg
 needs-focus == selectSubString-3.svg selectSubString-3-ref.svg
--- a/layout/svg/nsSVGTextFrame2.cpp
+++ b/layout/svg/nsSVGTextFrame2.cpp
@@ -4773,56 +4773,43 @@ nsSVGTextFrame2::NotifyGlyphMetricsChang
 
 void
 nsSVGTextFrame2::UpdateGlyphPositioning(bool aForceGlobalTransform)
 {
   nsIFrame* kid = GetFirstPrincipalChild();
   if (!kid)
     return;
 
+  bool needsReflow =
+    (mState & (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN));
+
   NS_ASSERTION(!(kid->GetStateBits() & NS_FRAME_IN_REFLOW),
                "should not be in reflow when about to reflow again");
 
-  if (mState & (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) {
-    if (mState & NS_FRAME_IS_DIRTY) {
-      // If we require a full reflow, ensure our kid is marked fully dirty.
-      // (Note that our anonymous nsBlockFrame is not an nsISVGChildFrame, so
-      // even when we are called via our ReflowSVG this will not be done for us
-      // by nsSVGDisplayContainerFrame::ReflowSVG.)
-      kid->AddStateBits(NS_FRAME_IS_DIRTY);
-    }
+  if (!needsReflow)
+    return;
+
+  if (mState & NS_FRAME_IS_DIRTY) {
+    // If we require a full reflow, ensure our kid is marked fully dirty.
+    kid->AddStateBits(NS_FRAME_IS_DIRTY);
+  }
+
+  if (needsReflow) {
     nsPresContext::InterruptPreventer noInterrupts(PresContext());
     DoReflow(aForceGlobalTransform);
   }
 
-  if (mPositioningDirty) {
-    DoGlyphPositioning();
-  }
+  DoGlyphPositioning();
 }
 
 void
 nsSVGTextFrame2::DoReflow(bool aForceGlobalTransform)
 {
-  // Since we are going to reflow the anonymous block frame, we will
-  // need to update mPositions.
   mPositioningDirty = true;
 
-  if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
-    // Normally, this flag would be cleared in ReflowSVG(), but that doesn't
-    // get called for non-display frames. We don't want to reflow our
-    // descendants every time nsSVGTextFrame2::PaintSVG makes sure that we have
-    // valid positions by calling UpdateGlyphPositioning(), so we need to clear
-    // these dirty bits. Note that this also breaks an invalidation loop where
-    // our descendants invalidate as they reflow, which invalidates rendering
-    // observers, which reschedules the frame that is currently painting by
-    // referencing us to paint again. See bug 839958 comment 7. Hopefully we
-    // will break that loop more convincingly at some point.
-    mState &= ~(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN);
-  }
-
   nsPresContext *presContext = PresContext();
   nsIFrame* kid = GetFirstPrincipalChild();
   if (!kid)
     return;
 
   nsIPresShell* presShell = presContext->PresShell();
   NS_ASSERTION(presShell, "null presShell");
   nsRefPtr<nsRenderingContext> renderingContext =