From 28558f35bc7dcd0b0923b3fca0246812bcad72ec Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Tue, 20 Jul 1999 07:19:22 +0000 Subject: [PATCH] Making sure the pseudo stuff gets handled for the XP menu object. --- layout/base/nsCSSFrameConstructor.cpp | 41 +++++++++++-------- .../html/style/src/nsCSSFrameConstructor.cpp | 41 +++++++++++-------- 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 7117e1fa7d4d..5e5e784e9333 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3058,25 +3058,30 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, const nsStyleDisplay* display = (const nsStyleDisplay*) aStyleContext->GetStyleData(eStyleStruct_Display); - // Menus can scroll. - if (IsScrollable(aPresContext, display)) { - // See if it's absolute positioned or fixed positioned - if (NS_STYLE_POSITION_ABSOLUTE == position->mPosition) { - isAbsolutelyPositioned = PR_TRUE; - } else if (NS_STYLE_POSITION_FIXED == position->mPosition) { - isFixedPositioned = PR_TRUE; - } - - // Create a scroll frame - nsIFrame* scrollFrame; - NS_NewScrollFrame(&scrollFrame); - - // Initialize it (note we don't honor absolute or fixed, since this is - // going to behave a lot like the GFX combo box). - InitializeScrollFrame(aPresContext, aState, scrollFrame, aContent, aParentFrame, - aStyleContext, newFrame, PR_FALSE, PR_FALSE, PR_TRUE); - frameHasBeenInitialized = PR_TRUE; + // Menus scroll. + // See if it's absolute positioned or fixed positioned + if (NS_STYLE_POSITION_ABSOLUTE == position->mPosition) { + isAbsolutelyPositioned = PR_TRUE; + } else if (NS_STYLE_POSITION_FIXED == position->mPosition) { + isFixedPositioned = PR_TRUE; } + + // Create a scroll frame + nsIFrame* scrollFrame; + NS_NewScrollFrame(&scrollFrame); + + // Initialize it (note we don't honor absolute or fixed, since this is + // going to behave a lot like the GFX combo box). + // Resolve psuedo element style for the dropdown menu + nsCOMPtr menuStyle; + rv = aPresContext->ResolvePseudoStyleContextFor(aContent, + nsXULAtoms::dropDownMenuPseudo, + aStyleContext, + PR_FALSE, + getter_AddRefs(menuStyle)); + InitializeScrollFrame(aPresContext, aState, scrollFrame, aContent, aParentFrame, + menuStyle, newFrame, PR_FALSE, PR_FALSE, PR_TRUE); + frameHasBeenInitialized = PR_TRUE; } // BOX CONSTRUCTION diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 7117e1fa7d4d..5e5e784e9333 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -3058,25 +3058,30 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext, const nsStyleDisplay* display = (const nsStyleDisplay*) aStyleContext->GetStyleData(eStyleStruct_Display); - // Menus can scroll. - if (IsScrollable(aPresContext, display)) { - // See if it's absolute positioned or fixed positioned - if (NS_STYLE_POSITION_ABSOLUTE == position->mPosition) { - isAbsolutelyPositioned = PR_TRUE; - } else if (NS_STYLE_POSITION_FIXED == position->mPosition) { - isFixedPositioned = PR_TRUE; - } - - // Create a scroll frame - nsIFrame* scrollFrame; - NS_NewScrollFrame(&scrollFrame); - - // Initialize it (note we don't honor absolute or fixed, since this is - // going to behave a lot like the GFX combo box). - InitializeScrollFrame(aPresContext, aState, scrollFrame, aContent, aParentFrame, - aStyleContext, newFrame, PR_FALSE, PR_FALSE, PR_TRUE); - frameHasBeenInitialized = PR_TRUE; + // Menus scroll. + // See if it's absolute positioned or fixed positioned + if (NS_STYLE_POSITION_ABSOLUTE == position->mPosition) { + isAbsolutelyPositioned = PR_TRUE; + } else if (NS_STYLE_POSITION_FIXED == position->mPosition) { + isFixedPositioned = PR_TRUE; } + + // Create a scroll frame + nsIFrame* scrollFrame; + NS_NewScrollFrame(&scrollFrame); + + // Initialize it (note we don't honor absolute or fixed, since this is + // going to behave a lot like the GFX combo box). + // Resolve psuedo element style for the dropdown menu + nsCOMPtr menuStyle; + rv = aPresContext->ResolvePseudoStyleContextFor(aContent, + nsXULAtoms::dropDownMenuPseudo, + aStyleContext, + PR_FALSE, + getter_AddRefs(menuStyle)); + InitializeScrollFrame(aPresContext, aState, scrollFrame, aContent, aParentFrame, + menuStyle, newFrame, PR_FALSE, PR_FALSE, PR_TRUE); + frameHasBeenInitialized = PR_TRUE; } // BOX CONSTRUCTION