From 1818d5e294c6b6b17f20124cd3ad64270b7a92b4 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 3 Feb 2005 18:40:01 +0000 Subject: [PATCH] Move pseudo-frame handling into CreateAnonymousFrames, sort of like what we have in ProcessChildren. Bug 280708, r=bernd, sr=roc git-svn-id: svn://10.0.0.236/trunk@168757 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 134c118328a..566b25c9c0a 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -4807,23 +4807,10 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, // The anonymous content is appended to existing anonymous content for this // element (the scrollbars). - // save the incoming pseudo frame state, so that we don't end up - // with those pseudoframes in childItems - nsPseudoFrames priorPseudoFrames; - aState.mPseudoFrames.Reset(&priorPseudoFrames); - nsFrameItems childItems; CreateAnonymousFrames(aPresShell, aPresContext, nsHTMLAtoms::combobox, aState, aContent, comboboxFrame, PR_TRUE, childItems); - // process the current pseudo frame state - if (!aState.mPseudoFrames.IsEmpty()) { - ProcessPseudoFrames(aPresContext, aState.mPseudoFrames, childItems); - } - - // restore the incoming pseudo frame state - aState.mPseudoFrames = priorPseudoFrames; - comboboxFrame->SetInitialChildList(aPresContext, nsnull, childItems.childList); @@ -5605,6 +5592,11 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell anonymousItems->Count(&count); if (count) { + // save the incoming pseudo frame state, so that we don't end up + // with those pseudoframes in aChildItems + nsPseudoFrames priorPseudoFrames; + aState.mPseudoFrames.Reset(&priorPseudoFrames); + // A content element can have multiple sources of anonymous content. For example, // SELECTs have a combobox dropdown button and also scrollbars in the list view. // nsPresShell doesn't handle this very well. It's a problem because a reframe could @@ -5688,6 +5680,14 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell creator->PostCreateFrames(); } + + // process the current pseudo frame state + if (!aState.mPseudoFrames.IsEmpty()) { + ProcessPseudoFrames(aPresContext, aState.mPseudoFrames, aChildItems); + } + + // restore the incoming pseudo frame state + aState.mPseudoFrames = priorPseudoFrames; } return NS_OK;