<?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>23585</bug_id>
          
          <creation_ts>2013-10-21 17:34:03 +0000</creation_ts>
          <short_desc>FKA: when document.activeElement is hidden, it retains its status as document.activeElement, and therefore intercepts keyboard events as the event target</short_desc>
          <delta_ts>2015-06-17 04:16:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>a11y, a11ytf</keywords>
          <priority>P2</priority>
          <bug_severity>editorial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="James Craig">jcraig</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>faulkner.steve</cc>
    
    <cc>jcraig</cc>
    
    <cc>lwatson</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>95027</commentid>
    <comment_count>0</comment_count>
      <attachid>1410</attachid>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-10-21 17:34:03 +0000</bug_when>
    <thetext>Created attachment 1410
test case demonstrating bug (tested in WebKit)

Full Keyboard Access (FKA): when document.activeElement is hidden, it retains its status as document.activeElement, and therefore intercepts keyboard events as the event target.

Load attached test case and follow the instructions. It doesn&apos;t make sense that a hidden, unfocusable, unrendered element would be retained as document.activeElement, and therefore be an acceptable event target. This is either a spec bug or a browser bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95077</commentid>
    <comment_count>1</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-10-22 09:25:08 +0000</bug_when>
    <thetext>(In reply to James Craig from comment #0)
&gt; Created attachment 1410 [details]
&gt; test case demonstrating bug (tested in WebKit)
&gt; 
&gt; Full Keyboard Access (FKA): when document.activeElement is hidden, it
&gt; retains its status as document.activeElement, and therefore intercepts
&gt; keyboard events as the event target.
&gt; 
&gt; Load attached test case and follow the instructions. It doesn&apos;t make sense
&gt; that a hidden, unfocusable, unrendered element would be retained as
&gt; document.activeElement, and therefore be an acceptable event target. This is
&gt; either a spec bug or a browser bug.

I am not so sure that it&apos;s a bug. At least, it&apos;s a trick I&apos;ve used before. The use case is this: you wish to expose a way of editing something that is like text, but not rendered at all like an input (notably, the text itself isn&apos;t rendered that way at all). So you give focus to a hidden input and render its content whenever it gets a keyboard event.

I&apos;m not sure that&apos;s great for A11Y or that it&apos;s the best implementation strategy overall. I&apos;m just pointing out that if it&apos;s something that I felt the need to do for a project at some point, I might not be the only one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95111</commentid>
    <comment_count>2</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-10-22 19:00:27 +0000</bug_when>
    <thetext>That sounds like a hack to me, but either way, your use case can still be achieved by setting the input&apos;s opacity to 0 or positioning it offscreen. However, hidden (and display:none) elements are not rendered in any modality and should therefore not be the document.activeElement or receive keyboard events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96574</commentid>
    <comment_count>3</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-11-20 00:46:26 +0000</bug_when>
    <thetext>Hixie says this is resolved in the WHATWG spec:

&quot;An element is focusable if [...] The element is [...] being rendered [...]. When an element that is focused stops being a focusable element [...] the user agent should synchronously run the unfocusing steps for the affected element only.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120950</commentid>
    <comment_count>4</comment_count>
    <who name="steve faulkner">faulkner.steve</who>
    <bug_when>2015-06-12 14:51:09 +0000</bug_when>
    <thetext>reflect WHATWG resolution</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1410</attachid>
            <date>2013-10-21 17:34:03 +0000</date>
            <delta_ts>2013-10-21 17:34:03 +0000</delta_ts>
            <desc>test case demonstrating bug (tested in WebKit)</desc>
            <filename>activeElement_focused_but_hidden.html</filename>
            <type>text/html</type>
            <size>1711</size>
            <attacher name="James Craig">jcraig</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KCTx0aXRsZT5mb2N1cyBzcGVjIGJ1ZzwvdGl0
bGU+Cgk8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJCVtoaWRkZW5dIHsgZGlzcGxheTogbm9uZTsg
fQoJPC9zdHlsZT4KCTxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4KCQoJdmFyIHRyaWdn
ZXI7CgoJZnVuY3Rpb24gJChpZCkgewoJCXJldHVybiBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChp
ZCk7Cgl9CgoJZnVuY3Rpb24gbG9hZEhhbmRsZXIoKSB7CgkJdHJpZ2dlciA9ICQoJ3RyaWdnZXIn
KTsKCgkJdHJpZ2dlci5vbmZvY3VzID0gaGFuZGxlRm9jdXM7CgkJdHJpZ2dlci5vbmNsaWNrID0g
aGFuZGxlQ2xpY2s7CgoJfQoKCWZ1bmN0aW9uIGhhbmRsZUZvY3VzKGUpIHsKCQlpZiAoZSAmJiBl
LmtleUNvZGUpIGNvbnNvbGUubG9nKGUua2V5Q29kZSk7CgkJdHJpZ2dlci5o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