Re: Summarizing the contentious history of re-opened PFWG-ISSUE-348: Consider renaming (now actually 'deprecating' in ARIA 1.1) role="presentation" to avoid avoid author confusion

On Feb 1, 2014, at 4:39 AM, Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> wrote:

> James Craig, Sat, 01 Feb 2014 01:06:58 -0800:
>> On Jan 31, 2014, at 11:14 AM, Joanmarie Diggs <jdiggs@igalia.com> wrote:
> 
>> 3. User agents, knowing that divs are sometimes meaningful, use 
>> heuristics to determine whether to expose one to platform 
>> accessibility APIs as a generic grouping container, which is not the 
>> same as an element that has been explicitly designated as 
>> semantically meaningless.
> 
> Are <div> and <div role=presentation"> semantically different to AT? 
> What about <span> vs <span role="presentation">? (See example in ARIA 
> 1.1 [1])

Good point. I should probably clarify that example in the spec. In most cases, the example is correct, but if you made the span focusable, or added an event handler, or a few other scenarios, span might be exposed to the APIs anyway. But because ARIA has no role with a 1-to-1 mapping to span, the role is ambiguous.

ACTION-1365: Clarify example in #presentation that indicates <span> is always mapped to presentation; it's not true if an element is focusability, event handlers, or some other properties

>> If we say that role="div" is a synonym of 
>> role="presentation", we’re implying that <div>s should never be 
>> exposed to accessibility APIs, which is likely to break a lot of 
>> things.
>> 
>> My top contenders so far are “none”, “null”, and the empty string (“”).
> 
> I think role="flat", role="flattened" or role="flatten" are better. 
> Because, what presentation role does is that it flattens the signals 
> from many to just one. E.g. for <img>, it flattens the two layers - 
> alternative text and picture - into just one thing - picture.

I think you’re misunderstanding how this works on images. In all cases, the presentation role removes any implicit role mapping (e.g. <h2> no longer maps to “heading”) and therefore any attributes associated with that role (e.g. @alt on img) are also deemed irrelevant. The fact that it works this way on HTML images is just an artifact of the host language that puts the alternative text in an attribute instead of the child contents. 

> And for headings, it flattens hierarchic text to just (plain) text.
> 
> Flat/Flattened is known from many fields as a name for simplification 
> processes were the result is that the basic content is kept while the 
> styling and/or structure is lost. Flat/Flattened thus tells authors 
> that *not everything* is lost, something which could help them 
> understand that the result of flattening an img is different from the 
> result of flattening  a heading - and also help them understand how 
> flatten differs from hiding. Also, for flat/flattens, chances are that 
> authors understand that it is not necessary to apply it to elements 
> that are already flat, such as <span> or <img> with empty alt=“".

You may be misunderstanding the presentation role, too. It does not flatten the contents. All the *standalone* descendant contents nodes retain their semantics. For example, this would be exposed as a heading inside a main landmark.

<main><h2>foo</h2></main>

But this would just be exposed as a heading, because the <main> tag has had its role nullified.

<main role="presentation"><h2>foo</h2></main>


> Some other options roughly in the lane, though I prefer "flatten":
> 
>  role="transparent"
>  role="plain"
>  role=“blank"

Blank is okay, but I still think none and null are closer to the truth.

James


> [1] http://www.w3.org/TR/wai-aria-1.1/roles#presentation
> -- 
> leif halvard silli

Received on Saturday, 1 February 2014 18:32:36 UTC