Closed Bug 1506510 Opened 6 years ago Closed 6 years ago

Focus styling for toolbar buttons

Categories

(Firefox :: Theme, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 67
Tracking Status
firefox67 --- fixed

People

(Reporter: Jamie, Assigned: yzen)

References

Details

Attachments

(4 files, 7 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
2.24 KB, image/png
Details
9.41 MB, video/quicktime
Details
47 bytes, text/x-phabricator-request
Details | Review
Spun off bug 1436086 comment 12. Bug 1436086 will make it possible to focus all toolbar buttons with the keyboard. At present, these buttons aren't styled correctly for focus. Yura posted a quick fix for testing here: https://pastebin.mozilla.org/9084896 Note that this only currently covers buttons on the toolbar itself; i.e. it doesn't cover the buttons inside the urlbar.
Priority: -- → P1
Component: Toolbars and Customization → Theme
Status: NEW → ASSIGNED

Is the plan to enable this by default for all users or will users have to opt in?

To the extent that this is an accessibility feature, I'd like to better cater for users with subpar vision, where I think the proposed styling is likely not good enough. I'd therefore prefer a traditional dotted focus ring.

Flags: needinfo?(yzenevich)

Answering for Yura: The plan is to definitely turn this on for all users, and later, possibly even remove the pref so this cannot be disabled any more and is just the default behavior.

Flags: needinfo?(yzenevich)

That doesn't actually answer the main part of my comment.

Flags: needinfo?(yzenevich)

(In reply to Dão Gottwald [::dao] from comment #2)

Is the plan to enable this by default for all users or will users have to opt in?

To the extent that this is an accessibility feature, I'd like to better cater for users with subpar vision, where I think the proposed styling is likely not good enough. I'd therefore prefer a traditional dotted focus ring.

I guess there are several things we can do:

  1. Remove styling proposed by this patch (e.g. consistent with hover styling) and reinstate the dotted outline styling.
  2. Add dotted outline styling in addition to the styling proposed by this patch.
  3. Enhance proposed styling to have better contrast and either have or not have the dotted outline.

Personally I would prefer 3 without the dotted outline.
Thoughts?

Flags: needinfo?(yzenevich) → needinfo?(dao+bmo)

(In reply to Yura Zenevich [:yzen] from comment #5)

I guess there are several things we can do:

  1. Remove styling proposed by this patch (e.g. consistent with hover styling) and reinstate the dotted outline styling.
  2. Add dotted outline styling in addition to the styling proposed by this patch.
  3. Enhance proposed styling to have better contrast and either have or not have the dotted outline.

Personally I would prefer 3 without the dotted outline.

I imagine it might be quite difficult to meet a11y contrast requirements with option 3, but I guess you could give it a try. Option 2 would work but might look weird and in the end worse than option 1...

Flags: needinfo?(dao+bmo)
Attached image Version 1 (original) (obsolete) —

Eric, Dão could you comment on if you like any of the focus styles or perhaps something else?

Note I am also adding a transition for the box shadow to make the focus and focus change more noticeable (for a11y purposes).

Flags: needinfo?(epang)
Flags: needinfo?(dao+bmo)

(In reply to Yura Zenevich [:yzen] from comment #9)

Created attachment 9045645 [details]
Version 3 (box shadow only - low contrast same as active toolbar bg colour)

I'm not sure what "active toolbar bg colour" means. Can you elaborate?

Created attachment 9045649 [details]
Version 6 (box shadow only - corresponds to platform focus ring colour)

There's no such thing on Windows and Linux, I don't think. We'd have to use some custom color.

By default, focus rings are dotted and use the current text color on Windows and Linux. Incidentally, this guarantees sufficient contrast.

Flags: needinfo?(dao+bmo) → needinfo?(yzenevich)

FYI, here's how the toolbar button focus ring looks in Edge. It's way more prominent than their hover styling. Apparently they opted for maximum visibility, most likely for accessibility reasons.

Attachment #9045643 - Attachment is obsolete: true
Flags: needinfo?(yzenevich)
Attachment #9045644 - Attachment is obsolete: true
Attachment #9045645 - Attachment is obsolete: true
Attachment #9045646 - Attachment is obsolete: true
Attachment #9045648 - Attachment is obsolete: true
Attachment #9045649 - Attachment is obsolete: true

This version uses currentColor for the colour of the focus styling. I like that it would be consistent with the original dotted outline. Contrast seems to be good too.

Attachment #9046568 - Flags: feedback?(dao+bmo)

Comment on attachment 9046568 [details]
Version if currentColor styling (mac)

Looks good to me. If wanted we could also use the native blue on Mac and currentColor on the other platforms.

Attachment #9046568 - Flags: feedback?(dao+bmo) → feedback+

From a visual perspective, this works for me, thanks Yura!

Flags: needinfo?(epang)
Attachment #9047499 - Attachment is obsolete: true
Pushed by yura.zenevich@gmail.com: https://hg.mozilla.org/integration/autoland/rev/fffb4b5030da add keyboard focus styling for toolbar/urlbar buttons. r=dao
Pushed by yura.zenevich@gmail.com: https://hg.mozilla.org/integration/autoland/rev/19ec728351ac add keyboard focus styling for toolbar/urlbar buttons. r=dao https://hg.mozilla.org/integration/autoland/rev/3204779395ce add/fix keyboard focus styling for notification and blocked permission icon buttons. r=dao

(In reply to Pulsebot from comment #23)

Pushed by yura.zenevich@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/19ec728351ac
add keyboard focus styling for toolbar/urlbar buttons. r=dao
https://hg.mozilla.org/integration/autoland/rev/3204779395ce
add/fix keyboard focus styling for notification and blocked permission icon
buttons. r=dao

From what I can tell browser_popupNotification_keyboard.js is still going to fail here, as the first patch flips browser.toolbars.keyboard_navigation and the second patch doesn't address the implied behavior change.

Oh, looking again, I see you made quite a few test changes. Would have liked to review these too.

(In reply to Dão Gottwald [::dao] from comment #25)

Oh, looking again, I see you made quite a few test changes. Would have liked to review these too.

Sorry, yeah I made sure that the tests pass and account for the tab stops/arrow key navigation where necessary. I can request to back these out, if preferred ?

Flags: needinfo?(yzenevich) → needinfo?(dao+bmo)
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
Flags: needinfo?(dao+bmo)
Regressions: 1602870
No longer regressions: 1602870
Regressions: 1614911
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: