W3C home > Mailing lists > Public > public-pfwg@w3.org > February 2014

Re: Effect of role=presentation on img elements with svg

From: James Craig <jcraig@apple.com>
Date: Mon, 03 Feb 2014 17:45:02 -0800
Cc: public-pfwg@w3.org, Bryan Garaventa <bryan.garaventa@whatsock.com>, Steve Faulkner <faulkner.steve@gmail.com>, Joanmarie Diggs <jdiggs@igalia.com>, Cynthia Shelly <cyns@microsoft.com>, "T.V Raman" <raman@google.com>, "Gunderson, Jon R" <jongund@illinois.edu>, Jason White <jason@jasonjgw.net>
Message-id: <850F8A5A-B7E7-4345-B7B3-BAE606743ABD@apple.com>
To: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
On Feb 3, 2014, at 5:18 PM, Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> wrote:

> James Craig, Mon, 03 Feb 2014 15:29:24 -0800:
> 
>> On Feb 3, 2014, at 3:07 PM, Leif Halvard Silli  wrote:
>> 
>>> The challenge is that the @src attribute doesn’t represent ”child 
>>> nodes”.
>> 
>> It does for <iframe>. It only hasn’t for <img> because most images 
>> are flattened raster data.
> 
> Why don’t you count @src as ”implicit native role semantic”?
> 
> Presentation role flattens ”implicit native role semantics”. But how do 
> we decide what an element’s ”implicit native role semantics” are? The 
> @alt attribute is not unique to <img>, so uniqueness is not the 
> criteria. 
> 
> Or consider the this script element. If @src is not part of script’s 
> implicit native semantics, should I then fear that applying 
> role="presentation" would cause AT to start reading the file referenced 
> by the script element?
> 
>   <script aria-hidden="false" style="display:block"
>           role=presentation src=file></script>

Good question, and I think I have a good answer for you.

They are still sufficiently different because the @src contents of <iframe> and <img> are displayed, where as the @src contents of the <script> element will never be displayed in any modality of which I am aware. That said, the node contents of <script> can be rendered, as it just has a default style of display:none. For example, I would expect these contents to render to both sighted users and AT users, and it works as I expected my browser.

<body>
	<script type="text/javascript" style="display:block;" role="presentation">
		// Browsers will display and AT may read this JavaScript comment
	</script>
	<p>The other body contents.</p>
</body>

This discussion has gone off the academic deep end though. 


> It is *one* issue that AT digs into the SVG of a <img> when the <img> 
> *has* img role - by default or explicitly. That makes very much sense. 
> Even if I consider it to be not reflected, yet, in HTML5.
> 
> However, per my thinking, the @src attribute, belongs to the img 
> element’s ”implicit native role semantics” and hence should be 
> flattened when the element has role="presentation". To bring in, that 
> ”what if <img/> had looked like <img>text</img>, is not relevant.
> 
> Currently, these elements has the @src attribute: audio; embed; iframe; 
> img; input; script; source; track; video. ANd I would say that setting 
> the role of any of these elements to presentation, should flatten the 
> src attribute. The one element that clutters this up, is the iframe 
> element.

I don’t think role="presentation” on <video> or <audio> should flatten the shadow DOM contents. For example, native captions are displayed by WebKit as a shadow DOM descendant of the <video> element. Why should these descendant elements be treated any differently than any other descendant elements?

If you actually want to *hide* all the contents (it really sounds like this is what you’re trying to do), aria-hidden or display:none are the best ways to do so.


>>> And further, one could argue that @src, just as @alt, is a 
>>> specific img element feature, and that @srec therefore should be 
>>> nullified, when img has presentation role. In my view, this makes 
>>> sense, because the graphic is supposed be presentational for *all* 
>>> users.
>> 
>> I think the core of this debate is still that the name “presentation” 
>> has historically meant, that the entire sub-tree is devoid of 
>> semantic meaning, but that’s not what role="presentation" means, 
>> which is why we’re talking about choosing a new name. There is too 
>> much historical baggage that comes with that term. 
>> 
>> Even here, you’re using <img src="file.svg" role="presentation">  
>> when you’d get what you want if you just used: either <img 
>> src="file.svg" alt=""> or <img src="file.svg" aria-hidden="true">
> 
> Are you saying that alt="" and aria-hidden="true" are synonyms? 

No, but in most AT/browser combos, they accomplish the same thing.

> According to ”the baggage” it is alt="" and role="presentation" that 
> are synonyms … ?!

That may be some of the baggage, but personally I do not agree that those two are synonyms either.

James
Received on Tuesday, 4 February 2014 01:45:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:45:00 UTC