<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>234516</bug_id>
          
          <creation_ts>2021-12-20 09:23:53 -0800</creation_ts>
          <short_desc>Focus ring missing on range</short_desc>
          <delta_ts>2024-02-19 13:03:55 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="James Craig">jcraig</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>akeerthi</cc>
    
    <cc>annevk</cc>
    
    <cc>bfulgham</cc>
    
    <cc>info</cc>
    
    <cc>ntim</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.org</cc>
    
    <cc>wenson_hsieh</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1825633</commentid>
    <comment_count>0</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2021-12-20 09:23:53 -0800</bug_when>
    <thetext>From https://twitter.com/romainmenke/status/1472569307993448457

“…Safari 15.2 no longer show[s] a focus ring for input type=&quot;range&quot;? I can make it work by toggling ‘Enable Full Keyboard Access’ in System preferences, but this wasn’t required before.”</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1825635</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-12-20 09:25:48 -0800</bug_when>
    <thetext>&lt;rdar://problem/86727390&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2012610</commentid>
    <comment_count>2</comment_count>
    <who name="Curtis Wilcox">webkit.org</who>
    <bug_when>2024-02-11 09:29:52 -0800</bug_when>
    <thetext>This problem still exists in Safari 17.3. 

Testcase:
https://cdpn.io/pen/debug/XWGxxbr

Enabling Full Keyboard Access adds an OS-level focus ring (in the macOS Accent color) in addition to the browser&apos;s. Range inputs should have a User Agent-defined focus ring, just like any other focusable element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2012786</commentid>
    <comment_count>3</comment_count>
    <who name="Kamil Tomšík">info</who>
    <bug_when>2024-02-12 11:08:37 -0800</bug_when>
    <thetext>I think range input should be also accessible via keyboard (TAB), and if you check the testcase by Curtis, it&apos;s clearly not working there.

BTW: also interesting, if you add focus style for the -webkit-slider-thumb it is only active if you trigger focus event directly from JS. If you click the thumb by hand it never gets focused. And if you focus using JS and then hit TAB, it will skip all other ranges entirely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2014176</commentid>
    <comment_count>4</comment_count>
    <who name="Curtis Wilcox">webkit.org</who>
    <bug_when>2024-02-15 15:00:49 -0800</bug_when>
    <thetext>(In reply to Kamil Tomšík from comment #3)
&gt; I think range input should be also accessible via keyboard (TAB), and if you
&gt; check the testcase by Curtis, it&apos;s clearly not working there.

Range inputs are keyboard navigable and operable, pressing Tab moves focus to it, it&apos;s just missing a visible focus indicator in Safari. To operate, use arrow keys to change the value; right or up to increase, left or down to decrease, at least in a LTR language.

&gt; If you click the thumb by hand it never gets focused

Safari has long used heuristics to avoid showing a focus ring for elements focused by pointer, basically what :focus-visible became.

The default focus ring should be around the entire input, not the thumb, that&apos;s how browsers do it. Changing the appearance of the thumb on focus is a decent idea but you can also click the pointer anywhere on the track to change the value and the thumb alone is a relatively small target size (roughly 16x16).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2014195</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-15 15:41:25 -0800</bug_when>
    <thetext>Just taking some notes - which might be completely wrong:

1) Add &apos;range&apos; in CSSValueKeywords.in: 

https://searchfox.org/wubkat/rev/c40451f6052e2805fb1c6abfb61fa322c67caf5b/Source/WebCore/css/CSSValueKeywords.in#901

2) Next Update &apos;StyleAppearance.h&apos;:

https://searchfox.org/wubkat/rev/c40451f6052e2805fb1c6abfb61fa322c67caf5b/Source/WebCore/style/StyleAppearance.h#37

3) Update &apos;RenderTheme&apos;:

(RenderTheme::supportsFocusRing)

https://searchfox.org/wubkat/rev/c40451f6052e2805fb1c6abfb61fa322c67caf5b/Source/WebCore/rendering/RenderTheme.cpp#1136

___

Just hypothetical without any testing on how to get this fixed but didn&apos;t tried.

@Anne - you have &apos;RenderTheme&apos; expertise. Any input?

&amp; @Tim - any input?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2015224</commentid>
    <comment_count>6</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2024-02-19 13:03:55 -0800</bug_when>
    <thetext>1/2 shouldn&apos;t be needed. Range controls already have their own appearance (Slider*). 3 might help, would require some testing.

We&apos;d also want to double check how AppKit and UIKit render the focus ring for this control to ensure we match that for the native appearance.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>