Bug 1348596 - Back out incorrectly-landed (and unreviewed) change to ContinueTextRunAcrossFrames that was mistakenly pushed. r=dbaron
authorJonathan Kew <jkew@mozilla.com>
Mon, 20 Mar 2017 09:44:02 +0000
changeset 348377 40a5fe3da66157a997e6a5f5490e3e0b6baa6cb7
parent 348376 4217af9ee9029b522edef9e213e0e885df91a18f
child 348378 b4e1fb56018bfec49d5ecb03de703b2321c30490
push id88201
push userjkew@mozilla.com
push dateMon, 20 Mar 2017 09:45:25 +0000
treeherdermozilla-inbound@40a5fe3da661 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1348596
milestone55.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 1348596 - Back out incorrectly-landed (and unreviewed) change to ContinueTextRunAcrossFrames that was mistakenly pushed. r=dbaron
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -1780,33 +1780,16 @@ GetSpacingFlags(nsIFrame* aFrame, const 
     (eStyleUnit_Coord == ls.GetUnit() && ls.GetCoordValue() != 0) ||
     (eStyleUnit_Coord == ws.GetUnit() && ws.GetCoordValue() != 0) ||
     (eStyleUnit_Percent == ws.GetUnit() && ws.GetPercentValue() != 0) ||
     (eStyleUnit_Calc == ws.GetUnit() && !ws.GetCalcValue()->IsDefinitelyZero());
 
   return nonStandardSpacing ? gfxTextRunFactory::TEXT_ENABLE_SPACING : 0;
 }
 
-static bool
-IsBaselineAligned(const nsStyleCoord& aCoord)
-{
-  switch (aCoord.GetUnit()) {
-    case eStyleUnit_Enumerated:
-      return aCoord.GetIntValue() == NS_STYLE_VERTICAL_ALIGN_BASELINE;
-    case eStyleUnit_Coord:
-      return aCoord.GetCoordValue() == 0;
-    case eStyleUnit_Percent:
-      return aCoord.GetPercentValue() == 0;
-    case eStyleUnit_Calc:
-      return aCoord.GetCalcValue()->IsDefinitelyZero();
-    default:
-      return false;
-  }
-}
-
 bool
 BuildTextRunsScanner::ContinueTextRunAcrossFrames(nsTextFrame* aFrame1, nsTextFrame* aFrame2)
 {
   // We don't need to check font size inflation, since
   // |FindLineContainer| above (via |nsIFrame::CanContinueTextRun|)
   // ensures that text runs never cross block boundaries.  This means
   // that the font size inflation on all text frames in the text run is
   // already guaranteed to be the same as each other (and for the line
@@ -1826,40 +1809,32 @@ BuildTextRunsScanner::ContinueTextRunAcr
   // here. This avoids creating giant textruns for an entire plain text file.
   // Note that we create a single text frame for a preformatted text node,
   // even if it has newlines in it, so typically we won't see trailing newlines
   // until after reflow has broken up the frame into one (or more) frames per
   // line. That's OK though.
   if (textStyle1->NewlineIsSignificant(aFrame1) && HasTerminalNewline(aFrame1))
     return false;
 
-  if (!IsBaselineAligned(sc1->StyleDisplay()->mVerticalAlign)) {
-    return false;
-  }
-
   if (aFrame1->GetContent() == aFrame2->GetContent() &&
       aFrame1->GetNextInFlow() != aFrame2) {
     // aFrame2 must be a non-fluid continuation of aFrame1. This can happen
     // sometimes when the unicode-bidi property is used; the bidi resolver
     // breaks text into different frames even though the text has the same
     // direction. We can't allow these two frames to share the same textrun
     // because that would violate our invariant that two flows in the same
     // textrun have different content elements.
     return false;
   }
 
   nsStyleContext* sc2 = aFrame2->StyleContext();
   const nsStyleText* textStyle2 = sc2->StyleText();
   if (sc1 == sc2)
     return true;
 
-  if (!IsBaselineAligned(sc1->StyleDisplay()->mVerticalAlign)) {
-    return false;
-  }
-
   const nsStyleFont* fontStyle1 = sc1->StyleFont();
   const nsStyleFont* fontStyle2 = sc2->StyleFont();
   nscoord letterSpacing1 = LetterSpacing(aFrame1);
   nscoord letterSpacing2 = LetterSpacing(aFrame2);
   return fontStyle1->mFont == fontStyle2->mFont &&
     fontStyle1->mLanguage == fontStyle2->mLanguage &&
     textStyle1->mTextTransform == textStyle2->mTextTransform &&
     nsLayoutUtils::GetTextRunFlagsForStyle(sc1, fontStyle1, textStyle1, letterSpacing1) ==