From 8632f162decf074bbbff358115dc191a6a85ccde Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 1 Feb 2005 21:01:31 +0000 Subject: [PATCH] Fix frame tree mangling when a combobox is inside a pseudo-cell. Bug 275746, r=bernd, sr=roc git-svn-id: svn://10.0.0.236/trunk@168661 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 3538a29b0b2..134c118328a 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -4806,10 +4806,24 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsIPresShell* aPresShell, // Create display and button frames from the combobox's anonymous content. // 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);