<?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>247416</bug_id>
          
          <creation_ts>2022-11-03 01:33:30 -0700</creation_ts>
          <short_desc>focus-visible is triggered when opening dialog using mouse</short_desc>
          <delta_ts>2026-03-05 11:02:41 -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>Forms</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac (Apple Silicon)</rep_platform>
          <op_sys>macOS 13</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>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreas Ehrencrona">andreas.ehrencrona</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>akeerthi</cc>
    
    <cc>a_protyasha</cc>
    
    <cc>ben.carr</cc>
    
    <cc>brian</cc>
    
    <cc>cdumez</cc>
    
    <cc>danilukmateusz92</cc>
    
    <cc>jose.lages.d12</cc>
    
    <cc>kamil.zacek</cc>
    
    <cc>lily_spiniolas</cc>
    
    <cc>matias.emanuel.surdi</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>ntim</cc>
    
    <cc>Rican7</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1910018</commentid>
    <comment_count>0</comment_count>
      <attachid>463380</attachid>
    <who name="Andreas Ehrencrona">andreas.ehrencrona</who>
    <bug_when>2022-11-03 01:33:30 -0700</bug_when>
    <thetext>Created attachment 463380
Repro

When opening a dialog using `showModal`, the first focusable element is given focus. So far so good.

However, the element always receives a focus highlight. In fact, `:focus-visible` is triggered. I would expect this not happen if I use a mouse to open the dialog.

See the attached reproduction, where clicking the open button shows a dialog with button with a pink border. The pink border is from a `:focus-visible` style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911479</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-11-10 00:34:18 -0800</bug_when>
    <thetext>&lt;rdar://problem/102181392&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2003545</commentid>
    <comment_count>2</comment_count>
    <who name="Brian Birtles">brian</who>
    <bug_when>2024-01-08 00:46:58 -0800</bug_when>
    <thetext>This affects iOS too.

Additional repro: https://developer.mozilla.org/en-US/play?id=rinvhv4MRjLWRSyElPfnYRbOVnUv3WDOuI9WLVn0DjHYPdO2rPvcp1b5itMuo4KLtQ2QRjEdUUvv0oqn</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2182084</commentid>
    <comment_count>3</comment_count>
    <who name="José Lages">jose.lages.d12</who>
    <bug_when>2026-02-16 08:25:28 -0800</bug_when>
    <thetext>Any news on a possible fix for this bug?

Still happens on macos and ios.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2182085</commentid>
    <comment_count>4</comment_count>
    <who name="José Lages">jose.lages.d12</who>
    <bug_when>2026-02-16 08:26:44 -0800</bug_when>
    <thetext>(In reply to José Lages from comment #3)
&gt; Any news on a possible fix for this bug?
&gt; 
&gt; Still happens on macos and ios.

and webview</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2187343</commentid>
    <comment_count>5</comment_count>
    <who name="Mateusz Daniluk">danilukmateusz92</who>
    <bug_when>2026-03-05 05:00:00 -0800</bug_when>
    <thetext>https://bugs.webkit.org/show_bug.cgi?id=309245</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2187446</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2026-03-05 11:02:41 -0800</bug_when>
    <thetext>*** Bug 309245 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>463380</attachid>
            <date>2022-11-03 01:33:30 -0700</date>
            <delta_ts>2025-03-04 22:00:00 -0800</delta_ts>
            <desc>Repro</desc>
            <filename>file_247416.html</filename>
            <type>text/html</type>
            <size>616</size>
            <attacher name="Andreas Ehrencrona">andreas.ehrencrona</attacher>
            
              <data encoding="base64">PGRpYWxvZz4NCiAgPHA+VGV4dCBnb2VzIGhlcmU8L3A+DQogIDxidXR0b24gaWQ9ImNsb3NlQnV0
dG9uIiB0eXBlPSJyZXNldCI+Q2xvc2U8L2J1dHRvbj4NCjwvZGlhbG9nPg0KDQo8YnV0dG9uIGlk
PSJvcGVuQnV0dG9uIj5PcGVuIGRpYWxvZzwvYnV0dG9uPg0KDQo8c2NyaXB0Pg0KICAoKCkgPT4g
ew0KICAgIGNvbnN0IGRpYWxvZyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoImRpYWxvZyIpOw0K
DQogICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIm9wZW5CdXR0b24iKS5hZGRFdmVudExpc3Rl
bmVyKCJjbGljayIsICgpID0+IHsNCiAgICAgIGRpYWxvZy5zaG93TW9kYWwoKTsNCiAgICB9KTsN
Cg0KICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjbG9zZUJ1dHRvbiIpLmFkZEV2ZW50TGlz
dGVuZXIoImNsaWNrIiwgKCkgPT4gew0KICAgICAgZGlhbG9nLmNsb3NlKCk7DQogICAgfSk7DQog
IH0pKCk7DQo8L3NjcmlwdD4NCg0KPHN0eWxlPg0KICBidXR0b246Zm9jdXMgew0KICAgIG91dGxp
bmU6IDJweCBkb3R0ZWQgb3JhbmdlOw0KICB9DQoNCiAgYnV0dG9uOmZvY3VzLXZpc2libGUgew0K
ICAgIG91dGxpbmU6IDJweCBkb3R0ZWQgcGluazsNCiAgfQ0KPC9zdHlsZT4NCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>