Check for orphaned non-fluid continuations after deleting content. Bug 730562, r=roc
authorSimon Montagu <smontagu@smontagu.org>
Wed, 21 Mar 2012 16:50:54 -0700
changeset 89985 9f0ebe3d07ff
parent 89984 a30e6278c122
child 89986 0c6934edce58
push id22300
push usermak77@bonardo.net
push date2012-03-22 12:08 +0000
treeherdermozilla-central@b622d692b8ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs730562
milestone14.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
Check for orphaned non-fluid continuations after deleting content. Bug 730562, r=roc
layout/base/nsBidiPresUtils.cpp
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -484,38 +484,36 @@ MakeContinuationFluid(nsIFrame* aFrame, 
 
   NS_ASSERTION (!aNext->GetPrevInFlow() || aNext->GetPrevInFlow() == aFrame,
                 "prev-in-flow is not prev continuation!");
   aNext->SetPrevInFlow(aFrame);
 }
 
 // If aFrame is the last child of its parent, convert bidi continuations to
 // fluid continuations for all of its inline ancestors.
+// If it isn't the last child, make sure that its continuation is fluid.
 static void
 JoinInlineAncestors(nsIFrame* aFrame)
 {
-  if (aFrame->GetNextSibling()) {
-    return;
-  }
-  nsIFrame* frame = aFrame->GetParent();
-  while (frame && IsBidiSplittable(frame)) {
+  nsIFrame* frame = aFrame;
+  do {
     nsIFrame* next = frame->GetNextContinuation();
     if (next) {
       // Don't join frames if they come from different paragraph depths (i.e.
       // one is bidi isolated relative to the other
       if (nsBidiPresUtils::GetParagraphDepth(frame) ==
           nsBidiPresUtils::GetParagraphDepth(next)) {
         MakeContinuationFluid(frame, next);
       }
     }
     // Join the parent only as long as we're its last child.
     if (frame->GetNextSibling())
       break;
     frame = frame->GetParent();
-  }
+  } while (frame && IsBidiSplittable(frame));
 }
 
 static nsresult
 CreateContinuation(nsIFrame*  aFrame,
                    nsIFrame** aNewFrame,
                    bool       aIsFluid)
 {
   NS_PRECONDITION(aNewFrame, "null OUT ptr");