Closed Bug 1636998 Opened 4 years ago Closed 4 years ago

no focus ring on radios and checkboxes in some themes.

Categories

(Core :: Layout: Form Controls, defect)

78 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox-esr68 --- unaffected
firefox76 --- unaffected
firefox77 --- unaffected
firefox78 --- fixed

People

(Reporter: aja, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Non-reduced test case: https://jsfiddle.net/jnwbysoq/
scroll down to the Forms section

Actual results:

No focus outline on radios and checkboxes
Probable regression with landing of bug 1311444, though haven't run a mozregression on it.

Expected results:

Focus outline on radios and checkboxes

Summary: no focus ring on radios and checkboxes → no focus ring on styled radios and checkboxes

(In reply to Bill Goldstein [:aja] (UTC-6) from comment #0)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Non-reduced test case: https://jsfiddle.net/jnwbysoq/
scroll down to the Forms section

Actual results:

No focus outline on radios and checkboxes
Probable regression with landing of bug 1311444, though haven't run a mozregression on it.

Expected results:

Focus outline on radios and checkboxes

On STYLED radios/checkboxes, native or non-native. (On win, if that's relevant).

Flags: needinfo?(emilio)

With a lot of extraneous stuff removed: https://jsfiddle.net/2f5yeLz9/

With non-native, you mean widget.disable-native-theme-for-content=true, right?

If so, I can see it only if the chedckbox is not checked.

Assignee: nobody → emilio
Status: UNCONFIRMED → NEW
Ever confirmed: true
Regressed by: 1311427
Flags: needinfo?(emilio)
Summary: no focus ring on styled radios and checkboxes → no focus ring on radios and checkboxes in some themes.

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

With non-native, you mean widget.disable-native-theme-for-content=true, right?

If so, I can see it only if the chedckbox is not checked.

Correct, widget.disable-native-theme-for-content=true pref.
I see no focus ring on either radio or checkbox, checked or not.
I do, however, see some indication of a focus state on unchecked checkbox: its border remains and its background changes.

Regressed by: 1311444

(In reply to Bill Goldstein [:aja] (UTC-6) from comment #4)

Correct, widget.disable-native-theme-for-content=true pref.
I see no focus ring on either radio or checkbox, checked or not.
I do, however, see some indication of a focus state on unchecked checkbox: its border remains and its background changes.

Yeah, that's what should ideally happen. If there's focus indicator from the theme then we shouldn't paint the focus ring.

I could maybe see having radios/checkboxes default to outline:none, though I'd think that'd be suboptimal.

But ignoring them when styled with outline-* properties entirely?
Certainly that'd be counter-intuitive and a web compat issue since blink/edgium do render the outline-* properties on checkboxes and checked radios when :focus / :focus-visible apply.

Am I missing something here?

Turns out we did have a hook for this already! But it is used to draw or
not inner button styles, so not quite equivalent.

I had to expand the amount of things it applies to because buttons and
such do paint focus indicators in all widgets. This patch could cause
some undesired outlines in some widgets. I hope not (I tried to audit to
the best of my knowledge), but in that case they'd be just more values
to add to the list.

See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.

In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.

Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.

(In reply to Bill Goldstein [:aja] (UTC-6) from comment #6)

I could maybe see having radios/checkboxes default to outline:none, though I'd think that'd be suboptimal.

But ignoring them when styled with outline-* properties entirely?
Certainly that'd be counter-intuitive and a web compat issue since blink/edgium do render the outline-* properties on checkboxes and checked radios when :focus / :focus-visible apply.

Am I missing something here?

Yeah, what Chrome at least does is quite similar to what I'm proposing. It makes outline-style: auto on a themed checkbox do something different than on a <div> (something theme-dependent). That's the focus indicator bit. If the author uses other outline style then we'd honor it just normally.

Because this bug's Severity is normal and has not been changed, and this bug's priority is -- (none,) indicating it has has not been previously triaged, the bug's Severity is being updated to -- (default, untriaged.)

Assignee: emilio → nobody
Severity: normal → --
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Keywords: leave-open
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f5546bfc9604
Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame
Flags: needinfo?(emilio)

(In reply to Pulsebot from comment #11)

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f5546bfc9604
Only suppress auto-style outlines for widgets that paint their own focus
indicator. r=jfkthame

Tested this (backed-out) autoland build (on win10/64), and now get outline showing on checkboxes and checked radios with non-auto/none outline-styles.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/18afbaa4a006
Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame

I think bug 1311427 was accidentally added o the Regressed by field. It's a duplicate so shouldn't be there.

No longer regressed by: 1311427
Has Regression Range: --- → yes
Severity: -- → S2
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/62ad26fbfaf8
Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/70102e3f7b28
Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt

Set release status flags based on info from the regressing bug 1311444

Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/40d09276fc4f
Mark a known-failing test as random.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
Blocks: 1655859
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: