Make continuations non-fluid when the end of a bidi paragraph is forced by a preformatted newline. Bug 698335, r=roc
authorSimon Montagu <smontagu@smontagu.org>
Sun, 15 Jan 2012 06:56:04 -0800
changeset 85873 60add44419ef23753c389a979019b75546326f93
parent 85872 e25139fcf302c9d736730404e60dcb0c1004a016
child 85875 a1bf01b0a84261612c704bb82d63a11cd5850471
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs698335
milestone12.0a1
Make continuations non-fluid when the end of a bidi paragraph is forced by a preformatted newline. Bug 698335, r=roc
layout/base/crashtests/698335.html
layout/base/crashtests/crashtests.list
layout/base/nsBidiPresUtils.cpp
new file mode 100644
--- /dev/null
+++ b/layout/base/crashtests/698335.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html><html style="white-space: pre-wrap; direction: rtl; -moz-column-width: 1px;"><style style="display: none;">.fl:first-letter { }</style><body class="fl">&#xD288;&#x062A;
+D</body></html>
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -340,9 +340,10 @@ load 663295.html
 load 663662-1.html
 load 663662-2.html
 load 665837.html
 load 668941.xhtml
 load 670226.html
 asserts(2) load 675246-1.xhtml # Bug 675713
 load 691118-1.html
 load 695861.html
+load 698335.html
 load 707098.html
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -815,21 +815,21 @@ nsBidiPresUtils::ResolveParagraph(nsBloc
             do {
             } while (++newIndex < frameCount &&
                      aBpd->FrameAt(newIndex) == NS_BIDI_CONTROL_FRAME);
             if (newIndex < frameCount) {
               RemoveBidiContinuation(aBpd, frame,
                                      frameIndex, newIndex, lineOffset);
             }
           } else if (runLength == fragmentLength &&
-                     numRun + 1 < runCount) {
+                     frame->GetNextSibling()) {
             /*
              * If the directional run ends at the end of the frame, and this is
-             * not the end of our paragraph, make sure that the next frame is a
-             * non-fluid continuation
+             * not the containing frame's last child, make sure that the next
+             * frame is a non-fluid continuation
              */
             nsIFrame* next = frame->GetNextInFlow();
             if (next) {
               frame->SetNextContinuation(next);
               next->SetPrevContinuation(frame);
             }
           }
           frame->AdjustOffsetsForBidi(contentOffset, contentOffset + fragmentLength);