<?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>139945</bug_id>
          
          <creation_ts>2014-12-25 09:34:11 -0800</creation_ts>
          <short_desc>Mouse/Touch Events Can Focus Parent Element</short_desc>
          <delta_ts>2024-06-30 15:37:34 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>UI Events</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.11</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rodney Rehm">mail</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>ntim</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>vitor.roriz</cc>
    
    <cc>webkit</cc>
    
    <cc>webkit</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1057839</commentid>
    <comment_count>0</comment_count>
      <attachid>243744</attachid>
    <who name="Rodney Rehm">mail</who>
    <bug_when>2014-12-25 09:34:11 -0800</bug_when>
    <thetext>Created attachment 243744
reduced test case

reduced test case: http://medialize.github.io/ally.js/tests/browser-bugs/webkit-pointer-focus-parent.html

Clicking on an &lt;a&gt; element nested in a &lt;div tabindex=&quot;-1&quot;&gt; will cause the &lt;div&gt; to receive focus. If anything should receive focus, it should be the &lt;a&gt; element. This behavior can be observed for mousedown and touchstart.

A way to circumvent this behavior is upon mousedown removing all parental tabindex attributes, so once the mousedown handler finished the only naturally focusable element remaining is the element actually clicked upon. On mouseup the tabindex attributes must be restored. The same applies to touchstart and touchend/touchcancel.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894648</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-29 14:56:28 -0700</bug_when>
    <thetext>I am able to reproduce this bug in Safari Technology Preview 152 using attached reduction and clicking on first case where &lt;a&gt; with tab index = 1, it leads to &lt;div&gt; having focus and the &apos;red&apos; outline is extended to whole visual viewport while in case of other browsers, it is limited to similar to other case, where tab index is negative 1 and just limit to &lt;a&gt; text.

All other browsers (Chrome Canary 107 and Firefox Nightly 106) work similar in both cases and match each other. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2043858</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-06-30 15:37:34 -0700</bug_when>
    <thetext>Safari Technology Preview 197 now matches Chrome Canary 128 and Firefox Nightly 128.

Marking this as &apos;RESOLVED CONFIGURATION CHANGED&apos;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>243744</attachid>
            <date>2014-12-25 09:34:11 -0800</date>
            <delta_ts>2014-12-25 09:34:11 -0800</delta_ts>
            <desc>reduced test case</desc>
            <filename>webkit-pointer-focus-parent.html</filename>
            <type>text/html</type>
            <size>790</size>
            <attacher name="Rodney Rehm">mail</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KPGhlYWQ+Cgk8bWV0YSBjaGFyc2V0PSJ1
dGYtOCIgLz4KCTx0aXR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