Bug 728284. Don't try to paint an opaque background for widgets that do it themselves. r=roc

This commit is contained in:
Timothy Nikkel 2012-04-17 01:04:05 -05:00
parent ff25496dd5
commit ff0f226d01
3 changed files with 13 additions and 3 deletions

View File

@ -5060,7 +5060,8 @@ void PresShell::UpdateCanvasBackground()
nscolor PresShell::ComputeBackstopColor(nsIView* aDisplayRoot) nscolor PresShell::ComputeBackstopColor(nsIView* aDisplayRoot)
{ {
nsIWidget* widget = aDisplayRoot->GetWidget(); nsIWidget* widget = aDisplayRoot->GetWidget();
if (widget && widget->GetTransparencyMode() != eTransparencyOpaque) { if (widget && (widget->GetTransparencyMode() != eTransparencyOpaque ||
widget->WidgetPaintsBackground())) {
// Within a transparent widget, so the backstop color must be // Within a transparent widget, so the backstop color must be
// totally transparent. // totally transparent.
return NS_RGBA(0,0,0,0); return NS_RGBA(0,0,0,0);

View File

@ -187,6 +187,8 @@ public:
static void ScheduleComposite(); static void ScheduleComposite();
static void SchedulePauseComposition(); static void SchedulePauseComposition();
static void ScheduleResumeComposition(); static void ScheduleResumeComposition();
virtual bool WidgetPaintsBackground() { return true; }
#endif #endif
protected: protected:

View File

@ -118,8 +118,8 @@ typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event);
#endif #endif
#define NS_IWIDGET_IID \ #define NS_IWIDGET_IID \
{ 0xb5bb55c7, 0x9a50, 0x4fa8, \ { 0x7c7ff2ff, 0x61f9, 0x4240, \
{ 0xa7, 0x6e, 0xbd, 0x31, 0x6f, 0x3e, 0x9c, 0x13 } } { 0xaa, 0x58, 0x74, 0xb0, 0xcd, 0xa9, 0xe3, 0x05 } }
/* /*
* Window shadow styles * Window shadow styles
@ -1595,6 +1595,13 @@ class nsIWidget : public nsISupports {
*/ */
virtual bool HasGLContext() { return false; } virtual bool HasGLContext() { return false; }
/**
* Returns true to indicate that this widget paints an opaque background
* that we want to be visible under the page, so layout should not force
* a default background.
*/
virtual bool WidgetPaintsBackground() { return false; }
protected: protected:
// keep the list of children. We also keep track of our siblings. // keep the list of children. We also keep track of our siblings.