Bug 1116688 - Always try to push children after reflowing an incomplete ruby segment. r=dbaron
authorXidorn Quan <quanxunzhen@gmail.com>
Wed, 07 Jan 2015 12:47:09 +1100
changeset 248160 c1cba30ef56f68e8860581a678acf5af4a6fead5
parent 248159 93ea6d35aa6475e7aa81afa9937b792a49aaaf1e
child 248161 fbb35d6d4151e2f00d65a8ede8cc4f105d9ab165
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1116688
milestone37.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 1116688 - Always try to push children after reflowing an incomplete ruby segment. r=dbaron
layout/generic/nsRubyFrame.cpp
--- a/layout/generic/nsRubyFrame.cpp
+++ b/layout/generic/nsRubyFrame.cpp
@@ -287,17 +287,22 @@ nsRubyFrame::ReflowSegment(nsPresContext
       for (uint32_t i = 0; i < rtcCount; i++) {
         nsIFrame* newTextContainer = CreateNextInFlow(textContainers[i]);
         MOZ_ASSERT(newTextContainer, "Next-in-flow of rtc should not exist "
                    "if the corresponding rbc does not");
         mFrames.RemoveFrame(newTextContainer);
         mFrames.InsertFrame(nullptr, newLastChild, newTextContainer);
         newLastChild = newTextContainer;
       }
-      PushChildren(newBaseContainer, lastChild);
+    }
+    if (lastChild != mFrames.LastChild()) {
+      // Always push the next frame after the last child in this segment.
+      // It is possible that we pulled it back before our next-in-flow
+      // drain our overflow.
+      PushChildren(lastChild->GetNextSibling(), lastChild);
       aReflowState.mLineLayout->SetDirtyNextLine();
     }
   } else {
     // If the ruby base container is reflowed completely, the line
     // layout will remove the next-in-flows of that frame. But the
     // line layout is not aware of the ruby text containers, hence
     // it is necessary to remove them here.
     for (uint32_t i = 0; i < rtcCount; i++) {