-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add strong and emphasis roles #953
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the definition says this is one or more characters, the role description does not include any information about context for appropriate use and constraints on use if there are any. For instance, can you wrap main in a div with role emphasis? What are the HTML restrictions? Can you wrap a link in emphasis or must you put the <em>
inside the link text? I haven't looked up the content model for <em>
. If an <em>
cannot contain interactive content, or even a heading, for instance, the perhaps the emphasis role should have children presentational true. I think this aspect of appropriate useage must be addressed before merging. We might be able to better address this, or do so mor succinctly, when we hhave an abstract phrase-like role.
github is messing with me ... I can't seem to find my last review comment so adding it again. appologize if it is a dupe: Like the emphasis role, the strong role also needs information describing whether there are any constraints on descendant content. |
@mcking65: Regarding this:
I think that makes good sense. But I am not an author, so I'll leave it to the group to decide and then update this PR accordingly. |
The ARIA Working Group just discussed The full IRC log of that discussion<jamesn> TOPIC: https://github.com//pull/953<MarkMcCarthy> jamesn: PR 953 is for strong and em, joanie? <MarkMcCarthy> joanie: matt did a full review earlier today, he did some wordsmithing. i already pushed the smithing changes, but he raised a good comment <joanie> While the definition says this is one or more characters, the role description does not include any information about context for appropriate use and constraints on use if there are any. For instance, can you wrap main in a div with role emphasis? What are the HTML restrictions? Can you wrap a link in emphasis or must you put the <em> inside the link text? I haven't looked up the content model for <em>. If <joanie> an <em> cannot contain interactive content, or even a heading, for instance, the perhaps the emphasis role should have children presentational true. I think this aspect of appropriate useage must be addressed before merging. We might be able to better address this, or do so mor succinctly, when we hhave an abstract phrase-like role. <MarkMcCarthy> joanie: mck's comment is above <MarkMcCarthy> joanie: mck has lots of good questions! but i don't have answers for all of them. based on all this, don't think we're ready to merge <MarkMcCarthy> ... waiting for others to assist <MarkMcCarthy> jamesn: the only restrictions we have on this in aria spec is things like children presentational, no other restrictions really <MarkMcCarthy> jamesn: sometimes in prose <pkra> they can be nested. <MarkMcCarthy> jamesn: are there any hierarchy restrictions? <MarkMcCarthy> joanie: i don't think so, thought we rely on AP to put in specifics <pkra> q+ <MarkMcCarthy> ack pkra <MarkMcCarthy> pkra: didn't we have a discussion about nests? the fact they can be nested in html seems like we shouldn't put children presentational <MarkMcCarthy> Scott_O: there could be a use case for mimicing HTML <MarkMcCarthy> carmacleod: sounds like children presentational can't work too well <MarkMcCarthy> jamesn: why wouldn't it be valid to have an entire paragraph emphasized? <MarkMcCarthy> Scott_O: depends on how close we are to mimicing what HTML allows <MarkMcCarthy> Scott_O: you could wrap an entire paragraph in em, but follow the proper structure <MarkMcCarthy> jamesn: i don't really mind whatever we choose, it'll probably work <MarkMcCarthy> joanie: in the spirit of consensus, could people give this some thought, comment and/or discuss with matt on the PR issue? <joanie> https://github.com//pull/953 <jamesn> GitHub: https://github.com//pull/953 <MarkMcCarthy> joanie: those with opinions could discuss in the issue. as a screen reader dev, i just need to know what I'm getting <MarkMcCarthy> Scott_O: i'll get to that asap |
HTML strong and em are allowed to contain phrasing content, which includes anchor, button, input, select, etc. |
They are not supposed to contain block-level content, which includes sectioning content, headings, div, paragraph, etc. (so for example, an entirely emphasized paragraph would need to have the em as a child of the p and not the other way around). However, other than "Required Context Role" or "Required Owned Elements" (which I don't think apply here?) and related prose, are there other places in the ARIA spec where we discuss constraints on descendant content? i.e. Maybe this type of information belongs in the APG? |
@carmacleod beat me to pushing this comment, i had to leave it alone for awhile to attend to some client work. So apologies for repeating / expanding on some same ideas Carolyn.
Regarding appropriate use and constraints, using Matt's example of With that said, how should this be outlined in ARIA? Appropriate use and constraints seems to be mentioned in regards to roles that have required owned elements, or a required context role. To outline these considerations for This could get quite cumbersome if individual roles were outlined whether in the prose or as part of the characteristics table. To mitigate some of this, roles could be categorized as they are in HTML, and then indicate the allowed roles via their categorization (e.g. phrasing content). OR, a simpler solution to this could be to mention the role should match the HTML element's existing definitions / allowances, and to refer to the related concepts (which already link to the HTML definition)? Because I do think it's worth mentioning, or at the very least alluding to, these sorts of appropriate uses and constraints. |
@carmacleod commented:
Correct, they do not apply because, as defined today, they are not restrictive. Required owned elements definition does not say that other types of elements are not allowed. This, btw, has been a point of author confusion. @carmacleod continues:
Just prose and then children presentational. While children presentational true doesn't say you cannot include child elements of any specific type, it wipes out all child semantics. When it comes to the accessibility tree then, children presentational true is equivalent to a restriction. @carmacleod asks:
APG is not normative, and this is an important validation issue. I'm pretty certain ARIA should not allow ARIA declarations that conflict with HTML. I think role parity needs to also mean parity of allowed usage. @scottaohara commented:
The definition of required owned elements does not prohibit other type of elements in a context. Perhaps it should though. @scottaohara continues:
While ARIA does not restrict what children a button can have, it does restrict what accessibility semantics will be exposed because children presentational is true. From an accessibility perspective, this is almost equivalent because the accessibility tree is built as if the button contains only text nodes, which is even more restrictive than HTML. That said, if you create a button with a focusable child, focus will go inside the button. ARIA probably should explicitly prohibit interactive descendants of button. So, I agree that there is a gap here. @scottaohara continues:
Unfortunately, that would create a normative dependency on HTML, which we do not want. We might need to:
|
Thanks for the detailed reply @mcking65 Largely agree with the points you raised, and per your closing summary:
Circling back to this PR, should these new ideas be blockers for merging the new roles as they are now? I think with the updates you requested, and @joanmarie implemented, I bring this up because if this information is a blocker here, then it likely stands to be a blocker for other new roles that are to be added as well. |
Preview | Diff