If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Transparent Background color doesn't work on windows with popup=yes

UNCONFIRMED
Unassigned

Status

()

Core
Widget: Win32
UNCONFIRMED
10 years ago
3 years ago

People

(Reporter: Ryan A. C., Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008041206 Minefield/3.0pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008041206 Minefield/3.0pre

While trying to fix Bug 426713 I ran into a problem, which I have finally narrowed down to the fact that background-color: transparent doesn't seem to work on windows with the OpenWindow feature popup=yes which is defined on that particular window right here:
http://mxr.mozilla.org/mozilla/source/toolkit/components/alerts/src/nsAlertsService.cpp#145

Reproducible: Always

Steps to Reproduce:
1. Place this in your userchrome.css:
document.getElementById("alertNotification").setAttribute("hidechrome", "true"); 

#alertNotification {
background-color: transparent !important;
}

.alertBox {
-moz-border-radius: 20px !important;
}

----
2. right click->Save Link As.. on this: Attachment 314021 [details]

Actual Results:  
Note on the download popup that that there is still a white window behind the corners.

Expected Results:  
The window should be transparent
(Reporter)

Updated

10 years ago
Summary: Transparent Background color doesn't work on windows with popup=true → Transparent Background color doesn't work on windows with popup=yes

Updated

8 years ago
Duplicate of this bug: 515296

Updated

8 years ago
Duplicate of this bug: 528577

Comment 3

3 years ago
I can confirm this issue, how to fix it?

Comment 4

3 years ago
The problem comes from a fact when we open a XUL window with popup=yes, it's still are
toplevel window.
The in-correct code comes from here:

 layout/generic/nsContainerFrame.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp
index 76f0748..53d8a81 100644
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -645,7 +645,7 @@ nsContainerFrame::SyncWindowProperties(nsPresContext*       aPresContext,
     return;
 
   nsIWidget* windowWidget = GetPresContextContainerWidget(aPresContext);
-  if (!windowWidget || !IsTopLevelWidget(windowWidget))
+  if (!windowWidget)
     return;
 
   nsViewManager* vm = aView->GetViewManager();
@@ -681,6 +681,9 @@ nsContainerFrame::SyncWindowProperties(nsPresContext*       aPresContext,
   nsTransparencyMode mode = nsLayoutUtils::GetFrameTransparency(aFrame, rootFrame);
   nsIWidget* viewWidget = aView->GetWidget();
   viewWidget->SetTransparencyMode(mode);
+  if (!IsTopLevelWidget(windowWidget)) {
+    return;
+  }
   windowWidget->SetWindowShadowStyle(rootFrame->StyleUIReset()->mWindowShadow);
 
   if (!aRC)



We should testing IsTopLevelWidget latter, or we need to change the action of IsTopLevelWidget

Comment 5

3 years ago
I have a method to avoid this bug, but it is not a good method.
open a window with popup=yes, and hide it, the use this hidden window to open a sub window with dependent=yes, the sub window has popup property and it is transparent

Comment 6

3 years ago
(In reply to mike8625 from comment #5)
> I have a method to avoid this bug, but it is not a good method.
> open a window with popup=yes, and hide it, the use this hidden window to
> open a sub window with dependent=yes, the sub window has popup property and
> it is transparent
Thanks, but we can not control if the user would use popup=yes.
To open a window, then we can not style that window in a global way.
You need to log in before you can comment on or make changes to this bug.