Bug 1426042 - Ensure we don't forget to set bidi data when required on a zero-length trailing frame. r=dholbert, a=gchang
authorJonathan Kew <jkew@mozilla.com>
Fri, 05 Jan 2018 13:58:51 +0000
changeset 445625 5b67ac2c216bef0bcf3a3cf7577eade0ffb5e0e2
parent 445624 b5147bc4e38410b1c5b66368f9e0d67f02e98738
child 445626 916cbb15381ea0571c81e33ef37514855f152203
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, gchang
bugs1426042
milestone58.0
Bug 1426042 - Ensure we don't forget to set bidi data when required on a zero-length trailing frame. r=dholbert, a=gchang
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