-
Notifications
You must be signed in to change notification settings - Fork 267
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
Element div not allowed as child of element button in this context #1332
Comments
not exactly. a a an |
Well, at least JAWS and VoiceOver will treat Nonetheless then there is surely some inconsistency. In similar case there is specific complain about the element with the role itself. So maybe the same case can be here... An element with role xxx must not contain DIV... <!DOCTYPE html>
<html lang="">
<head>
<title>Test</title>
</head>
<body>
<a><div tabindex="-1">VALID</div></a>
<a role=button><div tabindex="-1">VALID</div></a>
</body>
</html> |
they announce the role the same. They don't do anything beyond that. E.g., a re: nested headings - yeh... that's something that need to be further defined and is actually an open issue for ARIA in HTML to specify. While related, that's beyond the scope of what's being called out here. re: your final example about element with tabindex=-1, again that's a different check about not having nested focusables in interactive elements. Again, i would suggest that this is more a topic of "is it really a problem for a div to be a child of an html button?" in the past it likely was, but browsers do pretty well at error correcting for that nesting these days. i don't see the point in flagging the following though: <div role=button tabindex=0>
<div style=...>...</div>
</div> so long as there are no other roles/properties important for accessibility, there's nothing 'wrong' with the markup snippet i provided. saying that a |
Surely I agree with you in regards of If so, maybe then instead, the issue is rather that a new validation rule should be introduced, such as "An element with The second case is solved for <!DOCTYPE html>
<html lang="">
<head>
<title>Test</title>
</head>
<body>
<button><div role="heading" aria-level="2">I am a heading</div></button>
<button><h2>I am a heading</h2></button>
<div role="button"><div role="heading" aria-level="2">I am a heading</div></div>
<div role="button"><h2>I am a heading</h2></div>
</body>
</html> |
Yes. Again, the no The reason a heading's implicit ARIA role is being suppressed within a The rules you are looking for would be normatively defined by the resolution of w3c/html-aria#362 |
Yes, that's exactly what the MDN article I posted says
Thank you. Not sure how to understand this. Is it that per your opinion |
no. that's not what i've been saying. If you read the ARIA in HTML spec, you'd see that there are many rules for use of ARIA with HTML that are presently part of validating HTML. What I have been telling you is that nesting allowances for HTML elements and nesting allowances for HTML elements with explicit ARIA roles are not a 1 to 1 match. Your original post in this thread is one example of this discrepancy, because there is nothing wrong with it from an HTML validation standpoint, nor a validation of HTML & ARIA. An An Your shift to talking about headings within buttons being invalid is something that does need to be addressed with the validator. The ARIA in HTML issue I linked to is where we will be defining the nesting rules to account for situations like: <button> <div role=heading>invalid</div> </button> where the |
I see clearly now where we have a disagreement on the matter. You don't, but I do however consider that it would be useful for the validator to address for |
What value is consistency if the validation error isn’t actually an error? |
Everything explained in the first post. I agree to disagree and this
discussion sadly doesn't lead anywhere productive anymore. So thank you for pointing out
what's on your mind. And likewise. I summarized everything in the first post.
…On Sun, Mar 13, 2022, 19:01 scottaohara ***@***.***> wrote:
What value is consistency if the validation error isn’t actually an error?
—
Reply to this email directly, view it on GitHub
<#1332 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUWHS2G7LKTEDA567G7LBLU7Y3PTANCNFSM5QMZ4O2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@scottaohara Is there anything here for which the checker is out of conformance with current specs? |
Hi there, the following code is being validated:
As per error message, both cases should be invalid then, but only the first one currently is.
UPDATE: As Scott argued this might not have anything to do with HTML Validator. Moreover the question can be rather "is it really a problem for a div to be a child of an html button?", and yes, nowadays there should be nothing wrong with it! But imo, as the things are now here we have a problem in consistency. Because there are many other ARIA things currently reported by HTML Validator. As such, if something is reported for a
button
, then consistently it should be reported forrole=button
too. It would be even for<div role="button"><div>Example<div></div>
given that , abutton
element has an implicitrole=button
, hence same rules should apply. Having said that, it is also defined about therole=button
in the table "Allowed descendants of ARIA roles" under https://www.w3.org/TR/html-aria/#aria-tableThe text was updated successfully, but these errors were encountered: