Fixed problem where buttons where causing reflows when entering and exiting.

Removed outline border style and fixed style context parentage of buttons.
bug 17892; r=buster@netscape.com
This commit is contained in:
kmcclusk@netscape.com
1999-11-12 01:45:53 +00:00
parent 2bb2e20445
commit 5234a92ea4
10 changed files with 140 additions and 156 deletions

View File

@@ -101,6 +101,27 @@ nsHTMLButtonControlFrame::Init(nsIPresContext& aPresContext,
{
nsresult rv = nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow);
mRenderer.SetFrame(this,aPresContext);
// cache our display type
const nsStyleDisplay* styleDisplay;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
PRUint32 flags = NS_BLOCK_SPACE_MGR;
if (mInline) {
flags |= NS_BLOCK_SHRINK_WRAP;
}
nsIFrame* areaFrame;
NS_NewAreaFrame(&areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame
nsIStyleContext* styleContext;
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
return rv;
}
@@ -382,27 +403,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
// add ourself as an nsIFormControlFrame
nsFormFrame::AddFormControlFrame(aPresContext, *this);
// cache our display type
const nsStyleDisplay* styleDisplay;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
PRUint32 flags = NS_BLOCK_SPACE_MGR;
if (mInline) {
flags |= NS_BLOCK_SHRINK_WRAP;
}
nsIFrame* areaFrame;
NS_NewAreaFrame(&areaFrame, flags);
mFrames.SetFrames(areaFrame);
// Resolve style and initialize the frame
nsIStyleContext* styleContext;
aPresContext.ResolvePseudoStyleContextFor(mContent, nsHTMLAtoms::buttonContentPseudo,
mStyleContext, PR_FALSE,
&styleContext);
mFrames.FirstChild()->Init(aPresContext, mContent, this, styleContext, nsnull);
NS_RELEASE(styleContext);
// Set the parent for each of the child frames
for (nsIFrame* frame = aChildList; nsnull != frame; frame->GetNextSibling(&frame)) {
frame->SetParent(mFrames.FirstChild());