Bug 1361207 - Changed appropriate calls to nsIFrame::IsThemed() to use overload with nsStyleDisplay* as argument to avoid redundant calls to StyleDisplay()
MozReview-Commit-ID: 65cmxFOgZeN
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -774,19 +774,20 @@ nsComboboxControlFrame::GetIntrinsicISiz
dropdownContentISize = NSCoordSaturatingSubtract(dropdownContentISize,
scrollbarWidth,
nscoord_MAX);
displayISize = std::max(dropdownContentISize, displayISize);
}
// add room for the dropmarker button if there is one
- if ((!IsThemed() ||
+ const nsStyleDisplay* disp = StyleDisplay();
+ if ((!IsThemed(disp) ||
presContext->GetTheme()->ThemeNeedsComboboxDropmarker()) &&
- StyleDisplay()->UsedAppearance() != NS_THEME_NONE) {
+ disp->UsedAppearance() != NS_THEME_NONE) {
displayISize += scrollbarWidth;
}
return displayISize;
}
nscoord
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -253,17 +253,18 @@ nsDisplayRangeFocusRing::Paint(nsDisplay
nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
}
void
nsRangeFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
- if (IsThemed()) {
+ const nsStyleDisplay* disp = StyleDisplay();
+ if (IsThemed(disp)) {
DisplayBorderBackgroundOutline(aBuilder, aLists);
// Only create items for the thumb. Specifically, we do not want
// the track to paint, since *our* background is used to paint
// the track, and we don't want the unthemed track painting over
// the top of the themed track.
// This logic is copied from
// nsContainerFrame::BuildDisplayListForNonBlockChildren as
// called by BuildDisplayListForInline.
@@ -293,17 +294,16 @@ nsRangeFrame::BuildDisplayList(nsDisplay
if (!mOuterFocusStyle ||
!mOuterFocusStyle->StyleBorder()->HasBorder()) {
// no ::-moz-focus-outer specified border (how style specifies a focus ring
// for range)
return;
}
- const nsStyleDisplay *disp = StyleDisplay();
if (IsThemed(disp) &&
PresContext()->GetTheme()->ThemeDrawsFocusForWidget(disp->UsedAppearance())) {
return; // the native theme displays its own visual indication of focus
}
aLists.Content()->AppendNewToTop(
new (aBuilder) nsDisplayRangeFocusRing(aBuilder, this));
}