Closed Bug 1686989 Opened 5 years ago Closed 4 years ago

Inconsistent focus state when opening multiple SubDialogs via SubDialogManager

Categories

(Toolkit Graveyard :: Notifications and Alerts, defect)

defect

Tracking

(firefox87 verified)

VERIFIED FIXED
87 Branch
Tracking Status
firefox87 --- verified

People

(Reporter: emz, Assigned: emz)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Spawning multiple SubDialogs in a stack managed by the SubDialogManager can lead to inconsistent focus state, where dialogs get focused even when they're not on top.

Blocks: 1684469
  • Content embedded by SubDialog can define its own focus handler which will be called on SubDialog#focus
  • Updated CommonDialog to register custom focus handler
  • Moved focus calls from SubDialog to SubDialogManager
  • Return early after tab dialog focus on tab switch
Assignee: nobody → pbz
Status: NEW → ASSIGNED
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/81794f8a220b Fixed SubDialogManager focus issues and added support for custom focus handlers. r=Gijs

This failed because Bug 1680637 landed in the meantime which changed the name of the dialogManager property. I'll fix that and run it on try to be sure.

Flags: needinfo?(pbz)
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d96ac6e7874e Fixed SubDialogManager focus issues and added support for custom focus handlers. r=Gijs

Backed out for causing mochitest failures in browser_basicAuth_multiTab.

Backout link: https://hg.mozilla.org/integration/autoland/rev/2ac3e28717211455a5f1e058bba8f70f84fd09ad

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Crunning%2Cpending%2Crunnable&searchStr=mochi%2Ce10s&revision=c2d9108fee938f4ce0031f47ce2195895b6a898a&selectedTaskRun=UBb2e_d3QCimoC2jwSadnw.0

Failure log: https://treeherder.mozilla.org/logviewer?job_id=327824465&repo=autoland&lineNumber=11279

:INFO - GECKO(2835) | [Parent 2835, Main Thread] WARNING: Extra shutdown CC: 'i < NORMAL_SHUTDOWN_COLLECTIONS', file /builds/worker/checkouts/gecko/xpcom/base/nsCycleCollector.cpp:3364
[task 2021-01-26T13:24:58.635Z] 13:24:58 INFO - GECKO(2835) | [Parent 2835, Main Thread] WARNING: NS_ENSURE_TRUE(Preferences::InitStaticMembers()) failed: file /builds/worker/checkouts/gecko/modules/libpref/Preferences.cpp:4378
[task 2021-01-26T13:24:58.691Z] 13:24:58 INFO - TEST-INFO | Main app process: exit 0
[task 2021-01-26T13:24:58.692Z] 13:24:58 INFO - TEST-INFO | Confirming we saw 366 DOCSHELL created and 366 destroyed log strings.
[task 2021-01-26T13:24:58.693Z] 13:24:58 INFO - TEST-INFO | Confirming we saw 1071 DOMWINDOW created and 1071 destroyed log strings.
[task 2021-01-26T13:24:58.693Z] 13:24:58 ERROR - TEST-UNEXPECTED-FAIL | toolkit/components/passwordmgr/test/browser/browser_basicAuth_multiTab.js | leaked 2 window(s) until shutdown [url = about:blank]
[task 2021-01-26T13:24:58.694Z] 13:24:58 INFO - TEST-INFO | toolkit/components/passwordmgr/test/browser/browser_basicAuth_multiTab.js | windows(s) leaked: [pid = 2835] [serial = 44], [pid = 2835] [serial = 53]
[task 2021-01-26T13:24:58.694Z] 13:24:58 INFO - TEST-INFO | toolkit/components/passwordmgr/test/browser/browser_basicAuth_multiTab.js | This test created 1 hidden window(s):

Flags: needinfo?(pbz)
Backout by cbrindusan@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/5ca936ea4848 Backed out 2 changesets (bug 1686989, bug 1684469) for causing mochitest failures in browser_basicAuth_multiTab. CLOSED TREE
Flags: needinfo?(pbz)
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cc60105589f5 Fixed SubDialogManager focus issues and added support for custom focus handlers. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch

Hi Paul, are there any steps we can use in order to verify this issue ?

Flags: needinfo?(pbz)

You can test this with the Browser Toolbox:

  1. Open the Browser Toolbox console
  2. Spawn 3 prompts at the same time using the following command:
Services.prompt.asyncAlert(gBrowser.selectedBrowser.browsingContext, Services.prompt.MODAL_TYPE_TAB, "Title", "a")
Services.prompt.asyncAlert(gBrowser.selectedBrowser.browsingContext, Services.prompt.MODAL_TYPE_TAB, "Title", "b")
Services.prompt.asyncAlert(gBrowser.selectedBrowser.browsingContext, Services.prompt.MODAL_TYPE_TAB, "Title", "c")
  1. Focus the main window
  2. Close the prompts by pressing enter 3 times.

Expected:
Every time you press the enter key the top most prompt should close. After pressing the enter key 3 times all prompts should be closed.

Bug:
Not all prompts close because the focus is not always on the top most prompt. The prompts don't close in the correct order.

Flags: needinfo?(pbz)

Thanks a lot for the Steps Paul, This issue is Verified as fixed in Firefox 87, as well as our latest Release, Beta and Nightly builds on Windows, Mac and Ubuntu.

Status: RESOLVED → VERIFIED
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: