Closed Bug 1545499 Opened 5 years ago Closed 5 years ago

Hide auto-style link outline when focused with mouse (was: hide dotted outline on focused (tapped) links on Firefox for Android)

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P2)

67 Branch
Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
geckoview66 --- wontfix
firefox-esr60 --- wontfix
firefox66 --- wontfix
firefox67 --- wontfix
firefox67.0.1 --- wontfix
firefox68 --- wontfix
firefox69 --- fixed

People

(Reporter: abovens, Assigned: emilio)

References

Details

(Whiteboard: [geckoview:fenix:p3][layout:backlog:2019q2])

Attachments

(2 files)

The dotted outline on tapped links feels out of place on mobile. The outline is a repurposed "focus" outline, but it's only visible for a brief moment, and doesn't add much value.

Steps to reproduce:

  1. Perform a Google search
  2. Tap on one of the search results

The tapped search result will have an outline.

This bug also affects GV in Fenix.

OS: Unspecified → Android
Whiteboard: [geckoview:fenix:p3]

Emilio: Is this just a UA stylesheet tweak for mobile on :focus, or is it more involved than that?

Flags: needinfo?(emilio)
Whiteboard: [geckoview:fenix:p3] → [geckoview:fenix:p3][layout:backlog:2019q2]

We have prefs to control the default focus outline already that could be tweaked (browser.display.focus_ring_*).

Though note that the ugly outline described in https://github.com/mozilla-mobile/fenix/issues/2184 in Google search should be fixed on trunk via bug 1548809.

Flags: needinfo?(emilio)

Note that I'd still like focus outlines to work (e.g. for when a physical keyboard is used on Android tablets). However, the outline shouldn't be shown when just tapping a link.

So CSS basically knows whether something is focused or not. Let me check what WebKit or Blink do...

Looking at Blink, it looks like they only show the focus outlines for anchors if they weren't focused with the mouse (which also includes taps of course):

And the outline-style is auto (so if you manually specify other outline-style it'd show up):

This behavior also applies to desktop. I think associating this with outline-style: auto makes sense, and implementing something like this shouldn't be too terrible.

WDYT Andreas? Do you think something like that a reasonable behavior? Or do you also want non-auto outlines to be suppressed and such?

Flags: needinfo?(abovens)

Sorry for the late answer. That seems like a good path forward indeed.

Flags: needinfo?(abovens)
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Component: General → User events and focus handling
Flags: needinfo?(emilio)
Product: Firefox for Android → Core
Summary: Hide dotted outline on focused (tapped) links on Firefox for Android → Hide auto-style outline when focused with mouse (was: hide dotted outline on focused (tapped) links on Firefox for Android)
Version: Firefox 67 → 67 Branch

Hmm, looking a bit more into it, this should (kind-of) already be happening. This is what :-moz-focuring is supposed to do... But it doesn't.

I'm seeing some very bizarre things. For example, if I open this from a file (let's call it t.html), it does show a focus outline, since we put a :-moz-focusring pseudo-class on it.

<!doctype html><a href="foo">Link</a>

However if I load it from a data URI: data:text/html,<!doctype html><a href="foo">Link</a>, then it works as I'd expect reading the code...

So there's something somewhat weird here.

Flags: needinfo?(emilio)
See Also: → focus-visible, 418521
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

It's only moved around, but not actually used anywhere.

I have no idea what this was supposed to control in the past but it doesn't seem
useful to keep it around.

This pref toggled gives me the desired behavior on Linux, and it should be
trivial to revert to the previous behavior if needed.

Depends on D33393

I have no idea what this was supposed to control in the past but it doesn't seem
useful to keep it around.

It's there in case someone wants to implement bug 25894.

(In reply to Neil Deakin from comment #10)

I have no idea what this was supposed to control in the past but it doesn't seem
useful to keep it around.

It's there in case someone wants to implement bug 25894.

Maybe the code should be re-introduced then? It's mostly plumbing.

But I'm happy to keep it around, just let me know.

Priority: -- → P2
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8d2dcfb9a9b6
Remove dead code for threading accelerator state. r=NeilDeakin
https://hg.mozilla.org/integration/autoland/rev/62c41bc07a49
Make whether to show focus-rings for all content by default a pref, and disable it on Android. r=NeilDeakin

68=wontfix because it's a little late in the 68 Beta cycle to uplift a UX style fix.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69

QA found that the play button on speedtest.telstra.com still shows an outline while tapping it, and I can reproduce.
See https://github.com/mozilla-mobile/fenix/issues/2184#issuecomment-533530018

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

Please file a different bug to investigate that, rather than reopening fixed bugs.

I've checked and at least on google results and normal links there's no outline anymore, so chances are this is a problem specific to that website.

Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Flags: needinfo?(ekager)
Resolution: --- → FIXED

In particular, that page doesn't use a link, it uses a <button>, so what you're seeing is not the outline but the ::-moz-focus-inner border. Which websites can override, but probably won't.

So we need to come up with a solution for that I guess, but that's a totally different issue (see also bug 1580935).

(In reply to Emilio Cobos Álvarez (:emilio) from comment #18)

In particular, that page doesn't use a link, it uses a <button>, so what you're seeing is not the outline but the ::-moz-focus-inner border. Which websites can override, but probably won't.

So we need to come up with a solution for that I guess, but that's a totally different issue (see also bug 1580935).

I filed bug 1583381 for the <button> outline issue. Chrome doesn't show a dotted button outline, but it does flash a blue highlight box for the same button.

Flags: needinfo?(ekager)
See Also: → 1583381
Summary: Hide auto-style outline when focused with mouse (was: hide dotted outline on focused (tapped) links on Firefox for Android) → Hide auto-style link outline when focused with mouse (was: hide dotted outline on focused (tapped) links on Firefox for Android)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: