Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <header>
	<h1>Details with revised explicit ARIA role tests</h1>
	<p>Published: March 02, 2022</p>
<!-- 	<p>Last updated: April 01, 2022</p> -->
	<p>Last Updated: June 17, 2022</p>
</header>


<details>
	<summary>control</summary>
	this serves as an unmodified control-case for comparative purposes. 
	<div role=note>
	<p>Article and Region roles were chosen for testing as these would be reasonable roles to provide a details element.  Providing a details a role of button, link, img, etc, would be nonsensical, and thus not tested.</p>
</div>
</details>

<details role=article aria-label=test open>
	<summary>an example</summary>
	This example has an article role.
</details>

<details role=article open>
	<summary>an example</summary>
	This example has an unnamed article role.
</details>

<details role=region aria-label=test2 open>
	<summary>an example</summary>
	this example has a region role.
</details>


<div class=results>
	<div class=result-tables>
 <table>
  <caption>Details with revised role results</caption>
  <tr>
    <td></td>
    <th>Narrator + Edge</th>

    <th>macOS VoiceOver + Edge/Chrome</th>
    <th>macOS VoiceOver + Firefox</th>
    <th>macOS VoiceOver + Safari</th>

    <th>iOS VoiceOver + Safari</th>

    <th>NVDA + Edge/Chrome</th>
    <th>NVDA + Firefox</th>

    <th>JAWS + Edge/Chrome</th>
    <th>JAWS + Firefox</th>

    <th>TalkBack + Edge/Chrome</th>
    <th>TalkBack + Firefox</th>
  </tr>
		<tr>
    <th>Summary's role announced?</th>
    <!-- narrator -->
    <td>Yes</td>
    
    <!-- mosvo -->
    <td>Yes</td>
    <td class=concern>No: summary's role dropped. If summary focued with VO cursor, announces 'clickable'</td>
    <td>Yes</td>
    
				<td class=concern>No. Same issues with unmodified details</td>
    
    <!-- nvda -->
    <td>Yes</td>
    <td class=concern>No: summary's role dropped entirely.</td>
    
    <!-- jaws -->
    <td>Yes</td>
    <td class=concern>"Button" role dropped if navigating by virtual cursor. If navigating by tab key, button role announced when focused. Otherwise, not discoverable by use of button quick nav, and summary text and details content flows together when using reading mode.</td>
    
    <!-- tb -->
    <td>Yes</td>
			<td class=concern>No: "button" role dropped. See <a href="https://codepen.io/scottohara/pen/aaJXYG">test 0</a> for compartable results</td>
  </tr>
	<tr>
    <th>Expand/Collapse state exposed?</th>
    <!-- narrator -->
    <td>Yes</td>
    
    <!-- mosvo -->
    <td>Yes</td>
    <td class=concern>Poorly. Initial state will be exposed if navigated to via <kbd>tab</kbd> key while VO is enabled.  </td>
    <td>Yes</td>
    
			<td class=concern>No. Same issues with unmodified details</td>
    
    <!-- nvda -->
    <td>Yes</td>
    <td>Yes</td>
    
    <!-- jaws -->
    <td>Yes</td>
    <td>Yes</td>
    
    <!-- tb -->
    <td>Yes</td>
    <td>Yes</td>
  </tr>
  <tr>
    <th>details role exposed if changed?</th>
    <!-- narrator -->
    <td>Yes</td>
    
    <!-- mosvo -->
    <td>Yes</td>
    <td>Yes</td>
    <td>Yes</td>
    
    <td>Yes</td>
    
    <!-- nvda -->
    <td>Yes</td>
    <td>Yes</td>
    
    <!-- jaws -->
    <td>Yes</td>
    <td>Yes</td>
    
    <!-- tb -->
    <td>Yes - regions and articles accessible when navigating by landmarks.</td>
    <td>Yes - region accessible when navigating by landmarks. Articles not exposed?</td>
  </tr>
	</table>
 </div>
</div>



<!-- april note <p>note: chromium (exp found with jaws and nvda) seems to presently have a bug about announcing the expand/collapsed state of disclosure widgets.  The current state was intermittently announced for both the control and example details/summary test cases.</p> -->




<!-- prevoius test results.

	<div>
  <table>
			<col span=2 width=300px>
    <caption>Summary element's role announcements by screen reader / browser combo</caption>
    <thead>
      <tr>
        <td></td>
        <th>Firefox</th>
        <th>Chrome/Edge</th>
        <th>Safari</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <th>TalkBack</th>
        <td> In both the control and test case example, the summary and details elements expose no roles.</td>
        <td>"disclosure triange" role and correctly announces state. article or region role is not exposed, regardless if named or not.</td>
        <td>n/a</td>
   
      </tr>
      <tr>
        <th>VoiceOver</th>
        <td>
									macOS: <strong>no role or state announcement for summary.</strong>
        </td>
        <td>
        	macOS: "disclosure triange" role. correctly announces state.
        </td>
        <td>iOS: <strong>no role or state announcement.</strong><hr>
        	macOS: "summary" role. correctly announces state.
        </td>
 
      </tr>
      <tr>
        <th>Narrator (win10)</th>
        <td><strong>no role or state announcement.</strong></td>
        <td>announces "button" and expanded / collapsed state. 
									   "article" role is only announced if it is given a name.</td>
        <td>n/a</td>
      </tr>
      <tr>
        <th>NVDA</th>
        <td>no role announced. Expanded / collapsed state announced.</td>
        <td>buttton role announced. Expanded / collapsed state announced on first focus. This lack of consistent announcement also occurs when no role has been specified on details element.</td>
        <td>n/a</td>

      </tr>
      <tr>
        <th>JAWS</th>
        <td>Changing the role of the details element results in the announcement of that role when navigated to with Tab key, and no role/state announcement of the summary element.  If toggled while it has keyboard focus, an expanded/collapsed state can still announce.  But without the 'button' role, the fact that oen could expand the element would not be conveyed. Furhter issues were found when testing other one-off roles, e.g., group without a name.</td>
        <td>announces "button" and its expanded / collapsed state on initial focus. "article" may be heard if navigating by virtual cursor down arrow, but navigating to the "summary" with tab key only announces the button role, name, and its current state. if the article is named, it will be announced as an "article region" when focusing the summary with the Tab key.</td>
        <td>n/a</td>
    
      </tr>
    </tbody>
  </table>
</div>
-->
              
            
!

CSS

              
                body {
  font-family: arial;
  margin: 1.25em;
  background: #fafafa;
  padding: .55em;
}

header {
  margin: 0 0 .75em;
  padding-bottom: .75em;
  border-bottom: 1px solid #aaa;
  
  h1 {
    margin: 0;
  }
  
  :last-child {
    margin-bottom: 0;
  }
}

summary h3 {
  display: inline-block;
  margin: 0;
}

h2 {
  margin-top: 1.5em;
  margin-bottom: .75em;
}

.tests {
  max-width: 400px;
}

caption { text-align: left; font-size: 1.25em; margin-top: 1em;}

.results {
  
  table {
    width: 100%;
    min-width: 1100px;
    
  }
  th {
    word-break: break-word;
    font-size: .82em;
  }
  th, td:not(:empty) {
    border: 1px solid;
    text-align: left;
    padding: .25em;
    min-width: 140px;
  }
}

.result-tables {
  overflow: auto;
}

li p {
  margin: .5em 0;
}

.concern {
  background: lightyellow;
  font-weight: bold;
}

details {
	margin: 1em 0;
}
              
            
!

JS

              
                /*

JAWS 2022.2110.60
NVDA 2021.3.3

*/
              
            
!
999px

Console