Follow-up to: #1168246-136: Freedom For Fieldsets! Long Live The DETAILS.

Details should have ARIA added to them so that the open/closed state is semantically determinable:
http://wet-boew.github.com/wet-boew/demos/details/details-eng.html

<summary aria-expanded="false" aria-pressed="false" role="button" aria-controls="details-1" style="-moz-user-select: none;" tabindex="0">Example 2</summary>
<div style="display: none;">
<summary aria-expanded="true" aria-pressed="true" role="button" aria-controls="details-1" style="-moz-user-select: none;" tabindex="0">Example 2</summary>
<div style="display: block;">

Comments

mgifford’s picture

Issue summary: View changes

busted reference

mgifford’s picture

Issue tags: +aria

Forgot to Tag

mgifford’s picture

Issue summary: View changes

reference link?

liam morland’s picture

Are @style and @tabindex really needed?

Does this element actually need ARIA? Shouldn't it be that the semantics communicated by ARIA are just replicating the inherent semantics of details/summary? Or is the ARIA a shim for browsers that don't understand details/summary?

The .details-description element should by the target of an @aria-describedby on the details element.

mgifford’s picture

I'm checking into it, but I'm sure style="-moz-user-select: none;" was added to overcome something.

Tabindex I'm less sure of. I'd prefer to leave out tabindex if we can.

I see this as the critical piece though:
aria-expanded="false" aria-pressed="false" role="button" aria-controls="details-1"
aria-expanded="true" aria-pressed="true" role="button" aria-controls="details-1"

More references:
https://github.com/wet-boew/wet-boew/wiki/Expandable-collapsible-content...
http://mathiasbynens.be/notes/html5-details-jquery
http://www.accessibleculture.org/articles/2012/03/screen-readers-and-det...

mgifford’s picture

Issue tags: +Accessibility, +html5

tagging

mgifford’s picture

Just a note on the WET use of style/tabindex. It's used with polyfill not when native.

Polyfill uses tabindex to make unsupported element focusable, style to control visibility of contents and ARIA to add semantics.

liam morland’s picture

Status: Active » Needs review
StatusFileSize
new893 bytes

I'm checking into it, but I'm sure style="-moz-user-select: none;" was added to overcome something.

OK, but shouldn't it be in the core stylesheets, in that case?

Just a note on the WET use of style/tabindex. It's used with polyfill not when native.

So, should the polyfill JS add it then?

The other attributes are added by the attached patch.

Status: Needs review » Needs work

The last submitted patch, core_details_aria_1848684.patch, failed testing.

liam morland’s picture

Status: Needs work » Needs review
StatusFileSize
new970 bytes

The problem was undefined @id on the details. Is there a generic way of generating @id if one is not provided?

This version of the patch checks for @id and only creates @aria-controls if it is there.

mgifford’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new589.89 KB

This looks good. There are no visible differences in the UI. I don't know of a generic way to generate @id's if one doesn't exist.

The screenshot provides view in Firefox & Chrome with source.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

sun’s picture

Status: Fixed » Active

I'm not sure I understand why we continue to duct-tape our current implementation of non-native details, instead of working on the polyfill...?

This patch added role/aria attributes to summary elements, but the attributes are only set once on the server-side and never updated according to the actual state of a details/summary element. In other words, collapse.js was not updated accordingly.

Lastly, I've checked the referenced web sources, but I do not understand why we need to duplicate the semantic 'open' attribute with 'aria-*' attributes that essentially have the identical meaning? That's like adding a role="link" attribute to every anchor tag on the page. Likewise, the summary element is to details as the legend element is to fieldsets - it is a clearly defined part of the spec and may only appear once within the parent container. I've the impression that we're trying to make screen reader implementations work that are broken in the first place...?

mgifford’s picture

Noticing that we didn't address @Liam's point in #2:
"The .details-description element should by the target of an @aria-describedby on the details element."

@sun - I think that @Liam & I are just working with what we know. I understand in general what you've been trying to accomplish with polyfills, but it's harder for us to implement.

I don't know why in the examples used there was a replication of HTML5's open attribute & the aria-expanded="true". In general if it's defined in HTML5 semantically, it shouldn't be repeated in ARIA.

mgifford’s picture

From Paul Jackson I got insights as to why they are using both:

WAI-ARIA needed for the polyfill scenario as there will be no mapping otherwise between the HTML5 elements and the accessibility API.

The open property only has semantic meaning where native support for it exists. Otherwise it needs to be supplemented with WAI-ARIA.

I don't think for D8 that we need to worry too much about non-HTML5 support. Not that there won't still be browsers that don't support HTML5. Not sure where to find a list of browsers that would need the WAI-ARIA. Searching for "open" within http://caniuse.com wasn't useful.

liam morland’s picture

Perhaps the polyfill should add the ARIA with JS. In other words, the HTML is pure HTML5 and JS adds whatever else is needed to make it work the same way for non-HTML5 user agents. On the other hand, how often is ARIA supported but not HTML5? Are we planning for a use case that doesn't exist?

mgifford’s picture

That's what I thought too, but if you look at http://wet-boew.github.com/wet-boew/demos/details/details-eng.html with both Firefox & Chrome (using Inspect Element) you'll see that both modern browsers are handling this differently.

Firefox doesn't do anything with the markup. Chrome has native support. WET is use Modernizr's algorithm to determine support.

mgifford’s picture

Issue summary: View changes

Updated issue summary.

mgifford’s picture

Issue summary: View changes

@sun - let us know if you have ideas on how we can take this forward.

dom.’s picture

Patch #8 is wrong because it actually duplicates aria-expanded instead of aving both aria-expanded and aria-pressed. Also it does not adds the ="true" or ="false" which make it syntaxicly wrong at W3C. Finally it does not involve the JS to toogle those attributs to true/false.
I'm sorry I did not see this issue before, thus I'm working and submitting patch on this at :
#2472177: Collapsible fieldset have duplicated and wrong aria-expanded
(relatively to a META to have W3C validation everywhere in core)

Jeff Burnz’s picture

When you add role button to a non button element user agents will understand this to be a button and expect the space bar to be able to toggle it, however this will not work without extra JavaScript to detect use of the space bar key. I'm not so sure role button is a good idea.

I just ran into this when using an <a> for my menu toggle and adding role=button. Instead I opted to just use a real button.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Tec...

mgifford’s picture

Where possible, using the correct semantic html5 element is always going to be better from what I've read.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • webchick committed 713e677 on 8.3.x
    Issue #1848684 by Liam Morland, mgifford: Add ARIA role to DETAILS.
    

  • webchick committed 713e677 on 8.3.x
    Issue #1848684 by Liam Morland, mgifford: Add ARIA role to DETAILS.
    

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

  • webchick committed 713e677 on 8.4.x
    Issue #1848684 by Liam Morland, mgifford: Add ARIA role to DETAILS.
    

  • webchick committed 713e677 on 8.4.x
    Issue #1848684 by Liam Morland, mgifford: Add ARIA role to DETAILS.
    

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

ivan berezhnov’s picture

Issue tags: +CSKyiv18

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
quietone’s picture

Status: Active » Postponed (maintainer needs more info)

I'm following up on issues that have been committed and re-opened.

This issue was committed to Drupal 8.x in Jan 2013 and re-opened in #11 due to questions about the implementation. The last discussions were 6 years ago.

Is there anything still to do here? If so, update the Issue Summary and add a comment.

Thanks

Edit: fix typo

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Postponed (maintainer needs more info) » Fixed

There hasn't been any further information provided so I am restoring the Fixed status, originally set in #10, because it was committed to Drupal 8.

Cheers.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.