Bug 1055585 - Add nsITheme::NeedToClearBackgroundBehindWidget and create nsDisplayClearBackground if the theme needs it for a widget. r=roc

This commit is contained in:
Markus Stange 2014-08-20 17:26:11 +02:00
parent f58a444916
commit d1b36003c4
2 changed files with 11 additions and 3 deletions

View File

@ -28,10 +28,10 @@ class nsIAtom;
class nsIWidget;
// IID for the nsITheme interface
// {7a3474d9-3bd6-407c-8657-c5c7633639f0}
// {48f64fde-ff0e-4989-bbe3-f746573f9b7c}
#define NS_ITHEME_IID \
{ 0x7a3474d9, 0x3bd6, 0x407c, \
{ 0x86, 0x57, 0xc5, 0xc7, 0x63, 0x36, 0x39, 0xf0 } }
{ 0x48f64fde, 0xff0e, 0x4989, \
{ 0xbb, 0xe3, 0xf7, 0x46, 0x57, 0x3f, 0x9b, 0x7c } }
// {0ae05515-cf7a-45a8-9e02-6556de7685b1}
#define NS_THEMERENDERER_CID \
{ 0x0ae05515, 0xcf7a, 0x45a8, \
@ -140,6 +140,9 @@ public:
virtual bool WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType)
{ return false; }
virtual bool NeedToClearBackgroundBehindWidget(uint8_t aWidgetType)
{ return false; }
/**
* Can the nsITheme implementation handle this widget?
*/

View File

@ -1890,6 +1890,11 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
}
if (isThemed) {
nsITheme* theme = presContext->GetTheme();
if (theme->NeedToClearBackgroundBehindWidget(aFrame->StyleDisplay()->mAppearance)) {
bgItemList.AppendNewToTop(
new (aBuilder) nsDisplayClearBackground(aBuilder, aFrame));
}
nsDisplayThemedBackground* bgItem =
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame);
bgItemList.AppendNewToTop(bgItem);