Closed (duplicate)
Project:
Drupal core
Version:
main
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2026 at 20:33 UTC
Updated:
18 Jul 2026 at 00:57 UTC
Jump to comment: Most recent
Comments
Comment #3
nickdickinsonwildeComment #4
nickdickinsonwildealso opened a thread in Drupal Slack - https://drupal.slack.com/archives/C2ANFUGGG/p1771274560350289.
Note some tests are failing because they expect the role to exist. Will fix if the direction seems correct to other people.
Comment #5
quietone commentedHi, Issues for Drupal core should be targeted to the 'main' branch, our primary development branch. Changes are made on the main branch first, and are then back ported as needed according to the Core change policies. The version the problem was discovered on should be stated in the issue summary Problem/Motivation section. Thanks.
Comment #6
dcam commentedThank you for your work to improve Drupal's accessibility!
Unfortunately, the MR is failing a Functional test for Views. The FunctionalJavascript test failure is probably random and unrelated. But that Views test is legitimate. It explicitly tests for the
roleattribute and is annotated with the comment// Check that the summary has the right accessibility settings.So clearly someone thought it belonged there. I don't doubt what you say in the issue summary about it being incorrect. It just means that we need to adjust our expectations. As a result, this probably has to undergo accessibility review before being committed.In addition to fixing the existing test, bug fixes require automated tests to be added to ensure there are no regressions in the future. So I'm tagging this issue as needing tests.
Comment #8
neptune-dc commentedI did my best to fix the broken tests. Everything has gone green!
Comment #9
smustgrave commentedThanks for giving it a shot! Left some comments on the MR but main point is think we can revert most of the test coverage and just add a single assertion to an existing test.
Comment #10
neptune-dc commentedBased on feedback, I undid my test. I am not sure how to fix the broken test, so I have left it alone. Maybe someone else can fix the test.
Comment #11
kentr commented@rkoller pointed me to some articles that bring into question whether we should be using
detailsat all instead of a custom disclosure widget:tl;dr:
@rkoller did some testing and found that Safari didn't announce a state change, which is consistent with the matuzo.at article: #3579845-17: Remove aria-expanded from summary in details element.
In a comment on another issue, @cwilcox808 implied that adding
role="button"is OK, but that it should be done with JavaScript: #3571628-12: The aria-expanded attribute doesn't change once it became true on a node edit forms detail summary element. He hinted at this in the Slack thread referenced in #4.I flagged this for accessibility review to get more input from the accessibility team on the recommended solution.
Comment #12
kentr commentedCorrection:
The matuzo.at article said that Safari / VoiceOver on iOS doesn't announce a state change (or role).
Comment #13
kentr commentedAlso wondering if keeping the role and the custom behavior on the
summary(but fixing it) accomplishes the "custom disclosure widget" recommended by http://matuzo.at/ and Scott O'Hara and thereby fixes the Safari issues with nativedetails/summary.In the other issue, @cwilcox808 also said (emphasis mine):
Comment #14
mgiffordBug ID: DRU-3d2c0738 (instance) / DRU-93a3d129 (pattern)
URL: http://localhost/form-test/group-details
XPath: //summary[@data-summary-attribute="test"][@role="button"]
Full DOM path: /html/body//details[summary[@data-summary-attribute="test"]]/summary
WCAG SC: 1.3.1 - Info and Relationships (Level A)
Rule: manual semantic check - redundant-role-summary
Severity: Medium Frequency:
Pattern-level; applies to details summaries rendered by core preprocess on pages using #type details
Screen type: desktop
Removed redundant role assignment from summary.
This contribution was prepared with assistance from an AI coding tool.
https://github.com/mgifford/drupal-core/blob/main/patches/ISSUE-QUEUE-CO...
Comment #15
mgifford@kentr Great points to consider in the comments above..
How do we make the code better today than it was yesterday? I think the main documentation is around:
I haven't dug into this but an AI summary of this matuzo's article suggests:
Is this the right one? Is it being read wrong? The easiest improve still seems to be removing the button.
Comment #17
mgiffordHere's a patch to review https://git.drupalcode.org/project/drupal/-/merge_requests/16325.diff
Comment #18
kentr commented@mgifford
My interpretation is that removing the
rolewon't improve it, and we should probably ditch nativedetails/summaryby keeping the role and JavaScript behaviors to turn it into a generic disclosure widget. #3571628: The aria-expanded attribute doesn't change once it became true on a node edit forms detail summary element should take care of that.More points from the Scott O'Hara article:
Comment #19
kentr commentedFor me, VoiceOver Safari still doesn't announce the state change on a vanilla
details/summary.I see this as another case of the "spec" failing to live up to its promises.
Comment #20
mgiffordInconsistent browser (and AT) adoption is an ongoing problem. It would be so nice if there was pressure put on user agents to comply with https://www.w3.org/WAI/standards-guidelines/uaag/ so that everyone wasn't just doing their own thing.
I feel that there are times when the right thing to do is to point to the upstream problem and make it very clear where this problem needs to be fixed. I don't think it is a problem with the HTML as such, but the rendering by other software.
Some UK gov links on this topic:
From one of these threads someone recommended:
https://u-elements.github.io/u-elements/elements/u-details
Which claims:
I guess Safari/VO isn't big enough. They do have a polyfill though.
Other information from A11ysupport.io:
https://a11ysupport.io/tests/tech__html__details-summary
I worry about putting up a non-standard bit of JS that we then need to explain going ahead.
Comment #21
smustgrave commentedRebased as it was 700+ commits back. The failure
Seems related to the change.
Comment #22
kentr commentedLooks like we're going with #3571628: The aria-expanded attribute doesn't change once it became true on a node edit forms detail summary element. I'll transfer credit to that issue.
[Edit: Not really a duplicate, but that sounds better than the other options.]