Recreate content when a deleted frame is the only child of a bidi continuation frame. Bug 718236, r=roc
authorSimon Montagu <smontagu@smontagu.org>
Thu, 26 Jan 2012 00:04:22 -0800
changeset 86686 33b309643e39c6da3e4d485a07e0382c62f0bec7
parent 86685 f29c4f3492769e9f35d2c8d019c223f17e565f48
child 86687 e31b47c574bff4c89cff38855b40a56865092388
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs718236
milestone12.0a1
Recreate content when a deleted frame is the only child of a bidi continuation frame. Bug 718236, r=roc
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -9039,16 +9039,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