Don't split inlines with bidi-isolated kids unnecessarily when they don't have siblings. Bug 793233, r=roc
authorSimon Montagu <smontagu@smontagu.org>
Thu, 25 Oct 2012 01:36:37 -0700
changeset 111494 8a9563705dac716b29db9c7f5c0505f131a3a12f
parent 111493 b339983c1dd50296951a30aebc0da95837d9c848
child 111495 355a2ac5f897870ea3288846caab248ac3a09cd7
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersroc
bugs793233
milestone19.0a1
Don't split inlines with bidi-isolated kids unnecessarily when they don't have siblings. Bug 793233, r=roc
layout/base/nsBidiPresUtils.cpp
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -867,19 +867,20 @@ nsBidiPresUtils::ResolveParagraph(nsBloc
   if (aBpd->mParagraphDepth > 1) {
     nsIFrame* child;
     nsIFrame* parent;
     if (firstFrame) {
       child = firstFrame->GetParent();
       if (child) {
         parent = child->GetParent();
         if (parent && IsBidiSplittable(parent)) {
-          // no need to null-check the result of GetPrevSibling, because
-          // SplitInlineAncestors accepts a null parameter
-          SplitInlineAncestors(parent, child->GetPrevSibling());
+          nsIFrame* prev = child->GetPrevSibling();
+          if (prev) {
+            SplitInlineAncestors(parent, prev);
+          }
         }
       }
     }
     if (lastFrame) {
       child = lastFrame->GetParent();
       if (child) {
         parent = child->GetParent();
         if (parent && IsBidiSplittable(parent)) {