Bug 1352238 Part 7 - Check if native theme supports the widget before using it. r?mats
MozReview-Commit-ID: IKoYDzNCVx4
--- a/layout/xul/nsScrollbarFrame.cpp
+++ b/layout/xul/nsScrollbarFrame.cpp
@@ -164,25 +164,24 @@ nsresult
nsScrollbarFrame::GetXULMargin(nsMargin& aMargin)
{
nsresult rv = NS_ERROR_FAILURE;
aMargin.SizeTo(0,0,0,0);
if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
nsPresContext* presContext = PresContext();
nsITheme* theme = presContext->GetTheme();
- if (theme) {
+ if (theme && theme->ThemeSupportsWidget(presContext, this, NS_THEME_SCROLLBAR)) {
LayoutDeviceIntSize size;
bool isOverridable;
theme->GetMinimumWidgetSize(presContext, this, NS_THEME_SCROLLBAR, &size,
&isOverridable);
if (IsXULHorizontal()) {
aMargin.top = -presContext->DevPixelsToAppUnits(size.height);
- }
- else {
+ } else {
aMargin.left = -presContext->DevPixelsToAppUnits(size.width);
}
rv = NS_OK;
}
}
if (NS_FAILED(rv)) {
rv = nsBox::GetXULMargin(aMargin);