mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-27 05:00:13 -10:00
Fixed problem where buttons where causing reflows when entering and exiting.
Removed outline border style and fixed style context parentage of buttons. bug 17892; [email protected]
This commit is contained in:
1 parent
2bb2e20445
commit
5234a92ea4
10 files changed
+140
-156
No files matched your search
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user