Bug 518114 part 1. Don't force a virtual GetType call in GetFloatFromPlaceholder. r=roc

This commit is contained in:
Boris Zbarsky 2009-11-16 16:00:07 -05:00
parent 84a1bad070
commit cac46ff131
3 changed files with 7 additions and 6 deletions

View File

@ -229,9 +229,8 @@ nsLayoutUtils::GetClosestFrameOfType(nsIFrame* aFrame, nsIAtom* aFrameType)
nsIFrame*
nsLayoutUtils::GetFloatFromPlaceholder(nsIFrame* aFrame) {
if (nsGkAtoms::placeholderFrame != aFrame->GetType()) {
return nsnull;
}
NS_ASSERTION(nsGkAtoms::placeholderFrame == aFrame->GetType(),
"Must have a placeholder here");
nsIFrame *outOfFlowFrame =
nsPlaceholderFrame::GetRealFrameForPlaceholder(aFrame);

View File

@ -341,9 +341,9 @@ public:
/**
* If this frame is a placeholder for a float, then return the float,
* otherwise return nsnull.
* otherwise return nsnull. aPlaceholder must be a placeholder frame.
*/
static nsIFrame* GetFloatFromPlaceholder(nsIFrame* aPossiblePlaceholder);
static nsIFrame* GetFloatFromPlaceholder(nsIFrame* aPlaceholder);
// Combine aNewBreakType with aOrigBreakType, but limit the break types
// to NS_STYLE_CLEAR_LEFT, RIGHT, LEFT_AND_RIGHT.

View File

@ -6644,7 +6644,9 @@ void nsBlockFrame::CollectFloats(nsIFrame* aFrame, nsFrameList& aList,
while (aFrame) {
// Don't descend into float containing blocks.
if (!aFrame->IsFloatContainingBlock()) {
nsIFrame *outOfFlowFrame = nsLayoutUtils::GetFloatFromPlaceholder(aFrame);
nsIFrame *outOfFlowFrame =
aFrame->GetType() == nsGkAtoms::placeholderFrame ?
nsLayoutUtils::GetFloatFromPlaceholder(aFrame) : nsnull;
if (outOfFlowFrame) {
// Make sure that its parent is us. Otherwise we don't want
// to mess around with it because it belongs to someone