Open Bug 1566693 Opened 5 years ago Updated 2 years ago

Provide a way for stylesheets to opt out from default native focus ring

Categories

(Core :: Widget: Cocoa, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: ntim, Unassigned)

Details

Attachments

(1 file)

See https://twitter.com/rob_dodson/status/1151284106623254528

Testcase: https://jsbin.com/nogorefevu/1/edit?html,output

It appears Webkit+Blink let you use outline: none; to opt-out, but I don't know if this is standard.

Emilio/Cameron, do you know if there's an existing spec regarding this ?

Flags: needinfo?(emilio)
Flags: needinfo?(cam)

data:text/html,<style>::-moz-focus-inner { border: none }</style><button>Foo?

Flags: needinfo?(emilio)

Ah, you mean the mac outline.

Attached image screenshot of outline

This doesn't appear to work on macOS, I'm guessing there's some widget code involved here.

Also, is there no actual standard for this ? Chrome/Safari allow you to remove the focus outline using outline: none. Maybe Firefox should do the same ?

Flags: needinfo?(emilio)

So ok, this is what I learnt:

I don't think form controls have any proper spec for this kind of stuff, but it makes sense to do this. It seems it should be feasible to just skip that bit if the button doesn't specify an outline. Probably recording a hasOutline boolean here: https://searchfox.org/mozilla-central/rev/22b330ecb3edba1536a54887060cbdd09db21c59/widget/cocoa/nsNativeThemeCocoa.mm#1291

Like params.hasOutline = aFrame && aFrame->StyleOutline()->ShouldPaintOutline();, probably.

But this is mac-specific code, not style code. I also don't have a mac, so take anything with a grain of salt :)

Component: CSS Parsing and Computation → Widget: Cocoa
Flags: needinfo?(emilio)
Priority: -- → P3
Flags: needinfo?(cam)
Severity: normal → S3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: