Last Comment Bug 469203 - window.openDialog doesn't work reliably since August in trunk and Firefox 3.1
: window.openDialog doesn't work reliably since August in trunk and Firefox 3.1
Status: RESOLVED FIXED
: fixed1.9.1
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: x86 Windows XP
: P1 normal with 1 vote (vote)
: ---
Assigned To: Robert O'Callahan (:roc) (email my personal email if necessary)
:
: Jet Villegas (:jet)
Mentors:
Depends on:
Blocks: 472886
  Show dependency treegraph
 
Reported: 2008-12-11 13:41 PST by Alfonso Martinez
Modified: 2009-01-10 12:06 PST (History)
13 users (show)
roc: blocking1.9.1+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Screenshot of problem (170.53 KB, image/jpeg)
2008-12-11 13:46 PST, Michael Kraft [:morac]
no flags Details
screenshot (284.46 KB, image/png)
2008-12-16 01:52 PST, Robert O'Callahan (:roc) (email my personal email if necessary)
no flags Details
fix (4.14 KB, patch)
2008-12-18 01:04 PST, Robert O'Callahan (:roc) (email my personal email if necessary)
dbaron: review+
dbaron: superreview+
Details | Diff | Splinter Review

Description User image Alfonso Martinez 2008-12-11 13:41:41 PST
For previous comments see bug 458898

In the error console run this:
window.openDialog("about:blank", "Window", "width=780,height=500")
or
window.openDialog("about:blank", "Window", "modal")

This bug is affecting also extensions like Write Area or FEBE
Comment 1 User image Michael Kraft [:morac] 2008-12-11 13:46:41 PST
Created attachment 352599 [details]
Screenshot of problem

Result of the following command:
window.openDialog("http://www.yahoo.com", "Window", "modal")

Note that the only thing that can be seen of the browser window is the scroll
bars.  The actual window and contents are transparent.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20081211 Minefield/3.2a1pre
Comment 2 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-11 13:53:05 PST
window.openDialog("http://www.yahoo.com", "Window", "modal") seems to work fine on Mac. So do window.openDialog("about:blank", "Window", "modal") and window.openDialog("about:blank", "Window", "modal") (although the latter creates a very tiny window that's hard to find).

So I think this is now a Windows-only bug.
Comment 3 User image chris hofmann 2008-12-12 15:18:38 PST
sounds like this blocks at least one addon from being compat with 3.1. see bug 411784.  

have we decided on blocking status, or what we are going to do with this bug?
Comment 4 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-12 15:20:52 PST
I'll need to confirm with dbaron, but I'm quite sure this will get blocking status.
Comment 5 User image Aaron Irvine 2008-12-14 00:41:48 PST
This block FF3.1b2 with "abcTajpu" extension (although the "traduku" extension which also uses openDialog (though in a simpler way with .writes rather than load via chrome:ext/bla/some.html) does seem to work without blocking).
Comment 6 User image John J. Barton 2008-12-14 09:54:46 PST
I think this may be a duplicate of 465993
Comment 7 User image Chuck Baker 2008-12-14 12:00:08 PST
It should be noted that this bug affects Thunderbird v3.0b1 also.
Comment 8 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-16 01:52:57 PST
Created attachment 353185 [details]
screenshot

window.openDialog("http://www.yahoo.com", "Window", "modal") worked just fine for me in my trunk WinXP build. Here's a screenshot. OK, some bits of Yahoo loaded in a strange way but that's not what this bug is about, I guess.
Comment 9 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-16 02:03:33 PST
However, the examples in comment #0

window.openDialog("about:blank", "Window", "width=780,height=500")
window.openDialog("about:blank", "Window", "modal")

don't work for me. The window is invisible.
Comment 10 User image Alfonso Martinez 2008-12-16 07:58:28 PST
(In reply to comment #8)
> Created an attachment (id=353185) [details]
> screenshot
> 
> window.openDialog("http://www.yahoo.com", "Window", "modal") worked just fine
> for me in my trunk WinXP build. Here's a screenshot. OK, some bits of Yahoo
> loaded in a strange way but that's not what this bug is about, I guess.

Right, the same problem exists in Firefox 3.0.4, and there might be another bug to track it (I didn't care to search it as it might be specific to the way the page is created, all that html seems to be 1x1 tracking images).
Comment 11 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-17 20:32:38 PST
OK, the key problem here is that opening about:blank (or any document without an explicit background-color) creates a window in translucent mode! And HTML documents don't really support that so things go very wrong. If you open an HTML document with an explicit background color on the HTML or BODY elements, it should work fine.

I'm not 100% sure what to do about this. I suppose for now we should force non-XUL root chrome documents to get the default background color that they'd get if they were top-level content documents.
Comment 12 User image IU 2008-12-17 22:15:47 PST
(In reply to comment #11)
> OK, the key problem here is that opening about:blank (or any document without
> an explicit background-color) creates a window in translucent mode!

By observation, I can confirm that this is the case.  With the Write Area extension activated by choosing "Edit in a Write Area" from a textarea, when you right-click the window-less Write Area entry on the Windows Taskbar, choose Size, and then slowly move your mouse around the top-left area of the screen, you can trace out the invisible window, as the mouse pointer changes to the resize pointers.
Comment 13 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-18 01:04:20 PST
Created attachment 353647 [details] [diff] [review]
fix

On Windows XP at least, window transparency doesn't work well with child windows, so when the document root is scrollable (which all non-XUL-root documents are, except for framesets) there's a widget for the scrollport which messes everything up. So we may as well restrict transparent/translucent toplevel windows to those whose root element is a XUL element, at least until translucent HTML windows work better.

Most of the patch is just restructuring this function.
Comment 14 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-18 01:07:47 PST
Aside from this fix, it would be good if extension authors used documents with background colors so they don't start getting transparent documents at some point in the future. Although if we make translucent HTML documents work properly, so that the content is actually rendered, at least it will be obvious what's going on when a window starts being translucent.
Comment 15 User image David Baron :dbaron: ⌚️UTC-8 2008-12-26 09:22:54 PST
Comment on attachment 353647 [details] [diff] [review]
fix

r+sr=dbaron
Comment 16 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2008-12-29 00:22:32 PST
Pushed 295ef42f86d4
Comment 17 User image IU 2008-12-30 00:44:29 PST
I can confirm that this is now fixed with respect to the "Write Area" extension.
Comment 18 User image Ronald Killmer 2008-12-30 17:51:31 PST
Just an FYI, This issue was seen in Shredder 3.0b2pre before Christmas, when I was evaluating the ViewAbout extension and the About: feature of MR Tech Toolkit extension. I was seeing some about: dialogs that were invisible but for scroll bar or mouse pointer swap tracing.

Glad to read this was found in core and worked on.
Comment 19 User image Robert O'Callahan (:roc) (email my personal email if necessary) 2009-01-08 18:18:26 PST
Pushed f8e4d4e71b88 to 1.9.1
Comment 20 User image Ronald Killmer 2009-01-09 15:15:52 PST
Feedback that the fix worked for the invisible about:cache in Shredder.  Thank You for solving this bug.
Comment 21 User image Chuck Baker 2009-01-10 12:06:41 PST
Fix now properly displays dialog windows in TEBE with Shredder 01/10 nightly.

Note You need to log in before you can comment on or make changes to this bug.