Bug 791601. r=roc, a=lsblakk
authorMats Palmgren <matspal@gmail.com>
Tue, 18 Sep 2012 01:05:05 +0200
changeset 109632 7f450abfd3181995ed7e72836adb5221835d4105
parent 109631 73bfa98a91df8919fb21b2c28605ad6a3dd5d0da
child 109633 3d5ad9d84bf3f6d994b35c825a98a19ab6a80a61
push id1585
push userryanvm@gmail.com
push dateTue, 23 Oct 2012 03:49:51 +0000
treeherdermozilla-beta@121213ddf98b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, lsblakk
bugs791601
milestone17.0
Bug 791601. r=roc, a=lsblakk
layout/generic/nsTextFrameThebes.cpp
--- a/layout/generic/nsTextFrameThebes.cpp
+++ b/layout/generic/nsTextFrameThebes.cpp
@@ -7270,38 +7270,37 @@ RemoveInFlows(nsTextFrame* aFrame, nsTex
                "aFirstToNotRemove should have a fluid prev continuation");
   NS_ASSERTION(aFrame->GetPrevContinuation() ==
                aFrame->GetPrevInFlow() &&
                aFrame->GetPrevInFlow() != nullptr,
                "aFrame should have a fluid prev continuation");
   
   nsIFrame* prevContinuation = aFrame->GetPrevContinuation();
   nsIFrame* lastRemoved = aFirstToNotRemove->GetPrevContinuation();
-  nsIFrame* parent = aFrame->GetParent();
-  nsBlockFrame* parentBlock = nsLayoutUtils::GetAsBlock(parent);
-  if (!parentBlock) {
-    // Clear the text run on the first frame we'll remove to make sure none of
-    // the frames we keep shares its text run.  We need to do this now, before
-    // we unlink the frames to remove from the flow, because DestroyFrom calls
-    // ClearTextRuns() and that will start at the first frame with the text
-    // run and walk the continuations.  We only need to care about the first
-    // and last frames we remove since text runs are contiguous.
-    aFrame->ClearTextRuns();
-    if (aFrame != lastRemoved) {
-      // Clear the text run on the last frame we'll remove for the same reason.
-      static_cast<nsTextFrame*>(lastRemoved)->ClearTextRuns();
-    }
+
+  // Clear the text run on the first frame we'll remove to make sure none of
+  // the frames we keep shares its text run.  We need to do this now, before
+  // we unlink the frames to remove from the flow, because DestroyFrom calls
+  // ClearTextRuns() and that will start at the first frame with the text
+  // run and walk the continuations.  We only need to care about the first
+  // and last frames we remove since text runs are contiguous.
+  aFrame->ClearTextRuns();
+  if (aFrame != lastRemoved) {
+    // Clear the text run on the last frame we'll remove for the same reason.
+    static_cast<nsTextFrame*>(lastRemoved)->ClearTextRuns();
   }
 
   prevContinuation->SetNextInFlow(aFirstToNotRemove);
   aFirstToNotRemove->SetPrevInFlow(prevContinuation);
 
   aFrame->SetPrevInFlow(nullptr);
   lastRemoved->SetNextInFlow(nullptr);
 
+  nsIFrame* parent = aFrame->GetParent();
+  nsBlockFrame* parentBlock = nsLayoutUtils::GetAsBlock(parent);
   if (parentBlock) {
     // Manually call DoRemoveFrame so we can tell it that we're
     // removing empty frames; this will keep it from blowing away
     // text runs.
     parentBlock->DoRemoveFrame(aFrame, nsBlockFrame::FRAMES_ARE_EMPTY);
   } else {
     // Just remove it normally; use kNoReflowPrincipalList to avoid posting
     // new reflows.