<?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>22220</bug_id>
          
          <creation_ts>2013-05-30 18:51:36 +0000</creation_ts>
          <short_desc>@role attribute, and ARIA global content attributes should be reflected DOM attributes.</short_desc>
          <delta_ts>2018-05-03 20:54:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>ARIA</product>
          <component>General</component>
          <version>1.1</version>
          <rep_platform>PC</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, aria</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="James Craig">jcraig</reporter>
          <assigned_to name="Michael Cooper">cooper</assigned_to>
          <cc>dbolter</cc>
    
    <cc>eoconnor</cc>
    
    <cc>mark.sadecki+w3c</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-bugzilla</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>redux</cc>
    
    <cc>robin</cc>
    
    <cc>surkov.alexander</cc>
    
    <cc>w3cbugzilla</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88461</commentid>
    <comment_count>0</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-05-30 18:51:36 +0000</bug_when>
    <thetext>@role attribute, and ARIA global content attributes should be reflected DOM attributes.

Was talking to Robin Berjon at the recent HTML F2F meeting, and he requested I file this bug. Since @role and the ARIA global attributes are allowed everywhere, making them reflected content attributes would be very useful to web developers. 

The only challenge I can predict for this would be specifying the bits that ARIA refers to as the &quot;Implicit Value for Role:&quot;

For example, when role=&quot;alert&quot;
 • Default for aria-live is assertive.
 • Default for aria-atomic is true.

So these two are functionally identical:
&lt;div role=&quot;alert&quot;&gt;&lt;/div&gt;
&lt;div role=&quot;alert&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;

This may pose a problem for making *all* the global attrs reflected, but should not pose a problem for @role.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88463</commentid>
    <comment_count>1</comment_count>
    <who name="steve faulkner">faulkner.steve</who>
    <bug_when>2013-05-30 19:03:53 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; @role attribute, and ARIA global content attributes should be reflected DOM
&gt; attributes.
&gt; 
&gt; Was talking to Robin Berjon at the recent HTML F2F meeting, and he requested
&gt; I file this bug. Since @role and the ARIA global attributes are allowed
&gt; everywhere, making them reflected content attributes would be very useful to
&gt; web developers. 
&gt; 
&gt; The only challenge I can predict for this would be specifying the bits that
&gt; ARIA refers to as the &quot;Implicit Value for Role:&quot;
&gt; 
&gt; For example, when role=&quot;alert&quot;
&gt;  • Default for aria-live is assertive.
&gt;  • Default for aria-atomic is true.
&gt; 
&gt; So these two are functionally identical:
&gt; &lt;div role=&quot;alert&quot;&gt;&lt;/div&gt;
&gt; &lt;div role=&quot;alert&quot; aria-live=&quot;assertive&quot;&gt;&lt;/div&gt;
&gt; 
&gt; This may pose a problem for making *all* the global attrs reflected, but
&gt; should not pose a problem for @role.

OK so this is filed against the API spec is this the right place for it? I thought it would be better in HTML spec no?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88465</commentid>
    <comment_count>2</comment_count>
    <who name="David Bolter">dbolter</who>
    <bug_when>2013-05-30 19:25:33 +0000</bug_when>
    <thetext>Hmmm. This is interesting. I&apos;m curious if there are particular here-and-now reasons for requesting this or is it considered speculatively useful? I may have concerns but need to think about it more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88466</commentid>
    <comment_count>3</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-05-30 20:26:56 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; OK so this is filed against the API spec is this the right place for it? I
&gt; thought it would be better in HTML spec no?

Yes, you&apos;re right. Redirecting.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88467</commentid>
    <comment_count>4</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-05-30 20:30:08 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Hmmm. This is interesting. I&apos;m curious if there are particular here-and-now
&gt; reasons for requesting this or is it considered speculatively useful? 

Mainly for the accessor convenience. Robin was specifically asking about accessibility convenience features at the F2F and this one came up. He may have additional ideas for its usefulness.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88752</commentid>
    <comment_count>5</comment_count>
    <who name="David Bolter">dbolter</who>
    <bug_when>2013-06-05 17:25:28 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #2)
&gt; &gt; Hmmm. This is interesting. I&apos;m curious if there are particular here-and-now
&gt; &gt; reasons for requesting this or is it considered speculatively useful? 
&gt; 
&gt; Mainly for the accessor convenience. Robin was specifically asking about
&gt; accessibility convenience features at the F2F and this one came up. He may
&gt; have additional ideas for its usefulness.

OK thanks. Just for clarification, do you mean existing DOM accessors or new API?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88754</commentid>
    <comment_count>6</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-06-05 17:40:31 +0000</bug_when>
    <thetext>New API. For example:

// role DOM attr reflects the role content attr.

var el = document.createElement(&apos;div&apos;);
el.setAttribute(&apos;role&apos;, &apos;group&apos;);
el.role
&gt; &apos;group&apos;
el.role = &apos;main&apos;
el.getAttribute(&apos;role&apos;);
&gt; &apos;main&apos;
el.role = &apos;banner&apos;
e.outerHTML
&gt; &apos;&lt;div role=&quot;banner&quot;&gt;&lt;/div&gt;&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88755</commentid>
    <comment_count>7</comment_count>
    <who name="David Bolter">dbolter</who>
    <bug_when>2013-06-05 17:41:16 +0000</bug_when>
    <thetext>Aha dot accessors. OK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88766</commentid>
    <comment_count>8</comment_count>
    <who name="Edward O&apos;Connor">eoconnor</who>
    <bug_when>2013-06-05 21:09:12 +0000</bug_when>
    <thetext>Shouldn&apos;t this be on the ARIA spec, not the HTML spec?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88786</commentid>
    <comment_count>9</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-06-05 23:37:04 +0000</bug_when>
    <thetext>Robin, should this remain in ARIA or in HTML?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89072</commentid>
    <comment_count>10</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-06-11 11:54:10 +0000</bug_when>
    <thetext>(In reply to comment #9)
&gt; Robin, should this remain in ARIA or in HTML?

I can&apos;t say that I have a preference either way. It depends on how ARIA is planning to evolve over time. If you consider it mostly stable, then integrating this from the HTML spec can make sense; but if you are planning evolution then it will be simpler to handle this in ARIA (it avoids needing to sync up).

If you go with ARIA, we can help you with how to specify this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89875</commentid>
    <comment_count>11</comment_count>
    <who name="Patrick H. Lauke">redux</who>
    <bug_when>2013-06-26 09:43:50 +0000</bug_when>
    <thetext>Ah, excellent...I&apos;ve been ranting recently about how default role is exposed via accessibility APIs, but not reflected in normal JS. This would make writing extensions that do things like &quot;skip to main/navigation/etc&quot; easier, as then they wouldn&apos;t have to go through both any arbitrary element with a particular role, AND  a list of known elements that traditionally get these default roles - a simple iteration over any elements with specific role will suffice. Would this also enable CSS styling based solely on attribute selectors? (e.g. * [role=main] { ... } ) or does that need to be filed against CSS spec?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89913</commentid>
    <comment_count>12</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-06-26 18:21:31 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Ah, excellent...I&apos;ve been ranting recently about how default role is exposed
&gt; via accessibility APIs, but not reflected in normal JS.

I think that is a separate issue. We&apos;ve talked about adding Element.computedRole() in ARIA, which would allow an element like &lt;foo role=&quot;switch checkbox&quot;&gt; to return &quot;switch&quot; in browsers that supported the new ARIA 1.1 &quot;switch&quot; role, and &quot;checkbox&quot; in all other browsers. The element.role property should just reflect the raw string value (&quot;switch checkbox&quot;) so I would expect that it should not return any implicit value for host language elements.

var h1 = document.createElement(&quot;h1&quot;);
h1.getAttribute(&quot;role&quot;); // empty string &quot;&quot;
h1.role; // empty string &quot;&quot;
h1.computedRole(); // &quot;heading&quot;

&gt; This would make
&gt; writing extensions that do things like &quot;skip to main/navigation/etc&quot; easier,
&gt; as then they wouldn&apos;t have to go through both any arbitrary element with a
&gt; particular role, AND  a list of known elements that traditionally get these
&gt; default roles - a simple iteration over any elements with specific role will
&gt; suffice. Would this also enable CSS styling based solely on attribute
&gt; selectors? (e.g. * [role=main] { ... } ) or does that need to be filed
&gt; against CSS spec?

Attribute selectors already work in modern browsers, but they would not (and should not) get any special behavior from implicit roles. e.g. [role=&quot;heading&quot;] would select &lt;h1 role=&quot;heading&quot; and &lt;div role=&quot;heading&quot;&gt; but not &lt;h1&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89914</commentid>
    <comment_count>13</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-06-26 18:26:29 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; We&apos;ve talked about adding Element.computedRole() in ARIA

By the way, this is PFWG-ISSUE-427.
https://www.w3.org/WAI/PF/Group/track/issues/427</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89915</commentid>
    <comment_count>14</comment_count>
    <who name="Patrick H. Lauke">redux</who>
    <bug_when>2013-06-26 19:01:11 +0000</bug_when>
    <thetext>Ah, sorry James, I got the wrong end of that particular stick. computedRole() does sound along the lines of what I&apos;m ideally after (though I can&apos;t access/track the PFWG issue, but from your example this seems to fit my specific use case - though it would mean iterating over each node and checking computedRole() rather than using a CSS-style selector I guess)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89918</commentid>
    <comment_count>15</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-06-26 19:36:21 +0000</bug_when>
    <thetext>There&apos;s probably room in CSS4 for a selector like *:role(&apos;heading&apos;), but I imagine it&apos;d be blocked until we got Element.computedRole() standardized and implemented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89919</commentid>
    <comment_count>16</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-06-26 19:40:55 +0000</bug_when>
    <thetext>PFWG-ISSUE-589: Propose CSS selector like *:role(&apos;heading&apos;) once we have Element.computedRole() in a draft
https://www.w3.org/WAI/PF/Group/track/issues/589</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105748</commentid>
    <comment_count>17</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2014-05-12 19:26:12 +0000</bug_when>
    <thetext>Reassigning component since this will be speced in ARIA, not any specific host language.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129180</commentid>
    <comment_count>18</comment_count>
    <who name="James Nurthen">w3cbugzilla</who>
    <bug_when>2018-05-03 20:54:57 +0000</bug_when>
    <thetext>AOM</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>