Bug 1135432 - Suppress line break after text run which ends in ruby. r=jfkthame
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 23 Feb 2015 08:55:04 +1100
changeset 247761 f4b96c24feced2848c51a38c12fff2e317fb9bd4
parent 247760 21e812742b52d06aa5e17a8a3510b84009517018
child 247762 68277ab46641801fec72045026eb20de06e8dbb1
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1135432
milestone38.0a1
Bug 1135432 - Suppress line break after text run which ends in ruby. r=jfkthame
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -8519,16 +8519,17 @@ nsTextFrame::ReflowText(nsLineLayout& aL
     aLineLayout.NotifyOptionalBreakPosition(this, length, fits,
                                             gfxBreakPriority::eNormalBreak);
   }
   bool breakAfter = forceBreakAfter;
   // length == 0 means either the text is empty or it's all collapsed away
   bool emptyTextAtStartOfLine = atStartOfLine && length == 0;
   if (!breakAfter && charsFit == length && !emptyTextAtStartOfLine &&
       transformedOffset + transformedLength == mTextRun->GetLength() &&
+      !StyleContext()->IsInlineDescendantOfRuby() &&
       (mTextRun->GetFlags() & nsTextFrameUtils::TEXT_HAS_TRAILING_BREAK)) {
     // We placed all the text in the textrun and we have a break opportunity at
     // the end of the textrun. We need to record it because the following
     // content may not care about nsLineBreaker.
 
     // Note that because we didn't break, we can be sure that (thanks to the
     // code up above) textMetrics.mAdvanceWidth includes the width of any
     // trailing whitespace. So we need to subtract trimmableWidth here