Bug 852489. Part 1: Don't create nsDisplayButtonForegrounds for buttons that aren't focused. r=mats
This commit is contained in:
@@ -185,11 +185,18 @@ nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayButtonBoxShadowOuter(aBuilder, this));
|
||||
}
|
||||
|
||||
// Almost all buttons draw some kind of background so there's not much
|
||||
// point in checking whether we should create this item.
|
||||
aBackground->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayButtonBorderBackground(aBuilder, this));
|
||||
|
||||
aForeground->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayButtonForeground(aBuilder, this));
|
||||
// Only display focus rings if we actually have them. Since at most one
|
||||
// button would normally display a focus ring, most buttons won't have them.
|
||||
if ((mOuterFocusStyle && mOuterFocusStyle->StyleBorder()->HasBorder()) ||
|
||||
(mInnerFocusStyle && mInnerFocusStyle->StyleBorder()->HasBorder())) {
|
||||
aForeground->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayButtonForeground(aBuilder, this));
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user