forked from mirrors/gecko-dev
Bug 1756210 - Let native theme focus outline be controlled only by CSS. r=mstange
This might be a bit more controversial, but matches Chromium at least, and it makes sense to me... Would've also fixed this particular bug, though I think the previous patch is also desirable if devtools ever wants to add `:disabled` locked states or so. Depends on D140529 Differential Revision: https://phabricator.services.mozilla.com/D140530
This commit is contained in:
parent
340de6fd0f
commit
a819845751
5 changed files with 19 additions and 6 deletions
|
|
@ -9,8 +9,8 @@
|
|||
|
||||
<html:style xmlns:html="http://www.w3.org/1999/xhtml" type="text/css">
|
||||
* { outline: none; }
|
||||
#b3 { outline: auto }
|
||||
#l1:-moz-focusring, #l3:-moz-focusring, #b1:-moz-focusring { outline: 2px solid red; }
|
||||
#b3:focus-visible { outline: auto }
|
||||
#l1:focus-visible, #l3:focus-visible, #b1:focus-visible { outline: 2px solid red; }
|
||||
#l2:focus, #b2:focus { outline: 2px solid red; }
|
||||
</html:style>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<style>
|
||||
input { caret-color: transparent }
|
||||
</style>
|
||||
<input autofocus>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<!doctype html>
|
||||
<style>
|
||||
input { outline-style: auto }
|
||||
</style>
|
||||
<input>
|
||||
|
|
@ -14,6 +14,7 @@ pref(layout.css.outline-style-auto.enabled,false) == outline-auto-001.html outli
|
|||
skip-if(nativeThemePref) != outline-auto-follows-border-radius-non-native.html outline-auto-follows-border-radius-non-native-notref.html
|
||||
skip-if(nativeThemePref) == outline-auto-follows-border-radius-non-native-02.html outline-auto-follows-border-radius-non-native.html
|
||||
needs-focus skip-if(nativeThemePref) == outline-auto-suppressed-native-widget.html outline-auto-suppressed-native-widget-ref.html
|
||||
needs-focus skip-if(nativeThemePref) == outline-auto-explicit-native-widget.html outline-auto-explicit-native-widget-ref.html
|
||||
== outline-initial-1a.html outline-initial-1-ref.html
|
||||
== outline-initial-1b.html outline-initial-1-ref.html
|
||||
== outline-on-table.html outline-on-table-ref.html
|
||||
|
|
|
|||
|
|
@ -1065,10 +1065,12 @@ bool Theme::DoDrawWidgetBackground(PaintBackendData& aPaintData,
|
|||
}
|
||||
}
|
||||
|
||||
// Don't paint the outline if we're asked not to draw overflow, or if the
|
||||
// author has specified another kind of outline on focus.
|
||||
if (aDrawOverflow == DrawOverflow::No ||
|
||||
!aFrame->StyleOutline()->mOutlineStyle.IsAuto()) {
|
||||
// Paint the outline iff we're asked to draw overflow and we have
|
||||
// outline-style: auto.
|
||||
if (aDrawOverflow == DrawOverflow::Yes &&
|
||||
aFrame->StyleOutline()->mOutlineStyle.IsAuto()) {
|
||||
eventState |= NS_EVENT_STATE_FOCUSRING;
|
||||
} else {
|
||||
eventState &= ~NS_EVENT_STATE_FOCUSRING;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue