Commit ed6210be authored by mats.palmgren%bredband.net's avatar mats.palmgren%bredband.net
Browse files

Leave the placeholder's pointer to the out-of-flow intact because the float...

Leave the placeholder's pointer to the out-of-flow intact because the float cache depends on it later on. b=348688 r=bzbarsky sr=roc
parent 2abceb57
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -9772,7 +9772,8 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
  
  
        // Remove the mapping from the out-of-flow frame to its placeholder.
        // Remove the mapping from the out-of-flow frame to its placeholder.
        aFrameManager->UnregisterPlaceholderFrame((nsPlaceholderFrame*)childFrame);
        aFrameManager->UnregisterPlaceholderFrame((nsPlaceholderFrame*)childFrame);
        ((nsPlaceholderFrame*)childFrame)->SetOutOfFlowFrame(nsnull);
        // Don't SetOutOfFlowFrame(nsnull) here because the float cache depends
        // on it when the float is removed later on, see bug 348688 comment 6.
        
        
        // Queue the out-of-flow frame to be destroyed only if aRemovedFrame is _not_
        // Queue the out-of-flow frame to be destroyed only if aRemovedFrame is _not_
        // one of its ancestor frames or if it is a popup frame. 
        // one of its ancestor frames or if it is a popup frame. 
+0 −6
Original line number Original line Diff line number Diff line
@@ -5879,12 +5879,6 @@ found_frame:;
    printf(" prevSibling=%p deletedNextContinuation=%p\n", prevSibling, deletedNextContinuation);
    printf(" prevSibling=%p deletedNextContinuation=%p\n", prevSibling, deletedNextContinuation);
#endif
#endif


    if (!aDeletedFrame->IsFloatContainingBlock()) {
      // Clear the float cache from placeholders that are descendants
      // of aDeletedFrame (bug 337883).
      line->RemovePlaceholderDescendantsOf(aDeletedFrame);
    }

    if (aDestroyFrames) {
    if (aDestroyFrames) {
      aDeletedFrame->Destroy();
      aDeletedFrame->Destroy();
    } else {
    } else {
+0 −28
Original line number Original line Diff line number Diff line
@@ -523,34 +523,6 @@ nsLineBox::RemoveFloat(nsIFrame* aFrame)
  return PR_FALSE;
  return PR_FALSE;
}
}


void
nsLineBox::RemovePlaceholderDescendantsOf(nsIFrame* aFrame)
{
  if (IsInline() && mInlineData) {
    nsFloatCache* fc = mInlineData->mFloats.Head();
    while (fc) {
      nsIFrame* frame = fc->mPlaceholder;
      while (frame && frame != aFrame) {
        if (frame->IsFloatContainingBlock()) {
          frame = nsnull;
          break;
        }
        frame = frame->GetParent();
      }
      if (NS_UNLIKELY(frame != nsnull)) {
        nsFloatCache* next = fc->Next();
        mInlineData->mFloats.Remove(fc);
        delete fc;
        MaybeFreeData();
        fc = next;
      }
      else {
        fc = fc->Next();
      }
    }
  }
}

void
void
nsLineBox::SetCombinedArea(const nsRect& aCombinedArea)
nsLineBox::SetCombinedArea(const nsRect& aCombinedArea)
{  
{  
+0 −1
Original line number Original line Diff line number Diff line
@@ -402,7 +402,6 @@ public:
  void FreeFloats(nsFloatCacheFreeList& aFreeList);
  void FreeFloats(nsFloatCacheFreeList& aFreeList);
  void AppendFloats(nsFloatCacheFreeList& aFreeList);
  void AppendFloats(nsFloatCacheFreeList& aFreeList);
  PRBool RemoveFloat(nsIFrame* aFrame);
  PRBool RemoveFloat(nsIFrame* aFrame);
  void RemovePlaceholderDescendantsOf(nsIFrame* aFrame);


  // Combined area is the area of the line that should influence the
  // Combined area is the area of the line that should influence the
  // overflow area of its parent block.  The combined area should be
  // overflow area of its parent block.  The combined area should be