Don't split inlines with bidi-isolated kids unnecessarily when they don't have siblings. Bug 793233, r=roc, a=lsblakk
authorSimon Montagu <smontagu@smontagu.org>
Thu, 25 Oct 2012 00:12:41 -0700
changeset 116683 c8f3d5623567f17a77c39111604c45d7eae0bc5b
parent 116682 78169f1caa36efa183b80d34df1e919529952a57
child 116684 bfd37567b5dea7169e23a153839639294331686e
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs793233
milestone18.0a2
Don't split inlines with bidi-isolated kids unnecessarily when they don't have siblings. Bug 793233, r=roc, a=lsblakk
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)) {