Bug 598824 is looking at the bigger picture for how tab-modal prompts should work (eg, focus the tab or not, style/pulse the tab when a prompt is waiting, switching tabs only when the browser is in the background, etc). In the short term, and as a "safety", we should have the ability for tab-modal prompts to focus their tab. Failure to do so may be a usability issue for some sites (such as Google Calendar event reminders). We may even just not change things beyond this patch for FF4, and revisit the issue (in bug 598824) for FF-next, when other prompts (like HTTP auth) may be tab-modal and there's a greater need to solve it.
Created attachment 494630 [details] [diff] [review] Patch v.1 Simple patch that resurrects some code from older patches in bug 59314. One interesting edge case is what to do when a tab in a background *window* opens a prompt. With window-modal prompts, that window is raised to the foreground (of the app group), and if the app was in the background the OS window manager indicates that the app wants attention (EG window flashes + taskbar pulses on Win7, OS X dock icon bounces). I think I'd prefer to handle that case in a followup (or bug 598824?), and not here. Needs some thought -- if the long term plan is to not focus the tab, then the window probably shouldn't vie for the user's attention.
Summary: Add ability for tab-modal prompts to focus the tab they're opened from → Add ability for tab-modal prompts to select the tab they're opened from
Comment on attachment 494630 [details] [diff] [review] Patch v.1 Can we omit the pref, and just always fire the event/do the tab switching? I think some people use the event to detect dialog openings (e.g. bug 570115, though the exact use case there isn't explicitly mentioned...), and it'd be confusing for the switch_to_tab pref to have an effect on that.
(In reply to comment #2) > Can we omit the pref, and just always fire the event/do the tab switching? I > think some people use the event to detect dialog openings I'd expect any usage to be quite rare -- Google only gives me 340 hits for "DOMWillOpenModalDialog". And I'd bet that any addons using it will be broken anyway, because it's not going to find any window-modal dialog open. [For anyone trying to do this, I'd instead recommend the common-dialog-loaded / tabmodal-dialog-loaded notifications.] I figured a pref made sense so that whenever we do land a tab-pulse to indicate a waiting prompt, it's just a pref flip (and people can use the same pref to get the old behavior). But I guess we can deal with that then, and leave it out for now.
Created attachment 495788 [details] [diff] [review] Patch v.2
Summary: Add ability for tab-modal prompts to select the tab they're opened from → make tab-modal prompts to select the tab they're opened from
Comment on attachment 495788 [details] [diff] [review] Patch v.2 Also firing DOMModalDialogClosed would make me happier, even if it's unlikely to matter much in practice.
Created attachment 496081 [details] [diff] [review] Patch v.3 Added close event.
Attachment #495788 - Attachment is obsolete: true
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
You need to log in before you can comment on or make changes to this bug.