- From: Bryan Garaventa <bryan.garaventa@ssbbartgroup.com>
- Date: Fri, 27 Nov 2015 22:47:34 +0000
- To: Joseph Scheuhammer <clown@alum.mit.edu>, Dominic Mazzoni <dmazzoni@google.com>, Alice Boxhall <aboxhall@google.com>
- CC: Richard Schwerdtfeger <schwer@us.ibm.com>, "Protocols and Formats Working Group" <public-pfwg@w3.org>
- Message-ID: <SN1PR0301MB198189A081A8774C9B4C269C98030@SN1PR0301MB1981.namprd03.prod.outlook.>
Hi, I'm opening this up to the group since I believe I've got the bugs worked out in the test naming calculation algorithm, thanks Dominic and Joseph for your input, hopefully this now reflects what the recursive string should be based on the intended UAIG mappings. The Name and Description tests and the latest test results have been updated and are available at: https://github.com/accdc/w3c-alternative-text-computation Which can be downloaded from here to change the code and explore differing markup combinations. Now the calculation is dynamically rendered within a textarea field so it can be directly observable as code changes are made, plus Visual ARIA can be optionally loaded to see which roles and attributes are applied and where. This now includes an updated algorithm based on the following logic, also now included within Visual ARIA. Name Calculation #<http://whatsock.com/training/matrices/visual-aria.htm#name-calculation> aria-labelledby (Caveats: Must not be included with aria-label, nor with the HTML label element with matching 'for' and 'id' attributes. Also, aria-labelledby cannot recursively reference other elements that include aria-labelledby. The presence of role="presentation" or role="none" will nullify aria-labelledby on the same node.) aria-label (Caveats: Only if aria-labelledby is not set. If included within a container referenced via aria-labelledby, the HTML label element with matching 'for' and 'id' attributes, or aria-describedby, the value of aria-label will supersede any embedded content or additional aria-label attribute values; which will be ignored when setting the Accessible Name of the parent role. The presence of role="presentation" or role="none" will nullify aria-label on the same node.) HTML label element with matching 'for' and 'id' attributes (Caveats: Only if aria-labelledby or aria-label is not set; on HTML input and select elements only.) HTML 'alt' attribute (Caveats: Only if aria-labelledby or aria-label is not set; on HTML img elements only. The presence of role="presentation" or role="none" will nullify 'alt' on the same node.) HTML 'title' attribute (Caveats: Only if aria-labelledby, aria-label, or 'alt' is not set; on HTML img elements only. The presence of role="presentation" or role="none" will nullify 'title' on the same node.) Description Calculation #<http://whatsock.com/training/matrices/visual-aria.htm#description-calculation> aria-describedby (Caveats: Must not be included with the HTML 'title' attribute, which will be overwritten by aria-describedby. The presence of role="presentation" or role="none" will nullify aria-describedby on the same node.) HTML 'title' attribute (Caveats: Only when applied to active elements that are not HTML img elements. Must not be included with aria-describedby, which will overwrite the value of 'title' as the Description. The presence of role="presentation" or role="none" will nullify 'title' on the same node.) Important Details #<http://whatsock.com/training/matrices/visual-aria.htm#important-details> Any use of aria-hidden="true" or the CSS properties "display:none" or "visibility:hidden", will cancel the naming calculation for the referenced element and all elements within the subtree of that element. Additionally, the presence of CSS content via the :before and :after pseudo elements are also included as part of the naming calculation. Please let me know if anything is incorrect in the algorithm or in the Visual ARIA representation of this. We all really need to be on the same page about this. All the best, Bryan -----Original Message----- From: Bryan Garaventa Sent: Thursday, November 26, 2015 2:43 PM To: 'Joseph Scheuhammer' <clown@alum.mit.edu>; Dominic Mazzoni <dmazzoni@google.com>; Alice Boxhall <aboxhall@google.com> Cc: Richard Schwerdtfeger <schwer@us.ibm.com>; 'Alexander Surkov' <surkov.alexander@gmail.com> Subject: RE: Questions about your name calculation litmus tests > " ... if the current node's native markup provides an attribute or > element that defines a text alternative, return that > alternative as > a flat string, *unless the element is marked as presentational > (role="presentation" or role="none")*. " [2] Hi, just looking at my original tests, it looks like Firefox is actually rendering the name of an element that includes role=presentation still. I'll CC Alex here too for his input, and Cynthia since she needs this for Edge too. So, yes, the img is omitted as expected, however the span is not based on this information. It is reflecting the aria-label attribute value of "Eli" instead of skipping this and using "Garaventa" which is the next name in the chain. I've attached the sample showing this. Can you paste the expected naming calculation for role=link in this example? (It's convoluted on purpose to test the theory :) ) Bryan Garaventa Senior Accessibility Engineer SSB BART Group, Inc. bryan.garaventa@ssbbartgroup.com 415.624.2709 (o) www.SSBBartGroup.com -----Original Message----- From: Joseph Scheuhammer [mailto:clown@alum.mit.edu] Sent: Wednesday, November 25, 2015 10:02 AM To: Bryan Garaventa <bryan.garaventa@ssbbartgroup.com>; Dominic Mazzoni <dmazzoni@google.com>; Alice Boxhall <aboxhall@google.com> Cc: Richard Schwerdtfeger <schwer@us.ibm.com> Subject: Re: Questions about your name calculation litmus tests Hi Bryan, First, back in the day (before ARIA), a way to mark an image as decorative, for layout, or generally meaningless was to provide empty alt text: <img alt="" src="spacer.png"> Later, with ARIA, the use of role="presentation" serves the same purpose: <img role="presentation" src="spacer.png"> In fact, it is an author error to give an img element both a role of presentation, and non-empty alt text: <img role="presentation" alt="MIT logo" src="logo.png"> It's a contradiction. The alt text implies the image is meaningful, but the role says it isn't. It can't be both. Now, I've stacked this example in that it's obvious that the image is meaningful since it is of a university logo. The error here is the use of role="presentation". But it could go the other way. The following is an image solely for layout, where the error is non-empty alt text: <img role="presentation" alt="spacer image" src="spacer.png"> Certainly no browser is expected to judge the author's intent. There is no mechanical method to determine if the presentation role or alt text is the valid attribute. However, AFAIK, the rule is that the presentation role wins -- treat all img elements with a role of presentation as meaningless. With respect to the mapping of elements with role="presentation", they are not included in the accessibility tree: "... user agents MUST NOT include ... elements with 'none' or 'presentation' as the first mappable role in the role attribute string ..." [1] (I've combined the relevant text from the beginning of the section and the first bullet item). You are correct that even though a presentation element is excluded from the tree, its content is still included. But, img elements have no content. Consequently, if the img element is excluded from the tree, whether it has a name is moot. There is no accessible object in the tree to attach the name to. Regarding specifically the effect of presentation within the name calculation, step 2D states (my emphasis): " ... if the current node's native markup provides an attribute or element that defines a text alternative, return that alternative as a flat string, *unless the element is marked as presentational (role="presentation" or role="none")*. " [2] I take that to mean: the alt or title or any other attribute of an img element with role="presentation" is not used. It's a corollary of the fact that the element is declared meaningless. If the current node did have children, they would be processed beyond step 2D to determine if any of their text is to be included. However, since img has no children, there is nothing else to do. [1] http://www.w3.org/TR/core-aam-1.1/#exclude_elements2 [2] http://www.w3.org/TR/accname-aam-1.1/#step2D On 2015-11-24 7:49 PM, Bryan Garaventa wrote: > > No problem, > > As far as the first, my understanding of role=presentation is that its > presence shouldn’t have any effect on the naming calculation, since > it’s only changing the role in the accessibility tree but not any of > its content or even label if present. > > This does bring up an interesting corner case though, such as if an > image includes role=presentation as well as a valid alt attribute, > would this still act as a labelled object since technically it is no > longer an image in the accessibility tree and the alt is not a > globally supported labelling mechanism. > > It’s very possible there are UAIG spec issues that are in conflict > here too, so I’ve CCd Joseph and Rich since they have a much clearer > idea of how the underlying mappings should work between these APIs. > > I’d prefer that everybody be on the same page if possible, and shoring > up differences like this will help me out too J > -- ;;;;joseph. 'Array(16).join("wat" - 1) + " Batman!"' - G. Bernhardt -
Received on Friday, 27 November 2015 22:48:08 UTC