Backed out 2 changesets (bug 727125) for reftest bustage on an otherwise CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Mon, 16 Jun 2014 13:34:50 -0700
changeset 188947 275ed6b009f6f8369f029f1310cd77c35ee53c00
parent 188946 e60fc9769bfc1fb0612c76a1c8609921d876b3f2
child 188948 66f9a0038c679179b44f472375f86c827ec52b5b
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs727125
milestone33.0a1
backs out443361e2724ae5dc79a6126a089dd518aa2f3832
16c8d78df86e5bf3cb5c3bd3400c31bf892dd22b
Backed out 2 changesets (bug 727125) for reftest bustage on an otherwise CLOSED TREE Backed out changeset 443361e2724a (bug 727125) Backed out changeset 16c8d78df86e (bug 727125)
layout/base/RestyleManager.cpp
layout/base/RestyleManager.h
layout/base/nsChangeHint.h
layout/generic/nsLineLayout.cpp
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1-ref.html
layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1.html
layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2-ref.html
layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2.html
layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1-ref.html
layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1.html
layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2-ref.html
layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2.html
layout/reftests/text-decoration/reftest.list
layout/style/nsStyleStruct.h
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -508,32 +508,16 @@ RestyleManager::StyleChangeReflow(nsIFra
   do {
     mPresContext->PresShell()->FrameNeedsReflow(aFrame, dirtyType, dirtyBits);
     aFrame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(aFrame);
   } while (aFrame);
 
   return;
 }
 
-void
-RestyleManager::AddSubtreeToOverflowTracker(nsIFrame* aFrame) 
-{
-  mOverflowChangedTracker.AddFrame(
-      aFrame,
-      OverflowChangedTracker::CHILDREN_AND_PARENT_CHANGED);
-  nsIFrame::ChildListIterator lists(aFrame);
-  for (; !lists.IsDone(); lists.Next()) {
-    nsFrameList::Enumerator childFrames(lists.CurrentList());
-    for (; !childFrames.AtEnd(); childFrames.Next()) {
-      nsIFrame* child = childFrames.get();
-      AddSubtreeToOverflowTracker(child);
-    }
-  }
-}
-
 NS_DECLARE_FRAME_PROPERTY(ChangeListProperty, nullptr)
 
 /**
  * Return true if aFrame's subtree has placeholders for out-of-flow content
  * whose 'position' style's bit in aPositionMask is set.
  */
 static bool
 FrameHasPositionedPlaceholderDescendants(nsIFrame* aFrame, uint32_t aPositionMask)
@@ -727,17 +711,16 @@ RestyleManager::ProcessRestyledFrames(ns
              cont = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(cont)) {
           nsSVGEffects::UpdateEffects(cont);
         }
       }
       if (hint & nsChangeHint_NeedReflow) {
         StyleChangeReflow(frame, hint);
         didReflowThisFrame = true;
       }
-
       if (hint & (nsChangeHint_RepaintFrame | nsChangeHint_SyncFrameView |
                   nsChangeHint_UpdateOpacityLayer | nsChangeHint_UpdateTransformLayer |
                   nsChangeHint_ChildrenOnlyTransform)) {
         ApplyRenderingChangeToTree(mPresContext, frame, hint);
       }
       if ((hint & nsChangeHint_RecomputePosition) && !didReflowThisFrame) {
         ActiveLayerTracker::NotifyOffsetRestyle(frame);
         // It is possible for this to fall back to a reflow
@@ -745,21 +728,17 @@ RestyleManager::ProcessRestyledFrames(ns
           didReflowThisFrame = true;
         }
       }
       NS_ASSERTION(!(hint & nsChangeHint_ChildrenOnlyTransform) ||
                    (hint & nsChangeHint_UpdateOverflow),
                    "nsChangeHint_UpdateOverflow should be passed too");
       if (!didReflowThisFrame &&
           (hint & (nsChangeHint_UpdateOverflow |
-                   nsChangeHint_UpdatePostTransformOverflow |
-                   nsChangeHint_UpdateSubtreeOverflow))) {
-        if (hint & nsChangeHint_UpdateSubtreeOverflow) {
-          AddSubtreeToOverflowTracker(frame);
-        }
+                   nsChangeHint_UpdatePostTransformOverflow))) {
         OverflowChangedTracker::ChangeKind changeKind;
         if (hint & nsChangeHint_ChildrenOnlyTransform) {
           // The overflow areas of the child frames need to be updated:
           nsIFrame* hintFrame = GetFrameForChildrenOnlyTransformHint(frame);
           nsIFrame* childFrame = hintFrame->GetFirstPrincipalChild();
           NS_ASSERTION(!nsLayoutUtils::GetNextContinuationOrIBSplitSibling(frame),
                        "SVG frames should not have continuations "
                        "or ib-split siblings");
@@ -785,18 +764,17 @@ RestyleManager::ProcessRestyledFrames(ns
         }
         // If |frame| is dirty or has dirty children, we don't bother updating
         // overflows since that will happen when it's reflowed.
         if (!(frame->GetStateBits() &
               (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN))) {
           // If we have both nsChangeHint_UpdateOverflow and
           // nsChangeHint_UpdatePostTransformOverflow, CHILDREN_AND_PARENT_CHANGED
           // is selected as it is stronger.
-          if (hint & (nsChangeHint_UpdateOverflow | 
-                      nsChangeHint_UpdateSubtreeOverflow)) {
+          if (hint & nsChangeHint_UpdateOverflow) {
             changeKind = OverflowChangedTracker::CHILDREN_AND_PARENT_CHANGED;
           } else {
             changeKind = OverflowChangedTracker::TRANSFORM_CHANGED;
           }
           for (nsIFrame *cont = frame; cont; cont =
                  nsLayoutUtils::GetNextContinuationOrIBSplitSibling(cont)) {
             mOverflowChangedTracker.AddFrame(cont, changeKind);
           }
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -240,19 +240,16 @@ private:
   void RestyleElement(Element*        aElement,
                       nsIFrame*       aPrimaryFrame,
                       nsChangeHint    aMinHint,
                       RestyleTracker& aRestyleTracker,
                       bool            aRestyleDescendants);
 
   void StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint);
 
-  // Recursively add all the given frame and all children to the tracker.
-  void AddSubtreeToOverflowTracker(nsIFrame* aFrame);
-
   // Returns true if this function managed to successfully move a frame, and
   // false if it could not process the position change, and a reflow should
   // be performed instead.
   bool RecomputePosition(nsIFrame* aFrame);
 
 private:
   nsPresContext* mPresContext; // weak, disconnected in Disconnect
 
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -67,72 +67,67 @@ enum nsChangeHint {
   /**
    * Change requires frame change (e.g., display:).
    * This subsumes all the above. Reconstructs all frame descendants,
    * including following placeholders to out-of-flows.
    */
   nsChangeHint_ReconstructFrame = 0x400,
 
   /**
-   * The frame's overflow area has changed. Does not update any descendant
+   * The frame's overflow area has changed, either through a change in its
+   * transform or a change in its position. Does not update any descendant
    * frames.
    */
   nsChangeHint_UpdateOverflow = 0x800,
 
   /**
-   * The overflow area of the frame and all of its descendants has changed. This
-   * can happen through a text-decoration change.   
-   */
-  nsChangeHint_UpdateSubtreeOverflow = 0x1000,
-
-  /**
    * The frame's overflow area has changed, through a change in its transform.
    * Does not update any descendant frames.
    */
-  nsChangeHint_UpdatePostTransformOverflow = 0x2000,
+  nsChangeHint_UpdatePostTransformOverflow = 0x1000,
 
   /**
    * The children-only transform of an SVG frame changed, requiring the
    * overflow rects of the frame's immediate children to be updated.
    */
-  nsChangeHint_ChildrenOnlyTransform = 0x4000,
+  nsChangeHint_ChildrenOnlyTransform = 0x2000,
 
   /**
    * The frame's offsets have changed, while its dimensions might have
    * changed as well.  This hint is used for positioned frames if their
    * offset changes.  If we decide that the dimensions are likely to
    * change, this will trigger a reflow.
    *
    * Note that this should probably be used in combination with
    * nsChangeHint_UpdateOverflow in order to get the overflow areas of
    * the ancestors updated as well.
    */
-  nsChangeHint_RecomputePosition = 0x8000,
+  nsChangeHint_RecomputePosition = 0x4000,
 
   /**
    * Behaves like ReconstructFrame, but only if the frame has descendants
    * that are absolutely or fixed position. Use this hint when a style change
    * has changed whether the frame is a container for fixed-pos or abs-pos
    * elements, but reframing is otherwise not needed.
    */
-  nsChangeHint_AddOrRemoveTransform = 0x10000,
+  nsChangeHint_AddOrRemoveTransform = 0x8000,
 
   /**
    * This change hint has *no* change handling behavior.  However, it
    * exists to be a non-inherited hint, because when the border-style
    * changes, and it's inherited by a child, that might require a reflow
    * due to the border-width change on the child.
    */
-  nsChangeHint_BorderStyleNoneChange = 0x20000,
+  nsChangeHint_BorderStyleNoneChange = 0x10000,
 
   /**
    * SVG textPath needs to be recomputed because the path has changed.
    * This means that the glyph positions of the text need to be recomputed.
    */
-  nsChangeHint_UpdateTextPath = 0x40000
+  nsChangeHint_UpdateTextPath = 0x20000
 
   // IMPORTANT NOTE: When adding new hints, consider whether you need to
   // add them to NS_HintsNotHandledForDescendantsIn() below.
 };
 
 // Redefine these operators to return nothing. This will catch any use
 // of these operators on hints. We should not be using these operators
 // on nsChangeHints
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -726,26 +726,16 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
 
 #ifdef REALLY_NOISY_REFLOW
   nsFrame::IndentBy(stdout, mSpanDepth);
   printf("%p: Begin ReflowFrame pfd=%p ", psd, pfd);
   nsFrame::ListTag(stdout, aFrame);
   printf("\n");
 #endif
 
-  if (mCurrentSpan == mRootSpan) {
-    pfd->mFrame->Properties().Remove(nsIFrame::LineBaselineOffset());
-  } else {
-#ifdef DEBUG
-    bool hasLineOffset;
-    pfd->mFrame->Properties().Get(nsIFrame::LineBaselineOffset(), &hasLineOffset);
-    NS_ASSERTION(!hasLineOffset, "LineBaselineOffset was set but was not expected");
-#endif
-  }
-
   mTextJustificationNumSpaces = 0;
   mTextJustificationNumLetters = 0;
 
   // Stash copies of some of the computed state away for later
   // (block-direction alignment, for example)
   WritingMode frameWM = aFrame->GetWritingMode();
   WritingMode lineWM = mRootSpan->mWritingMode;
 
@@ -1457,16 +1447,32 @@ nsLineLayout::BlockDirAlignLine()
   for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
     if (pfd->mBlockDirAlign == VALIGN_OTHER) {
       pfd->mBounds.BStart(lineWM) += baselineBCoord;
       pfd->mFrame->SetRect(lineWM, pfd->mBounds, mContainerWidth);
     }
   }
   PlaceStartEndFrames(psd, -mBStartEdge, lineBSize);
 
+  // If the frame being reflowed has text decorations, we simulate the
+  // propagation of those decorations to a line-level element by storing the
+  // offset in a frame property on any child frames that are aligned in the
+  // block direction somewhere other than the baseline. This property is then
+  // used by nsTextFrame::GetTextDecorations when the same conditions are met.
+  if (rootPFD.mFrame->StyleContext()->HasTextDecorationLines()) {
+    for (const PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
+      const nsIFrame *const f = pfd->mFrame;
+      if (f->VerticalAlignEnum() != NS_STYLE_VERTICAL_ALIGN_BASELINE) {
+        const nscoord offset = baselineBCoord - pfd->mBounds.BStart(lineWM);
+        f->Properties().Set(nsIFrame::LineBaselineOffset(),
+                            NS_INT32_TO_PTR(offset));
+      }
+    }
+  }
+
   // Fill in returned line-box and max-element-width data
   mLineBox->SetBounds(lineWM,
                       psd->mIStart, mBStartEdge,
                       psd->mICoord - psd->mIStart, lineBSize,
                       mContainerWidth);
 
   mFinalLineBSize = lineBSize;
   mLineBox->SetAscent(baselineBCoord - mBStartEdge);
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -4615,50 +4615,16 @@ PaintSelectionBackground(gfxContext* aCt
   if (aCallbacks) {
     aCallbacks->NotifySelectionBackgroundPathEmitted();
   } else {
     aCtx->SetColor(gfxRGBA(aColor));
     aCtx->Fill();
   }
 }
 
-// Attempt to get the LineBaselineOffset property of aChildFrame
-// If not set, calculate this value for all child frames of aBlockFrame
-static nscoord
-LazyGetLineBaselineOffset(nsIFrame* aChildFrame, nsBlockFrame* aBlockFrame)
-{
-  bool offsetFound;
-  nscoord offset = NS_PTR_TO_INT32(
-    aChildFrame->Properties().Get(nsIFrame::LineBaselineOffset(), &offsetFound)
-    );
-
-  if (!offsetFound) {
-    for (nsBlockFrame::line_iterator line = aBlockFrame->begin_lines(),
-        line_end = aBlockFrame->end_lines();
-        line != line_end; line++) {
-      if (line->IsInline()) {
-        int32_t n = line->GetChildCount();
-        nscoord lineBaseline = line->BStart() + line->GetAscent();
-        for (nsIFrame* lineFrame = line->mFirstChild;
-             n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
-          offset = lineBaseline - lineFrame->GetNormalPosition().y;
-          lineFrame->Properties().Set(nsIFrame::LineBaselineOffset(),
-                                      NS_INT32_TO_PTR(offset));
-        }
-      }
-    }
-    return NS_PTR_TO_INT32(
-    aChildFrame->Properties().Get(nsIFrame::LineBaselineOffset(), &offsetFound)
-    );
-
-  } else {
-    return offset;
-  }
-}
-
 void
 nsTextFrame::GetTextDecorations(
                     nsPresContext* aPresContext,
                     nsTextFrame::TextDecorationColorResolution aColorResolution,
                     nsTextFrame::TextDecorations& aDecorations)
 {
   const nsCompatibility compatMode = aPresContext->CompatibilityMode();
 
@@ -4692,37 +4658,34 @@ nsTextFrame::GetTextDecorations(
         (NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL & textDecorations)) {
       // This handles the <a href="blah.html"><font color="green">La 
       // la la</font></a> case. The link underline should be green.
       useOverride = true;
       overrideColor =
         nsLayoutUtils::GetColor(f, eCSSProperty_text_decoration_color);
     }
 
-    nsBlockFrame* fBlock = nsLayoutUtils::GetAsBlock(f);
-    const bool firstBlock = !nearestBlockFound && fBlock;
+    const bool firstBlock = !nearestBlockFound && nsLayoutUtils::GetAsBlock(f);
 
     // Not updating positions once we hit a parent block is equivalent to
     // the CSS 2.1 spec that blocks should propagate decorations down to their
     // children (albeit the style should be preserved)
     // However, if we're vertically aligned within a block, then we need to
     // recover the right baseline from the line by querying the FrameProperty
     // that should be set (see nsLineLayout::VerticalAlignLine).
     if (firstBlock) {
       // At this point, fChild can't be null since TextFrames can't be blocks
       if (fChild->VerticalAlignEnum() != NS_STYLE_VERTICAL_ALIGN_BASELINE) {
-
         // Since offset is the offset in the child's coordinate space, we have
         // to undo the accumulation to bring the transform out of the block's
         // coordinate space
-        const nscoord lineBaselineOffset = LazyGetLineBaselineOffset(fChild,
-                                                                     fBlock);
-
         baselineOffset =
-          frameTopOffset - fChild->GetNormalPosition().y - lineBaselineOffset;
+          frameTopOffset - fChild->GetNormalPosition().y
+          - NS_PTR_TO_INT32(
+              fChild->Properties().Get(nsIFrame::LineBaselineOffset()));
       }
     }
     else if (!nearestBlockFound) {
       baselineOffset = frameTopOffset - f->GetBaseline();
     }
 
     nearestBlockFound = nearestBlockFound || firstBlock;
     frameTopOffset += f->GetNormalPosition().y;
@@ -4796,31 +4759,31 @@ GetInflationForTextDecorations(nsIFrame*
     return
       static_cast<const SVGTextFrame*>(container)->GetFontSizeScaleFactor();
   }
   return nsLayoutUtils::FontSizeInflationInner(aFrame, aInflationMinFontSize);
 }
 
 void
 nsTextFrame::UnionAdditionalOverflow(nsPresContext* aPresContext,
-                                     nsIFrame* aBlock,
+                                     const nsHTMLReflowState& aBlockReflowState,
                                      PropertyProvider& aProvider,
                                      nsRect* aVisualOverflowRect,
                                      bool aIncludeTextDecorations)
 {
   // Text-shadow overflows
   nsRect shadowRect =
     nsLayoutUtils::GetTextShadowRectsUnion(*aVisualOverflowRect, this);
   aVisualOverflowRect->UnionRect(*aVisualOverflowRect, shadowRect);
 
   if (IsFloatingFirstLetterChild()) {
     // The underline/overline drawable area must be contained in the overflow
     // rect when this is in floating first letter frame at *both* modes.
-    // In this case, aBlock is the ::first-letter frame.
-    uint8_t decorationStyle = aBlock->StyleContext()->
+    nsIFrame* firstLetterFrame = aBlockReflowState.frame;
+    uint8_t decorationStyle = firstLetterFrame->StyleContext()->
                                 StyleTextReset()->GetDecorationStyle();
     // If the style is none, let's include decoration line rect as solid style
     // since changing the style from none to solid/dotted/dashed doesn't cause
     // reflow.
     if (decorationStyle == NS_STYLE_TEXT_DECORATION_STYLE_NONE) {
       decorationStyle = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
     }
     nsFontMetrics* fontMetrics = aProvider.GetFontMetrics();
@@ -4854,17 +4817,17 @@ nsTextFrame::UnionAdditionalOverflow(nsP
     // Since CSS 2.1 requires that text-decoration defined on ancestors maintain
     // style and position, they can be drawn at virtually any y-offset, so
     // maxima and minima are required to reliably generate the rectangle for
     // them
     TextDecorations textDecs;
     GetTextDecorations(aPresContext, eResolvedColors, textDecs);
     if (textDecs.HasDecorationLines()) {
       nscoord inflationMinFontSize =
-        nsLayoutUtils::InflationMinFontSizeFor(aBlock);
+        nsLayoutUtils::InflationMinFontSizeFor(aBlockReflowState.frame);
 
       const nscoord width = GetSize().width;
       const gfxFloat appUnitsPerDevUnit = aPresContext->AppUnitsPerDevPixel(),
                      gfxWidth = width / appUnitsPerDevUnit,
                      ascent = gfxFloat(mAscent) / appUnitsPerDevUnit;
       nscoord top(nscoord_MAX), bottom(nscoord_MIN);
       // Below we loop through all text decorations and compute the rectangle
       // containing all of them, in this frame's coordinate space
@@ -8039,17 +8002,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
   // Handle text that runs outside its normal bounds.
   nsRect boundingBox = RoundOut(textMetrics.mBoundingBox) + nsPoint(0, mAscent);
   aMetrics.SetOverflowAreasToDesiredBounds();
   aMetrics.VisualOverflow().UnionRect(aMetrics.VisualOverflow(), boundingBox);
 
   // When we have text decorations, we don't need to compute their overflow now
   // because we're guaranteed to do it later
   // (see nsLineLayout::RelativePositionFrames)
-  UnionAdditionalOverflow(presContext, aLineLayout.LineContainerRS()->frame,
+  UnionAdditionalOverflow(presContext, *aLineLayout.LineContainerRS(),
                           provider, &aMetrics.VisualOverflow(), false);
 
   /////////////////////////////////////////////////////////////////////
   // Clean up, update state
   /////////////////////////////////////////////////////////////////////
 
   // If all our characters are discarded or collapsed, then trimmable width
   // from the last textframe should be preserved. Otherwise the trimmable width
@@ -8281,17 +8244,17 @@ nsTextFrame::RecomputeOverflow(const nsH
 
   gfxTextRun::Metrics textMetrics =
     mTextRun->MeasureText(provider.GetStart().GetSkippedOffset(),
                           ComputeTransformedLength(provider),
                           gfxFont::LOOSE_INK_EXTENTS, nullptr,
                           &provider);
   nsRect &vis = result.VisualOverflow();
   vis.UnionRect(vis, RoundOut(textMetrics.mBoundingBox) + nsPoint(0, mAscent));
-  UnionAdditionalOverflow(PresContext(), aBlockReflowState.frame, provider,
+  UnionAdditionalOverflow(PresContext(), aBlockReflowState, provider,
                           &vis, true);
   return result;
 }
 static char16_t TransformChar(const nsStyleText* aStyle, gfxTextRun* aTextRun,
                                uint32_t aSkippedOffset, char16_t aChar)
 {
   if (aChar == '\n') {
     return aStyle->NewlineIsSignificant() ? aChar : ' ';
@@ -8572,41 +8535,8 @@ nsTextFrame::HasAnyNoncollapsedCharacter
 {
   gfxSkipCharsIterator iter = EnsureTextRun(nsTextFrame::eInflated);
   int32_t offset = GetContentOffset(),
           offsetEnd = GetContentEnd();
   int32_t skippedOffset = iter.ConvertOriginalToSkipped(offset);
   int32_t skippedOffsetEnd = iter.ConvertOriginalToSkipped(offsetEnd);
   return skippedOffset != skippedOffsetEnd;
 }
-
-bool
-nsTextFrame::UpdateOverflow() 
-{
-  nsRect rect(nsPoint(0, 0), GetSize());
-  nsOverflowAreas overflowAreas(rect, rect);
-
-  if (GetStateBits() & NS_FRAME_FIRST_REFLOW) {
-    return false;
-  }
-  gfxSkipCharsIterator iter = EnsureTextRun(nsTextFrame::eInflated);
-  if (!mTextRun) {
-    return false;
-  }
-  PropertyProvider provider(this, iter, nsTextFrame::eInflated);
-  provider.InitializeForDisplay(true);
-
-  nsIFrame*decorationsBlock;
-  if (IsFloatingFirstLetterChild()) {
-    decorationsBlock = GetParent();
-  } else {
-    for (nsIFrame* f = this; f; f = f->GetParent()) {
-      nsBlockFrame* fBlock = nsLayoutUtils::GetAsBlock(f);
-      if (fBlock) {
-        decorationsBlock = fBlock;
-        break;
-      }
-    }
-  }
-  UnionAdditionalOverflow(PresContext(), decorationsBlock, provider,
-                          &overflowAreas.VisualOverflow(), true);
-  return FinishAndStoreOverflow(overflowAreas, GetSize());
-}
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -514,18 +514,16 @@ public:
 
   // Similar to Reflow(), but for use from nsLineLayout
   void ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
                   nsRenderingContext* aRenderingContext,
                   nsHTMLReflowMetrics& aMetrics, nsReflowStatus& aStatus);
 
   bool IsFloatingFirstLetterChild() const;
 
-  virtual bool UpdateOverflow() MOZ_OVERRIDE;
-
 protected:
   virtual ~nsTextFrame();
 
   nsIFrame*   mNextContinuation;
   // The key invariant here is that mContentOffset never decreases along
   // a next-continuation chain. And of course mContentOffset is always <= the
   // the text node's content length, and the mContentOffset for the first frame
   // is always 0. Furthermore the text mapped by a frame is determined by
@@ -549,17 +547,17 @@ protected:
   virtual bool IsFrameSelected() const MOZ_OVERRIDE;
 
   // The caller of this method must call DestroySelectionDetails() on the
   // return value, if that return value is not null.  Calling
   // DestroySelectionDetails() on a null value is still OK, just not necessary.
   SelectionDetails* GetSelectionDetails();
 
   void UnionAdditionalOverflow(nsPresContext* aPresContext,
-                               nsIFrame* aBlock,
+                               const nsHTMLReflowState& aBlockReflowState,
                                PropertyProvider& aProvider,
                                nsRect* aVisualOverflowRect,
                                bool aIncludeTextDecorations);
 
   void PaintOneShadow(uint32_t aOffset,
                       uint32_t aLength,
                       nsCSSShadowItem* aShadowDetails,
                       PropertyProvider* aProvider,
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1-ref.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-<head>
-<style>
-.underline {
-  text-decoration: underline;
-}
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p class="underline">
-<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
-<span class="align-top">This</span> line has a top vertical align span.
-</p>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html class="reftest-wait">
-<head>
-<script type="text/javascript">
-function addUnderline() {
-  var element = document.getElementById("dynamicUnderline");
-  element.style.textDecoration = "underline";
-  document.documentElement.removeAttribute("class");
-}
-document.addEventListener('MozReftestInvalidate', addUnderline, false);
-</script>
-<style>
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p id="dynamicUnderline">
-<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
-<span class="align-top">This</span> line has a top vertical align span.
-</p>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2-ref.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<html>
-<head>
-<style>
-.underline {
-  text-decoration: underline;
-}
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p class="underline">
-<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
-<span class="align-top">This line has a top vertical align span.</span>
-</p>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<html class="reftest-wait">
-<head>
-<script type="text/javascript">
-function addUnderline() {
-  var element = document.getElementById("dynamicUnderline");
-  element.style.textDecoration = "underline";
-  document.documentElement.removeAttribute("class");
-}
-document.addEventListener('MozReftestInvalidate', addUnderline, false);
-</script>
-<style>
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p id="dynamicUnderline">
-<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
-<span class="align-top">This line has a top vertical align span.</span>
-</p>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1-ref.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-.underline {
-  text-decoration: underline;
-}
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p class="underline">
-<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
-<span class="align-top">This</span> line has a top vertical align span.
-</p>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-<head>
-<script type="text/javascript">
-function addUnderline() {
-  var element = document.getElementById("dynamicUnderline");
-  element.style.textDecoration = "underline";
-  document.documentElement.removeAttribute("class");
-}
-document.addEventListener('MozReftestInvalidate', addUnderline, false);
-</script>
-<style>
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p id="dynamicUnderline">
-<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
-<span class="align-top">This</span> line has a top vertical align span.
-</p>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2-ref.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-.underline {
-  text-decoration: underline;
-}
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p class="underline">
-<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
-<span class="align-top">This line has a top vertical align span.</span>
-</p>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-<head>
-<script type="text/javascript">
-function addUnderline() {
-  var element = document.getElementById("dynamicUnderline");
-  element.style.textDecoration = "underline";
-  document.documentElement.removeAttribute("class");
-}
-document.addEventListener('MozReftestInvalidate', addUnderline, false);
-</script>
-<style>
-.align-bottom {
-  vertical-align: bottom;
-}
-.align-top {
-  vertical-align: top;
-}
-</style>
-</head>
-<body>
-<p id="dynamicUnderline">
-<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
-<span class="align-top">This line has a top vertical align span.</span>
-</p>
-</body>
-</html>
--- a/layout/reftests/text-decoration/reftest.list
+++ b/layout/reftests/text-decoration/reftest.list
@@ -1,18 +1,14 @@
 skip-if(B2G) == complex-decoration-style-quirks.html complex-decoration-style-quirks-ref.html # bug 773482
 skip-if(B2G) == complex-decoration-style-standards.html complex-decoration-style-standards-ref.html # bug 773482
 == decoration-color-quirks.html decoration-color-quirks-ref.html
 == decoration-color-standards.html decoration-color-standards-ref.html
 == decoration-style-quirks.html decoration-style-quirks-ref.html
 == decoration-style-standards.html decoration-style-standards-ref.html
-fuzzy-if(B2G,255,1) == dynamic-underline-vertical-align-quirks-1.html dynamic-underline-vertical-align-quirks-1-ref.html
-fuzzy-if(B2G,255,1) == dynamic-underline-vertical-align-standards-1.html dynamic-underline-vertical-align-standards-1-ref.html
-fuzzy-if(B2G,255,1) == dynamic-underline-vertical-align-quirks-2.html dynamic-underline-vertical-align-quirks-2-ref.html
-fuzzy-if(B2G,255,1) == dynamic-underline-vertical-align-standards-2.html dynamic-underline-vertical-align-standards-2-ref.html
 == line-through-style-block-solid-quirks.html line-through-style-block-quirks-ref.html
 != line-through-style-block-dotted-quirks.html line-through-style-block-quirks-ref.html
 != line-through-style-block-dashed-quirks.html line-through-style-block-quirks-ref.html
 != line-through-style-block-double-quirks.html line-through-style-block-quirks-ref.html
 != line-through-style-block-wavy-quirks.html line-through-style-block-quirks-ref.html
 == line-through-style-inline-solid-quirks.html line-through-style-inline-quirks-ref.html
 != line-through-style-inline-dotted-quirks.html line-through-style-inline-quirks-ref.html
 != line-through-style-inline-dashed-quirks.html line-through-style-inline-quirks-ref.html
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1475,19 +1475,17 @@ struct nsStyleTextReset {
   void SetDecorationColorToForeground()
   {
     mTextDecorationStyle &= ~BORDER_COLOR_SPECIAL;
     mTextDecorationStyle |= BORDER_COLOR_FOREGROUND;
   }
 
   nsChangeHint CalcDifference(const nsStyleTextReset& aOther) const;
   static nsChangeHint MaxDifference() {
-    return nsChangeHint(
-        NS_STYLE_HINT_REFLOW | 
-        nsChangeHint_UpdateSubtreeOverflow);
+    return NS_STYLE_HINT_REFLOW;
   }
   static nsChangeHint MaxDifferenceNeverInherited() {
     // CalcDifference never returns nsChangeHint_NeedReflow or
     // nsChangeHint_ClearAncestorIntrinsics as inherited hints.
     return NS_CombineHint(nsChangeHint_NeedReflow,
                           nsChangeHint_ClearAncestorIntrinsics);
   }