From c7e51a42fa1cb117abb4bdb6ee9beaf2aa1ba480 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sat, 24 Apr 2004 16:00:46 +0000 Subject: [PATCH] When we push a pseudo cell frame, the block inside it needs to become the float containing block. Otherwise, floats inside this cellframe get very confused. Bug 233094 and various dependencies, r+sr=dbaron git-svn-id: svn://10.0.0.236/trunk@155446 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 18 ++++++++++++++++++ .../html/style/src/nsCSSFrameConstructor.cpp | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index bcc25277f6c..cc6a2702163 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -2977,6 +2977,13 @@ nsCSSFrameConstructor::ConstructTableForeignFrame(nsIPresShell* aPres if (!parentFrame) return rv; // if pseudo frame wasn't created + NS_ASSERTION(parentFrame == aState.mPseudoFrames.mCellInner.mFrame, + "Weird parent in ConstructTableForeignFrame"); + + // Push the parent as the floater containing block + nsFrameConstructorSaveState saveState; + aState.PushFloatContainingBlock(parentFrame, saveState, PR_FALSE, PR_FALSE); + // save the pseudo frame state XXX - why nsPseudoFrames prevPseudoFrames; aState.mPseudoFrames.Reset(&prevPseudoFrames); @@ -6061,6 +6068,17 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPre } } + nsFrameConstructorSaveState pseudoSaveState; + if (pseudoParent) { + // We pushed an anonymous table cell. The inner block of this + // needs to become the float containing block. Luckily, it's + // hanging about in adjParentFrame! + NS_ASSERTION(adjParentFrame == aState.mPseudoFrames.mCellInner.mFrame, + "Weird parent frame in ConstructFrameByDisplayType"); + aState.PushFloatContainingBlock(adjParentFrame, pseudoSaveState, + PR_FALSE, PR_FALSE); + } + // If this is "body", try propagating its scroll style to the viewport // Note that we need to do this even if the body is NOT scrollable; // it might have dynamically changed from scrollable to not scrollable, diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index bcc25277f6c..cc6a2702163 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -2977,6 +2977,13 @@ nsCSSFrameConstructor::ConstructTableForeignFrame(nsIPresShell* aPres if (!parentFrame) return rv; // if pseudo frame wasn't created + NS_ASSERTION(parentFrame == aState.mPseudoFrames.mCellInner.mFrame, + "Weird parent in ConstructTableForeignFrame"); + + // Push the parent as the floater containing block + nsFrameConstructorSaveState saveState; + aState.PushFloatContainingBlock(parentFrame, saveState, PR_FALSE, PR_FALSE); + // save the pseudo frame state XXX - why nsPseudoFrames prevPseudoFrames; aState.mPseudoFrames.Reset(&prevPseudoFrames); @@ -6061,6 +6068,17 @@ nsCSSFrameConstructor::ConstructFrameByDisplayType(nsIPresShell* aPre } } + nsFrameConstructorSaveState pseudoSaveState; + if (pseudoParent) { + // We pushed an anonymous table cell. The inner block of this + // needs to become the float containing block. Luckily, it's + // hanging about in adjParentFrame! + NS_ASSERTION(adjParentFrame == aState.mPseudoFrames.mCellInner.mFrame, + "Weird parent frame in ConstructFrameByDisplayType"); + aState.PushFloatContainingBlock(adjParentFrame, pseudoSaveState, + PR_FALSE, PR_FALSE); + } + // If this is "body", try propagating its scroll style to the viewport // Note that we need to do this even if the body is NOT scrollable; // it might have dynamically changed from scrollable to not scrollable,