Update html-aam/roles-contextual.html with <summary> tests
This PR adds additional tests for <summary> role calculation per html-aam <summary> mapping guidance:
If a summary element is not a child of a details element, or it is not the first summary element of a parent details, then the summary element MUST be exposed with a generic role.
Since there are some special rules for Summary, I think it should be its own file rather than split between roles.html and roles-contextual.html.
Another test that is probably missing (and may need spec clarification:
- @rahimabdi if there is only one summary descendant, (and it’s rendered when details is collapsed) it should be used regardless if it’s a child or not. (Prioritize users/authors over spec purity) The first child test should only become a factor when there are multiple summary elements in a single details. (I don’t want the fix for this edge case to break the accessibility of a markup snippet that “works” in the mainstream UI.)
- @scottaohara i didn’t look back at html or html-aam, but that distinction is not in your excerpt above. Instead of making the AAM spec distinction, shouldn’t we defer/link to the HTML spec and expose the summary of whatever they determine is actually rendered?
@cookiecrook if i understand your comment, there is no author defined summary as a direct child of the details, then browsers auto inject a summary as the first child.
so per the following:
<details>
<div><summary>foo</summary></div>
</details>
the the above summary within the div will be a generic because the browser will inject a new summary element prior to that div (with the localized text of 'details')
@scottaohara @cookiecrook May we add this as an agenda item for a future meeting? Happy to take this forward although I have several questions now 🙂
Okay I think @scottaohara explained sufficiently that the other non-child descendants are error-handled by some logic defined in the HTML spec, so the tests are fine, but instead of (or in addition too) this note in HTML-AAM:
If a summary element is not a child of a details element, or it is not the first summary element of a parent details, then the summary element MUST be exposed with a generic role.
…Add a link to this section of the HTML spec defining that behavior:
So I don’t need to meet Rahim (seems this is resolving), but you can add any issue to the meeting agenda by adding the Agenda label.
@scottaohara @cookiecrook Thank you both, this PR is ready for another review.
I've created a new html-aam/summary.html file (and updated roles.html/roles-contextual.html with a documentation link referencing the new file).
@scottaohara @cookiecrook One more question about the HTML-AAM <summary> mapping:
"If the element is the first child of its type within a parent details element: html-summary"
I'm not certain what html-summary references here; is this an abstract role?
@scottaohara @cookiecrook One more question about the HTML-AAM
<summary>mapping:"If the element is the first child of its type within a parent details element:
html-summary"I'm not certain what
html-summaryreferences here; is this an abstract role?
there is no direct ARIA role for a summary element at this time. Previously (somewhere in the ARIA minutes) we resolved to treat elements that didn't have or didnt have an agreed upon ARIA role to have 'platform' computed rules. So in this case html-summary. Where as video would have a platform computed role of html-video
does that help, or did i misunderstand your question?
@rahimabdi
- https://github.com/w3c/html-aam/issues/511
- https://github.com/w3c/html-aam/pull/519
And: https://github.com/w3c/core-aam/commit/5d6012b746ffed1778204f9bfc837a70d966e741#diff-0eb547304658805aad788d320f10bf1f292797b5e6d745a3bf617584da017051R367