Bug 1426042 - Ensure we don't forget to set bidi data when required on a zero-length trailing frame. r=dholbert
authorJonathan Kew <jkew@mozilla.com>
Fri, 05 Jan 2018 13:58:51 +0000
changeset 449753 a37695e59774af91ca8e9e50bee369364cf4feaa
parent 449752 ea9e9cf12f6b40450a6aba39004c0e03def0407c
child 449754 d47e642852b17e46c178d26d324b245199e2bc3c
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1426042
milestone59.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 1426042 - Ensure we don't forget to set bidi data when required on a zero-length trailing frame. r=dholbert
layout/base/nsBidiPresUtils.cpp
layout/reftests/bidi/reftest.list
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -883,16 +883,23 @@ nsBidiPresUtils::ResolveParagraph(BidiPa
         contentOffset = start;
         isTextFrame = true;
       }
     } // if (fragmentLength <= 0)
 
     if (runLength <= 0) {
       // Get the next run of text from the Bidi engine
       if (++numRun >= runCount) {
+        // We've run out of runs of text; but don't forget to store bidi data
+        // to the frame before breaking out of the loop (bug 1426042).
+        storeBidiDataToFrame();
+        if (isTextFrame) {
+          frame->AdjustOffsetsForBidi(contentOffset,
+                                      contentOffset + fragmentLength);
+        }
         break;
       }
       int32_t lineOffset = logicalLimit;
       aBpd->GetLogicalRun(lineOffset, &logicalLimit, &embeddingLevel);
       runLength = logicalLimit - lineOffset;
     } // if (runLength <= 0)
 
     if (frame == NS_BIDI_CONTROL_FRAME) {
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -168,9 +168,9 @@ fuzzy-if(Android,254,231) == brackets-2c
 == brackets-3a-ltr.html brackets-3a-ltr-ref.html
 == brackets-3a-rtl.html brackets-3a-rtl-ref.html
 == brackets-3b-ltr.html brackets-3b-ltr-ref.html
 == brackets-3b-rtl.html brackets-3b-rtl-ref.html
 == 1217833-1.html 1217833-1-ref.html
 == 1217833-2.html 1217833-2-ref.html
 == 1231175-1.html 1231175-1-ref.html
 == 1366623-1.html 1366623-1-ref.html
-fails == 1426042-1.html 1426042-1-ref.html
+== 1426042-1.html 1426042-1-ref.html