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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25897</bug_id>
          
          <creation_ts>2014-05-27 19:57:16 +0000</creation_ts>
          <short_desc>focusin and focusout should be included in the &quot;focus update steps&quot;</short_desc>
          <delta_ts>2018-02-27 10:52:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          <see_also>https://bugzilla.mozilla.org/show_bug.cgi?id=687787</see_also>
    
    <see_also>http://code.google.com/p/chromium/issues/detail?id=378163</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2014 Q4</target_milestone>
          <dependson>25877</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Travis Leithead [MSFT]">travil</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>bugs</cc>
    
    <cc>crimsteam</cc>
    
    <cc>hober0</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>106852</commentid>
    <comment_count>0</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-05-27 19:57:16 +0000</bug_when>
    <thetext>+++ This bug was initially created as a clone of Bug #25877 +++

Presumably, focusin fires immediately before focus in the algorithm, and focusout fires immediately before blur in the algorithm (neither are cancelable).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106887</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-28 05:45:50 +0000</bug_when>
    <thetext>Apparently Chrome/IE support these, and Firefox is considering implementing it:
   https://bugzilla.mozilla.org/show_bug.cgi?id=687787

If we could get away with removing this from Chrome, it seems like that would be a win. It&apos;s not clear what focusin/focusout add that focus/blur don&apos;t.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106888</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-28 05:49:56 +0000</bug_when>
    <thetext>Pinged Chrome devs about maybe dropping this:
   https://code.google.com/p/chromium/issues/detail?id=378163</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107003</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-29 21:02:52 +0000</bug_when>
    <thetext>Travis, is there a compat need for these?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107007</commentid>
    <comment_count>4</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-05-29 21:22:04 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #3)
&gt; Travis, is there a compat need for these?

I had data years ago (when I asked to have them added to DOM L3 Events in 2009 [1]), but don&apos;t have recent data. I can see about gathering that for you though... :)

[1] https://dvcs.w3.org/hg/dom3events/rev/6d85eb1847a4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107048</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-30 18:25:26 +0000</bug_when>
    <thetext>Do you recall what your 2009 data said?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107054</commentid>
    <comment_count>6</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2014-05-30 18:39:23 +0000</bug_when>
    <thetext>No, but I just re-tested on 2014 data.

In a relatively small sample size of &quot;top sites&quot; in world-wide geographic areas I found the following data for focusin and focusout usage (e.g., registration of these events):

focusin usage:  117,588 / 569,726 (20.6%)
focusout usage: 117,430 / 569,726 (20.6%)

jQuery looks to be one of the major contributing factors...

In the jQuery 1.11.1 uncompressed file, the following is quite telling:

(function() {
  var i, eventName,
  div = document.createElement( &quot;div&quot; );
  // Support: IE&lt;9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
  for ( i in { submit: true, change: true, focusin: true }) {
    eventName = &quot;on&quot; + i;
  [...]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107063</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-30 21:48:12 +0000</bug_when>
    <thetext>So if we remove support, jQuery would keep working?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109958</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-08-05 19:43:06 +0000</bug_when>
    <thetext>This is pending UseCounter data from Chrome. However, I&apos;m not sure that data is going to be that useful. We know the events are used. The question is would pages break if the support was removed, given that many pages fall back to focus/blur.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111408</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-11 23:03:32 +0000</bug_when>
    <thetext>foolip: You&apos;re king of the feature removal, any interest in removing these redundant focus events? If I can&apos;t convince you, then I should just add them to the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112166</commentid>
    <comment_count>10</comment_count>
    <who name="Philip Jägenstedt">philipj</who>
    <bug_when>2014-09-25 08:07:43 +0000</bug_when>
    <thetext>The use counter for focusin/focusout reached stable a few weeks ago:
http://www.chromestatus.com/metrics/feature/timeline/popularity/433

At 3-4%, removal does not seem feasible.

There&apos;s also a use counter for DOMFocusIn/DOMFocusOut:
http://www.chromestatus.com/metrics/feature/timeline/popularity/211

That&apos;s currently around 0.2%, and if nobody else implements it and most content listens to both just to be safe, eventual removal seems possible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123032</commentid>
    <comment_count>11</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2015-09-02 10:58:53 +0000</bug_when>
    <thetext>I doubt this is a &quot;good first bug&quot;, given that focusout/in may change focus or remove to-be-focused element from DOM and whatnot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126474</commentid>
    <comment_count>12</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2016-05-21 21:26:28 +0000</bug_when>
    <thetext>FWIW, looks like focusin/out have been implemented in Blink (at least) totally differently to what the spec says (and what IE does), so we may need to change the spec :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129082</commentid>
    <comment_count>13</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2018-02-27 10:52:35 +0000</bug_when>
    <thetext>This is now tracked by https://github.com/whatwg/html/issues/3514.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>