Closed Bug 711624 Opened 14 years ago Closed 13 years ago

JS prompt dialog will appear in the foreground when loading the page with the code in the background

Categories

(Firefox for Android Graveyard :: General, defect, P3)

ARM
Android
defect

Tracking

(firefox15 verified, blocking-fennec1.0 +, fennec11+)

VERIFIED FIXED
Firefox 13
Tracking Status
firefox15 --- verified
blocking-fennec1.0 --- +
fennec 11+ ---

People

(Reporter: nhirata, Assigned: Margaret)

References

()

Details

Attachments

(1 file)

1. go to http://people.mozilla.com/~nhirata/html_tp 2. long tap on PasswordPrompt.html 3. select Open Link in New Tab Expected: dialog will appear after you switch to the tab Actual: dialog appears in the current tab.
Since our JS prompt dialogs are not tab modal, we'll need to bring the page that spawned the dialog to the front.
Priority: -- → P3
tracking-fennec: --- → 11+
blocking-fennec1.0: --- → ?
blocking-fennec1.0: ? → +
Assignee: nobody → margaret.leibovic
Depends on: 733233
Attached patch patchSplinter Review
I basically just copied what desktop does: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/prompts/src/nsPrompter.js#415 http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#2653 I also added a small optimization to selectTab to avoid sending unnecessary messages.
Attachment #603164 - Flags: review?(wjohnston)
Also, we should file a follow-up to get rid of the dead code in PromptService.js!
Comment on attachment 603164 [details] [diff] [review] patch Review of attachment 603164 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! ::: mobile/android/chrome/content/browser.js @@ +1889,5 @@ > + > + // We're about to open a modal dialog, make sure the opening > + // tab is brought to the front. > + let tab = BrowserApp.getTabForWindow(aEvent.target.top); > + BrowserApp.selectTab(tab); I think because you're registered on the browser element, we should never receive this event when we can't get a tab here? I'm a bit worried about it, but I'm willing to give this a go and add in the check later if we determine we need it. ::: mobile/android/components/PromptService.js @@ +772,5 @@ > let data = Cc["@mozilla.org/android/bridge;1"].getService(Ci.nsIAndroidBridge).handleGeckoMessage(JSON.stringify({ gecko: aMsg })); > return JSON.parse(data); > + }, > + > + fireDialogEvent: function(domWin, eventName) { aDOMWin and aEventName
Attachment #603164 - Flags: review?(wjohnston) → review+
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 13
Everything works as expected on the latest Nightly. Closing bug as Verified Fixed -- Firefox 15.0a1 (2012-05-21) Device: Galaxy Nexus OS: Android 4.0.2
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: