From fcd583fe2e20f627ec701c64100465cfb198db53 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 --- layout/base/nsCSSFrameConstructor.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 134c118328a9..566b25c9c0a5 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/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;