W3C home > Mailing lists > Public > public-aria@w3.org > February 2016

Re: aria-ACTION-2007: Rewrite proposal to take into account that an img with source svg has no children and also to address the required owned elements

From: James Craig <jcraig@apple.com>
Date: Tue, 2 Feb 2016 01:00:53 -0800
Cc: Richard Schwerdtfeger <schwer@us.ibm.com>, Accessible Rich Internet Applications Working Group <public-aria@w3.org>
Message-Id: <103E3394-4E89-413E-A32F-101ACE0EFE3E@apple.com>
To: Joseph Scheuhammer <clown@alum.mit.edu>

> On Jan 22, 2016, at 10:38 AM, Joseph Scheuhammer <clown@alum.mit.edu> wrote:
> On 2016-01-21 9:42 PM, James Craig wrote:
>>> >On Jan 21, 2016, at 1:47 PM, Joseph Scheuhammer<clown@alum.mit.edu>  wrote:
>>> >
>>>> >>An image with external src SVG does have children. If your browser does not support them, that should be filed as a browser bug. See correct behavior in Safari/WebKit.
>>> >
>>> >There may be confusion here about what "children" means here. During the meeting, Fred said that an <img src="svg"> does not produce DOM children of the <img> element.
>>> >
>>> >To confirm, I tried the following with FF, Safari, and Chrome. and their respective DOM inspector tools. There is an <img> element in the DOM for each of the svg palm trees, but those <img> elements do not have DOM children.
>> That's just a lacking feature in the dev tools. Here's the WebKit Inspector enhancement request.
>> https://bugs.webkit.org/show_bug.cgi?id=121319
> It's more than that.  The IDL for the img element does not provide for the DOM of the svg.  For example, accessing the children of the img element returns a zero length array:  img.children.length == zero.  That result is not via the DOM inspector, but by running a script within the page.
> While a DOM inspector could implement a way to grab the referenced svg DOM, the img element IDL won't be any different than it is now. What is needed, as you suggested, is that the specification of the <img> element change, either by allowing children, or providing access analogous to that given by the <iframe> (iframe's contentDocument property or its getSVGDocument() method).
> But, as of today, there is no such API for img.
> How can I see the behaviour that Safari/WebKit implements?

You can use the Accessibility Inspector (on OS X or in the iOS Simulator) to see the exposed nodes. The WebKit Web Inspector doesn't yet display a complete DOM for remotely loaded images, as mentioned in the above-referenced WebKit enhancement. 

> I've poked around in Safari's console and injected scripts to search for a property or method to get the svg DOM from an img element, but I'm not seeing anything.  I thought there might be a "webkit*" property, but there isn't.  Is WebKit's behaviour in this regard documented somewhere?

The Accessibility nodes can be referenced in WebCore, but are not exposed b/c there is no existing web standard for how to expose this data. 

>>> >http://tecfa.unige.ch/guides/svg/ex/html5/inkscape-import/html5-import-with-img.html
>>> >
>>> >Also, the HTML spec for the <img> elements states that it has an empty content model [1], making <img> a leaf node.
>>> >
>>> >[1]https://www.w3.org/html/wg/drafts/html/master/semantics.html#the-img-element
>> I believe the HTML spec should be updated to call some images a "nested browsing context" like an iframe.
> -- 
> ;;;;joseph.
> 'Array(16).join("wat" - 1) + " Batman!"'
>           - G. Bernhardt -
Received on Tuesday, 2 February 2016 09:01:23 UTC

This archive was generated by hypermail 2.4.0 : Thursday, 24 March 2022 20:23:19 UTC