diff --git a/widget/src/mac/nsNativeThemeMac.cpp b/widget/src/mac/nsNativeThemeMac.cpp index 0b47aea0a142..6fbbb04f3a86 100644 --- a/widget/src/mac/nsNativeThemeMac.cpp +++ b/widget/src/mac/nsNativeThemeMac.cpp @@ -756,12 +756,8 @@ nsNativeThemeMac::ThemeSupportsWidget(nsIPresContext* aPresContext, nsIFrame* aF return PR_FALSE; #endif - if (aPresContext) { - nsCOMPtr shell; - aPresContext->GetShell(getter_AddRefs(shell)); - if (!shell->IsThemeSupportEnabled()) - return PR_FALSE; - } + if (aPresContext && !aPresContext->PresShell()->IsThemeSupportEnabled()) + return PR_FALSE; PRBool retVal = PR_FALSE; diff --git a/widget/src/windows/nsNativeThemeWin.cpp b/widget/src/windows/nsNativeThemeWin.cpp index 1ecb34f72c4e..8ea3de24d547 100644 --- a/widget/src/windows/nsNativeThemeWin.cpp +++ b/widget/src/windows/nsNativeThemeWin.cpp @@ -1152,12 +1152,8 @@ nsNativeThemeWin::ThemeSupportsWidget(nsIPresContext* aPresContext, // XXXdwh We can go even further and call the API to ask if support exists for // specific widgets. - if (aPresContext) { - nsCOMPtr shell; - aPresContext->GetShell(getter_AddRefs(shell)); - if (!shell->IsThemeSupportEnabled()) - return PR_FALSE; - } + if (aPresContext && !aPresContext->PresShell()->IsThemeSupportEnabled()) + return PR_FALSE; HANDLE theme = NULL; if (aWidgetType == NS_THEME_CHECKBOX_CONTAINER)