Closed Bug 1132307 Opened 9 years ago Closed 9 years ago

Use <button> elements instead of <a> elements in reader mode toolbar

Categories

(Toolkit :: Reader Mode, defect)

x86
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla38
Tracking Status
firefox38 --- verified
firefox39 --- verified

People

(Reporter: Margaret, Assigned: Margaret)

References

Details

Attachments

(1 file)

These aren't links, they're buttons. This is more semantically correct, and it will give us better accessibility support.
On IRC, mmaslaney told me that we should be using a normal pointer, not a cursor, so I fixed that.

In bug 1131303, I'll use the strings we settle on to add aria-label attributes to these buttons, which should make them accessible for screen readers (although the font style popup is pretty useless if you're blind).
Attachment #8564377 - Flags: review?(bnicholson)
Blocks: 1131303
Comment on attachment 8564377 [details] [diff] [review]
Use <button> elements instead of <a> elements in reader mode toolbar

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

::: mobile/android/themes/core/aboutReader.css
@@ +359,5 @@
> +  border: 0;
> +  width: 100%;
> +}
> +
> +/* Rmove dotted border when button is focused */

Nit: Rmove -> Remove

@@ +360,5 @@
> +  width: 100%;
> +}
> +
> +/* Rmove dotted border when button is focused */
> +.button::-moz-focus-inner {

Why do we want to remove the inner border when the button is focused? Won't that make it impossible to determine which element is focused when tabbing (for Android keyboard users)?
Attachment #8564377 - Flags: review?(bnicholson) → review+
(In reply to Brian Nicholson (:bnicholson) from comment #2)

> @@ +360,5 @@
> > +  width: 100%;
> > +}
> > +
> > +/* Rmove dotted border when button is focused */
> > +.button::-moz-focus-inner {
> 
> Why do we want to remove the inner border when the button is focused? Won't
> that make it impossible to determine which element is focused when tabbing
> (for Android keyboard users)?

I did this because I found that with this change to a button the focus ring was appearing when users clicked on this.

I think that if we do want a focus style, it should probably be a different background or something that matches desktop.

Do you think tabbing with a keyboard even works now? That seems like a very under-tested feature.
(In reply to :Margaret Leibovic from comment #3)
> Do you think tabbing with a keyboard even works now? That seems like a very
> under-tested feature.

I think it does, but I have no idea how many people use it. I wonder why clicking a button on Android gives it focus, but desktop doesn't?
Hm, I do see a focus style on desktop if I tab to these controls: http://cl.ly/image/3G2w0N0x0j3v

I probably should just figure out why the button is getting focus when clicked on mobile, but not on desktop.
But on the bright side, this appears to make these toolbar buttons actually keyboard accessible, which they weren't before. So maybe our keyboard users on Android couldn't have navigated to these before anyway...
I decided that I need to land this, since it blocks me making the desktop toolbar buttons accessible. I'll file a follow-up to look into the focus issue on Android, but I think not having focus styles on the buttons isn't a major blocker for us.

https://hg.mozilla.org/integration/fx-team/rev/d71a3d134bf3
https://hg.mozilla.org/mozilla-central/rev/d71a3d134bf3
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
This is verified fixed on Nightly 39.0a1 (2015-03-09) and Aurora 38.0a2 (2015-03-09), using Windows 7 (x64), Ubuntu 14.04 (x86) and Mac OS X 10.9.5. The focus related issue mentioned in Comment 5 was filed as Bug 1135589.
Status: RESOLVED → VERIFIED
Flags: qe-verify+
QA Contact: andrei.vaida
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: