Bug 1366623 - Ensure we don't continue using a stale BidiDataProperty after dynamic content changes make it obsolete. r=dholbert
authorJonathan Kew <jkew@mozilla.com>
Tue, 23 May 2017 15:21:58 +0100
changeset 360207 d90c91b76b8ebc76805599e39bc6cec681260add
parent 360206 5f76c5baf28aba6205273330b1f10321aae29cec
child 360208 91f8c767d03c5e5733695048bfcce907d0378973
push id31872
push userryanvm@gmail.com
push dateTue, 23 May 2017 22:11:58 +0000
treeherdermozilla-central@96e18bec9fc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1366623
milestone55.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 1366623 - Ensure we don't continue using a stale BidiDataProperty after dynamic content changes make it obsolete. r=dholbert
layout/base/nsBidiPresUtils.cpp
layout/reftests/bidi/reftest.list
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -1311,16 +1311,24 @@ nsBidiPresUtils::ChildListMayRequireBidi
     // If unicode-bidi properties are present, we should do bidi resolution.
     nsStyleContext* sc = frame->StyleContext();
     if (GetBidiControl(sc) || GetBidiOverride(sc)) {
       return true;
     }
 
     if (IsBidiLeaf(frame)) {
       if (frame->IsTextFrame()) {
+        // If the frame already has a BidiDataProperty, we know we need to
+        // perform bidi resolution (even if no bidi content is NOW present --
+        // we might need to remove the property set by a previous reflow, if
+        // content has changed; see bug 1366623).
+        if (frame->Properties().Has(nsIFrame::BidiDataProperty())) {
+          return true;
+        }
+
         // Check whether the text frame has any RTL characters; if so, bidi
         // resolution will be needed.
         nsIContent* content = frame->GetContent();
         if (content != *aCurrContent) {
           *aCurrContent = content;
           const nsTextFragment* txt = content->GetText();
           if (txt->Is2b() && HasRTLChars(txt->Get2b(), txt->GetLength())) {
             return true;
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -167,9 +167,9 @@ fuzzy-if(Android,254,557) == brackets-2a
 fuzzy-if(Android,254,231) == brackets-2c-rtl.html brackets-2c-rtl-ref.html
 == 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
 fails-if(stylo) == 1217833-1.html 1217833-1-ref.html
 fails-if(stylo) == 1217833-2.html 1217833-2-ref.html
 == 1231175-1.html 1231175-1-ref.html
-fails == 1366623-1.html 1366623-1-ref.html
+== 1366623-1.html 1366623-1-ref.html