bug 718236 - Recreate content when a deleted frame is the only child of a bidi continuation frame. r=roc a=akeybl
authorSimon Montagu <smontagu@smontagu.org>
Thu, 26 Jan 2012 00:04:22 -0800
changeset 85501 3b32861a5cf7251bfd638ff72c038fb38f137916
parent 85500 c392df98777f8b3f625783d50d756f888fb62fe1
child 85502 78746341757473d28f54565baf0cc39ee33188a2
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersroc, akeybl
bugs718236
milestone11.0
bug 718236 - Recreate content when a deleted frame is the only child of a bidi continuation frame. r=roc a=akeybl
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -9006,16 +9006,26 @@ nsCSSFrameConstructor::MaybeRecreateCont
     nsIRootBox* rootBox = nsIRootBox::GetRootBox(mPresShell);
     if (rootBox && rootBox->GetPopupSetFrame() == aFrame) {
       *aResult = ReconstructDocElementHierarchy();
       return true;
     }
   }
 #endif
 
+  // Reconstruct if inflowFrame is parent's only child, and parent is, or has,
+  // a non-fluid continuation, i.e. it was split by bidi resolution
+  if (!inFlowFrame->GetPrevSibling() &&
+      !inFlowFrame->GetNextSibling() &&
+      (parent->GetPrevContinuation() && !parent->GetPrevInFlow() ||
+       parent->GetNextContinuation() && !parent->GetNextInFlow())) {
+    *aResult = RecreateFramesForContent(parent->GetContent(), true);
+    return true;
+  }
+
   // We might still need to reconstruct things if the parent of inFlowFrame is
   // special, since in that case the removal of aFrame might affect the
   // splitting of its parent.
   if (!IsFrameSpecial(parent)) {
     return false;
   }
 
   // If inFlowFrame is not the only in-flow child of |parent|, then removing