Closed Bug 1128175 Opened 9 years ago Closed 9 years ago

[OS X] Some dialogs in Content and Privacy in-content preferences can't be dismissed with keyboard (ESC) when only text boxes and lists can receive focus (OS-level pref)

Categories

(Firefox :: Settings UI, defect, P3)

x86
macOS
defect
Points:
2

Tracking

()

RESOLVED FIXED
Firefox 39
Iteration:
39.2 - 23 Mar
Tracking Status
firefox38 --- fixed
firefox39 --- fixed

People

(Reporter: flod, Assigned: Gijs)

References

Details

Attachments

(1 file)

Content->Fonts & Colors->Advanced… and Colors… can't be closed by pressing ESC on the keyboard. As far as I tested, all other dialogs can be closed correctly.
Same issue with Privacy -> Clear history when Firefox closes -> Settings.
Summary: [OS X] Advanced… and Colors… dialogs in Content->Fonts & Colors can't be dismissed with keyboard (ESC) → [OS X] Some dialogs in Content and Privacy in-content preferences can't be dismissed with keyboard (ESC)
Priority: -- → P3
Points: --- → 2
Can you still reproduce this on current Nightly? Because I can't...
Flags: needinfo?(francesco.lodolo)
Yes, it's still happening for all 3 dialogs. To be sure I checked with a clean profile, same behavior.

Firefox version: 38.0a1 (2015-02-12)

Take for example "Colors…": open the dialog, try to press ESC, nothing happens.

While testing I realized that, to make ESC work, I can either press "Enter" once, or change a control in the dialog (like deselect a checkbox). It's like the dialog has no focus when it's opened.
Flags: needinfo?(francesco.lodolo)
(In reply to Francesco Lodolo [:flod] from comment #3)
> Yes, it's still happening for all 3 dialogs. To be sure I checked with a
> clean profile, same behavior.
> 
> Firefox version: 38.0a1 (2015-02-12)
> 
> Take for example "Colors…": open the dialog, try to press ESC, nothing
> happens.
> 
> While testing I realized that, to make ESC work, I can either press "Enter"
> once, or change a control in the dialog (like deselect a checkbox). It's
> like the dialog has no focus when it's opened.

This is bizarre. I just checked a clean profile on my mac. Here are the exact steps I follow:

1. open profile dialog with the same nightly, on my OS X retina mbp
2. create a new profile
3. command-, to open preferences
4. click "content"
5. click "advanced"
6. hit escape

and it Just Works. Ditto for the colors dialog. :-\

What's your OS level focusable elements pref set to?
Flags: needinfo?(francesco.lodolo)
(In reply to :Gijs Kruitbosch from comment #4)
> What's your OS level focusable elements pref set to?

I wish I knew where to find that information (Google didn't help).
Note that it happens on 2 different Macs, same OS X version (10.10.2). As far as I remember, I never changed accessibility options in OS X.

The only other difference might be that I'm using a localized build (it) instead of the en-US one.
Flags: needinfo?(francesco.lodolo)
(In reply to Francesco Lodolo [:flod] from comment #5)
> (In reply to :Gijs Kruitbosch from comment #4)
> > What's your OS level focusable elements pref set to?
> 
> I wish I knew where to find that information (Google didn't help).

http://www.guidingtech.com/34353/re-enable-mavericks-features/

scroll down to "2. Using the Keyboard to Select a Button On a Dialog Box".

> Note that it happens on 2 different Macs, same OS X version (10.10.2). As
> far as I remember, I never changed accessibility options in OS X.

Maybe this is it? I'm on 10.9.

> The only other difference might be that I'm using a localized build (it)
> instead of the en-US one.

I don't see why that would make a difference, but you could try an en-US build to make sure, I guess?
Flags: needinfo?(francesco.lodolo)
(In reply to :Gijs Kruitbosch from comment #6)
> http://www.guidingtech.com/34353/re-enable-mavericks-features/
> scroll down to "2. Using the Keyboard to Select a Button On a Dialog Box".

Interesting, it works by setting "All controls". Any idea then why other dialogs work without that pref set (e.g. General -> Use a bookmark…, or even Content->Pop-up->Exceptions…)? It doesn't seem right.

> I don't see why that would make a difference, but you could try an en-US
> build to make sure, I guess?
Tried out of curiosity, same result (didn't think you were on 10.9, so that could have been one of the differences between my setup and yours).
Flags: needinfo?(francesco.lodolo)
(In reply to Francesco Lodolo [:flod] from comment #7)
> (In reply to :Gijs Kruitbosch from comment #6)
> > http://www.guidingtech.com/34353/re-enable-mavericks-features/
> > scroll down to "2. Using the Keyboard to Select a Button On a Dialog Box".
> 
> Interesting, it works by setting "All controls". Any idea then why other
> dialogs work without that pref set (e.g. General -> Use a bookmark…, or even
> Content->Pop-up->Exceptions…)? It doesn't seem right.

It is indeed not right, but I bet that focus automatically moves into the dialog in my case (I had "All controls" set already) and it fails if focusing whatever type of element it's trying to focus isn't possible (because there's no list or input field, unlike the two counterexamples you just gave!), and then focus either goes to limbo land or somewhere else where we don't catch the [esc] keypress.

Not entirely sure how to fix this, but I'm happier now that I understand where & when & why this happens. This can stay on the shipping-blocker list for now, and we'll get back to it. :-)
Summary: [OS X] Some dialogs in Content and Privacy in-content preferences can't be dismissed with keyboard (ESC) → [OS X] Some dialogs in Content and Privacy in-content preferences can't be dismissed with keyboard (ESC) when only text boxes and lists can receive focus (OS-level pref)
Note: on fx-team tip, incl. the tab-trapping patch which I just landed
Attachment #8576585 - Flags: review?(jaws)
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Iteration: --- → 39.2 - 23 Mar
Flags: qe-verify-
Flags: in-testsuite-
Flags: firefox-backlog+
Comment on attachment 8576585 [details] [diff] [review]
add explicit <esc> handler,

Review of attachment 8576585 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, I'm happy how the addDialogEventListeners/removeDialogEventListeners has simplified the various places to add and remove the event listeners. This patch is pretty straightforward :)
Attachment #8576585 - Flags: review?(jaws) → review+
https://hg.mozilla.org/mozilla-central/rev/6a64409286ca
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 39
Comment on attachment 8576585 [details] [diff] [review]
add explicit <esc> handler,

Approval Request Comment
[Feature/regressing bug #]: n/a
[User impact if declined]: closing in-content pref dialogs with escape might not work on mac depending on system pref
[Describe test coverage new/current, TreeHerder]: no
[Risks and why]: very low, simple extra keyboard event handler
[String/UUID change made/needed]: no
Attachment #8576585 - Flags: approval-mozilla-aurora?
Attachment #8576585 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: