Bug 455826. Don't reconstruct textruns just because we deleted an empty nsContinuingTextFrame. r=smontagu
☠☠ backed out by 7669d6784173 ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 03 Dec 2008 09:40:02 +1300
changeset 22176 aaeb20c61fca050f4a3c8b9c226e4c19860d1d01
parent 22175 885dc81bc31b2f4419628f1572008a3684dcd73a
child 22177 992000e45526c4ef3c398585f54d1c8e6896f7b4
child 22270 7669d67841735f0db8320a1a03aead7f23b27da7
push id3843
push userrocallahan@mozilla.com
push dateTue, 02 Dec 2008 21:22:28 +0000
treeherdermozilla-central@31e5958cb97a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs455826
milestone1.9.2a1pre
Bug 455826. Don't reconstruct textruns just because we deleted an empty nsContinuingTextFrame. r=smontagu
layout/generic/nsTextFrameThebes.cpp
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -3378,20 +3378,26 @@ nsContinuingTextFrame::Init(nsIContent* 
 #endif // IBMBIDI
 
   return rv;
 }
 
 void
 nsContinuingTextFrame::Destroy()
 {
-  ClearTextRun();
-  if (mPrevContinuation || mNextContinuation) {
-    nsSplittableFrame::RemoveFromFlow(this);
-  }
+  // The text associated with this frame will become associated with our
+  // prev-continuation. If that means the text has changed style, then
+  // we need to wipe out the text run for the text.
+  // Note that mPrevContinuation can be null if we're destroying the whole
+  // frame chain from the start to the end.
+  if (!mPrevContinuation ||
+      mPrevContinuation->GetStyleContext() != GetStyleContext()) {
+    ClearTextRun();
+  }
+  nsSplittableFrame::RemoveFromFlow(this);
   // Let the base class destroy the frame
   nsFrame::Destroy();
 }
 
 nsIFrame*
 nsContinuingTextFrame::GetFirstInFlow() const
 {
   // Can't cast to |nsContinuingTextFrame*| because the first one isn't.