Bug 410857 - Part 1: Traverse overflow lines too so we don't miss some text. r=jfkthame, a=jcristau
authorMats Palmgren <mats@mozilla.com>
Mon, 20 Feb 2017 17:43:08 +0100
changeset 376327 485a44ead9f48a6013a4ecd86598a9691955aad2
parent 376326 3cd7637cb8733d8b08e15b387c8bafcd6e2a4999
child 376328 d83db77b92f8a8160feb9b1e8c4e4ad88994f688
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, jcristau
bugs410857
milestone53.0a2
Bug 410857 - Part 1: Traverse overflow lines too so we don't miss some text. r=jfkthame, a=jcristau
layout/base/nsBidiPresUtils.cpp
layout/generic/nsBlockFrame.h
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -690,17 +690,21 @@ nsBidiPresUtils::Resolve(nsBlockFrame* a
     bpd.PushBidiControl(ch);
   }
   for (nsBlockFrame* block = aBlockFrame; block;
        block = static_cast<nsBlockFrame*>(block->GetNextContinuation())) {
     block->RemoveStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
     nsBlockInFlowLineIterator lineIter(block, block->LinesBegin());
     bpd.mPrevFrame = nullptr;
     TraverseFrames(aBlockFrame, &lineIter, block->PrincipalChildList().FirstChild(), &bpd);
-    // XXX what about overflow lines?
+    nsBlockFrame::FrameLines* overflowLines = block->GetOverflowLines();
+    if (overflowLines) {
+      nsBlockInFlowLineIterator lineIter(block, overflowLines->mLines.begin(), true);
+      TraverseFrames(aBlockFrame, &lineIter, block->PrincipalChildList().FirstChild(), &bpd);
+    }
   }
 
   if (ch != 0) {
     bpd.PopBidiControl(ch);
   }
 
   return ResolveParagraph(aBlockFrame, &bpd);
 }
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -1014,17 +1014,19 @@ public:
   /**
    * Returns false if there are no more lines. After this has returned false,
    * don't call any methods on this object again.
    */
   bool Prev();
 
 private:
   friend class nsBlockFrame;
+  friend class nsBidiPresUtils;
   // XXX nsBlockFrame uses this internally in one place.  Try to remove it.
+  // XXX uhm, and nsBidiPresUtils::Resolve too.
   nsBlockInFlowLineIterator(nsBlockFrame* aFrame, LineIterator aLine, bool aInOverflow);
 
   nsBlockFrame* mFrame;
   LineIterator mLine;
   nsLineList* mLineList;  // the line list mLine is in
 
   /**
    * Moves iterator to next valid line reachable from the current block.