Closed Bug 1541457 Opened 5 years ago Closed 5 years ago

open dialog does not show up in accessibility tree

Categories

(Firefox :: Disability Access, defect, P3)

66 Branch
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: samuel.thibault, Assigned: samuel.thibault)

Details

Attachments

(2 files)

Attached file list.py

While running firefox on Linux with the gtk front-end, selecting "File"->"Open File..." opens the standard "Open File" gtk dialog box.

This dialog box however does not show up in the AT-SPI tree: accerciser does not show it, and iterating over the tree with at-spi does not find it. For instance, the attached list.py script does not find it: it prints

Firefox
'frame' 'Enter Bug: Firefox - Mozilla Firefox'

while it should print

Firefox
'frame' 'Enter Bug: Firefox - Mozilla Firefox'
'file chooser' 'Open File'

AIUI, this is because when nsFilePicker::Open() creates the dialog box with gtk_file_chooser_dialog_new, it does not register it as a toplevel window for Accessible::EmbeddedChildCount() and alike to see it.

Jamie, do you get the same issue on Windows?

(this poses problem for e.g. accessibility regression testing to be able to find the window)

Flags: needinfo?(jteh)

No, I don't see this issue on Windows. However, in Windows, at the top level, accessibility is inherently linked to the Windows "HWND" (native widget) tree. That essentially means that any OS dialog will always show up in the tree; it's impossible for an app to prevent this.

Do you know how to fix this? Is registering this as a top level window some accessibility specific thing or could this have broader implications on GTK? Otherwise, I can try to figure out who we can ask at Mozilla re (non-a11y) GTK platform stuff.

Flags: needinfo?(jteh)
Priority: -- → P3

Ok, I see.

AIUI it is a question at the top-level "application" accessible level, which is currently not listing the dialog box as a child, and then gtk will properly do the rest.

I guess it would be a matter of making the nsFilePicker properly call nsINode:doInsertChildAt(), I however don't know how nsFilePicker plugs with the nsINode structure.

Looking more into what is there, AIUI the file chooser accessibility is completely handled by gtk, not by firefox. That is noticeable because the widgets in it have the "toolkit" attribute set to "gtk", which firefox' atk glue does not do.

Put another way, AIUI what we'd need to fix this issue is to make the ApplicationAccessible managed by firefox have as additional child the FileChooserAccessible managed by gtk. While looking through the implementation, I found that toplevel_event_watcher catches gtk new windows, and makes the AddNativeRootAccessible call that does the AppendChild. What is special about the open file dialog is that its role is ATK_ROLE_FILE_CHOOSER, not ATK_ROLE_DIALOG, and only the latter is tested. I'll make & test a patch to add other roles which are dialog boxes (color chooser, etc.).

(yes, adding ATK_ROLE_FILE_CHOOSER there fixes the issue)

The proposed patch is being tested on

https://treeherder.mozilla.org/#/jobs?repo=try&revision=fe5ec10248f22c8759c2301123482a5823d633e4

(though I really doubt there can be anything showing up as broken since it's really inside the atk glue which AFAIK is not tested by the firefox testsuite)

Attachment #9055895 - Attachment description: Bug 1541457 atk: Also look for refined roles of dialog boxes r=Jamie → Bug 1541457: atk: When watching for toplevel windows to manage as native root accessibles, Also look for refined roles of dialog boxes. r=Jamie
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ec885e52de73
atk: When watching for toplevel windows to manage as native root accessibles, Also look for refined roles of dialog boxes. r=Jamie
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Assignee: nobody → samuel.thibault
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: