<?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>24983</bug_id>
          
          <creation_ts>2014-03-09 21:06:09 +0000</creation_ts>
          <short_desc>Making document parts inert without using &lt;dialog&gt;</short_desc>
          <delta_ts>2016-05-20 01:49:58 +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>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>https://groups.google.com/d/msg/browser-accessibility-dev/QinGGM_OM7Y/FHpxY_qfBgAJ</status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonas Sicking (Not reading bugmail)">jonas</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>d</cc>
    
    <cc>erikcharlebois</cc>
    
    <cc>ian</cc>
    
    <cc>jcraig</cc>
    
    <cc>mike</cc>
    
    <cc>w3</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102126</commentid>
    <comment_count>0</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2014-03-09 21:06:09 +0000</bug_when>
    <thetext>What are the use cases for the inert attribute?

I can&apos;t think of any UIs I&apos;ve seen where someone grays out a subsection of a page. It does seem quite common to gray out everything *except* a section of a page, in order to do dialog-like things. But that&apos;s already handled by the &lt;dialog&gt; element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102141</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-03-10 17:21:12 +0000</bug_when>
    <thetext>Looks like inert=&quot;&quot; was added just so you could do &lt;dialog&gt; without &lt;dialog&gt;, so there&apos;s no compelling use case. I&apos;ve removed it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102142</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2014-03-10 17:21:20 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r8536.
Check-in comment: Drop the inert=&apos;&apos; attribute since its use case is subsumed by &lt;dialog&gt;.
http://html5.org/tools/web-apps-tracker?from=8535&amp;to=8536</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102714</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-03-20 22:28:46 +0000</bug_when>
    <thetext>Ok, I&apos;ve collected some use cases for something like inert=&quot;&quot;.

1. If, instead of dialog boxes, you use multiple sections of the page, but instead of making them display:none, you make them opacity:0, you still need a way to prevent them from getting focused (and, indeed, clicked, while they&apos;re transitioning from opacity:1 to opacity:0).

2. Sometimes you might want to disable the whole UI without showing a dialog, e.g. because you want to show a spinner but only want to show the spinner once the delay has taken more than 100ms.


#1 could be done with straight inert=&quot;&quot;.

#2 can actually be done with &lt;dialog&gt;.showModal(); just make the dialog transparent and empty. But that&apos;s pretty ugly. If we don&apos;t force it to be done that way, it would probably also need a way to &quot;uninertify&quot; subparts, e.g. a single &quot;cancel&quot; button. This could be faked pretty well with inert=&quot;&quot;, though it wouldn&apos;t be perfect (consider the viewport itself for example, or interactive children of the &lt;body&gt; if you want to make something non-inert in the body also).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102716</commentid>
    <comment_count>4</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2014-03-20 23:37:41 +0000</bug_when>
    <thetext>How common are these use cases? Do you have example of websites that do #1?

Arguably using CSS seems like a better solution so that a single class change can affect both the rendering and the inertness.

For #2 it sounds like you want something that is the opposite of the inert attribute. I.e. something that makes the page inert except a subtree under a specific element. I&apos;m not actually sure that &lt;dialog&gt;.showModal() is that wrong for #2 if you want cancel buttons to be in there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103232</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-04-01 16:44:24 +0000</bug_when>
    <thetext>#1 is pretty common in any Web app that has multiple &quot;pages&quot; where they&apos;re all in the same HTML page and you transition between them. Pretty much any app I&apos;ve written in the past few years, for example the one I mentioned to you in a recent e-mail. Maybe #2 is indeed a dialog.

Not sure how you&apos;d use CSS to remove something visible from the tab order, but in any case, that seems like it wouldn&apos;t work well in non-CSS UAs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103244</commentid>
    <comment_count>6</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2014-04-01 19:52:32 +0000</bug_when>
    <thetext>Doesn&apos;t display:none satisfy the &quot;multiple pages&quot; UI? I know find-as-you-type doesn&apos;t search such content, and it seems like tabbing should too if it doesn&apos;t already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103473</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-04-07 15:41:23 +0000</bug_when>
    <thetext>The problem with display:none is that you can&apos;t do an animated transition to it. You really want the panel to be inert as soon as it starts fading.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105347</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-07 20:58:10 +0000</bug_when>
    <thetext>Another way of doing #2 would be to have a way to control the whole page&apos;s default state, inert vs non-inert, and then having an attribute which handles #1 and #2 by overriding the default state to inert or non-inert.

So then showModal() would just be setting the default to inert and setting the dialog to override it as non-inert. #1 would be just marking parts inert. #2 would be manually setting the default and making whatever parts of the UI should still be interactive be non-inert.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105351</commentid>
    <comment_count>9</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2014-05-07 21:26:15 +0000</bug_when>
    <thetext>I have to say that solving the use case of making content inert as it&apos;s animating away doesn&apos;t seem like a high priority. I&apos;d rather wait to see if CSS provides a way to animate to/from display:none (something which would make authoring much simpler too)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105549</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-05-09 17:37:29 +0000</bug_when>
    <thetext>Interesting idea. Is there a bug tracking the ability to do that? It would certainly be interesting. (Though, we&apos;d have to define that the elements were inert in that situation, too.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109512</commentid>
    <comment_count>11</comment_count>
    <who name="Erik Charlebois">erikcharlebois</who>
    <bug_when>2014-07-29 18:29:12 +0000</bug_when>
    <thetext>A non-dialog application of inert: disabling blocks of form elements or other custom widgets. The standard form elements have the disabled attribute, but there&apos;s no equivalent for custom and composite controls.

For example, I have a &apos;page slider&apos; widget that&apos;s a composite widget of a page left button, a range (custom implemented with role=&quot;slider&quot; for styling reasons) and a page right button. To put the widget in a disabled state with the same semantics as form elements, I need to set tabindex=-1 to all focusable subelements.

What I do today is polyfill inert by swizzling tabindex in and out: https://gist.github.com/erikcharlebois/01441554fee9ff4156aa

This is quite hacky (I&apos;m sure I&apos;ve missed some default focusable elements) and doesn&apos;t handle elements being added dynamically (I&apos;ll add MutationObserver support at some point I guess).

I think it&apos;s important that inert is available as a building block for keyboard support in custom elements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109513</commentid>
    <comment_count>12</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2014-07-29 18:44:52 +0000</bug_when>
    <thetext>Some more cases:

3. Inert section of a checkout form. For example, the entire shipping address section is inert/disabled while the &quot;Same as billing address&quot; checkbox is checked. Often I see these displayed side-by-side for UI clarity.

4. Stack/Carousel/Card view such as a &quot;cover flow&quot; type view. Each &quot;card&quot; has several interactive elements but only the front-most is useable at the moment. You can see a portion of the rendered-but-inert card to either side of the front-most card, or stacked up behind the front-most card, but you are not able to click on those or tab to any of the controls inside those views.

I believe inert=&quot;&quot; is a good solution for both of these use cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109514</commentid>
    <comment_count>13</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2014-07-29 18:48:51 +0000</bug_when>
    <thetext>(In reply to Ian &apos;Hixie&apos; Hickson from comment #10)
&gt; Interesting idea. Is there a bug tracking the ability to [animate 
&gt; to/from display:none]? It would certainly be interesting. (Though, we&apos;d
&gt; have to define that the elements were inert in that situation, too.)

I doubt this is supported well if at all, but it seems like this should already be possible by adding display:none to the last keyframe of an CSS animation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111195</commentid>
    <comment_count>14</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2014-09-08 21:15:12 +0000</bug_when>
    <thetext>We have use cases, and several possible approaches to resolve them. Do we have vendor interest in addressing these use cases?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111394</commentid>
    <comment_count>15</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-09-11 17:50:34 +0000</bug_when>
    <thetext>5) Emulating showModalDialog with inert + window.open + postMessage

While &lt;dialog&gt; arguably covers this use case, it is a bigger change than window.open.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125556</commentid>
    <comment_count>16</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-17 05:40:04 +0000</bug_when>
    <thetext>It seems there is no interest in an inert=&quot;&quot; attribute.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125569</commentid>
    <comment_count>17</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-18 20:18:16 +0000</bug_when>
    <thetext>Note https://github.com/whatwg/html/issues/897 for a new proposal at a slightly lower level of abstraction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126467</commentid>
    <comment_count>18</comment_count>
    <who name="Ming Iu">w3</who>
    <bug_when>2016-05-20 01:49:58 +0000</bug_when>
    <thetext>I&apos;ve been writing some web applications recently, and I find that I&apos;m encountering use case #2 a lot, so I would find something like inert to be really useful.

Some of the JavaScript APIs are asynchronous-only. If the user triggers an action that involves reading some JSON configuration info from a blob, or converting some data URLs to images so that they can be composited on a canvas, then I have to do the actions asynchronously even if they&apos;re fast. During that wait time, I don&apos;t want the user mucking around the UI causing things to get into an inconsistent state--essentially a race condition. The whole point of the single-threaded UI is to let normal programmers be able to reason through UI logic. But with the asynchronous calls, I&apos;m finding that I&apos;m not smart enough any more to program it. What if the user double-clicks the button, submitting the action twice? What if they trigger a complete rewrite of the view? Do I need to add if-statements to all my event handlers to check whether I&apos;m doing something asynchronously?

The dialog workaround is ok, but I don&apos;t actually want a dialog. At most, I just want to switch to an hourglass cursor since the wait is pretty short. Sure, I could use a transparent dialog or something like that, but that just seems like I&apos;m abusing a mechanism to do something that it wasn&apos;t intended to do.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>