img issue: should we restrict the URI

http://www.w3.org/TR/html5/#the-img has an issue highlighted:  "Should
we restrict the URI to pointing to an image? What's an image? Is PDF
an image? (Safari supports PDFs in <img>  elements.) How about SVG?
(Opera supports those). WMFs? XPMs? HTML?"

My belief is that we should not restrict the URI or specify the format.

Would the following text be sufficient?

    "If the UA understands how to treat the resource as an image, then
this is sufficient for the UA to render it, otherwise the alt text
shall be used."

Of course the problem with this is: what does "treat the resource as
an image" mean?  This leads to the root question in the issue "What's
an image?".

How about this as a starter definition:

    "An image, as defined in this specification, is a non-interactive,
visual representation of something." (any better word(s) than
"something" ?)

This definition leaves the door open for existing, widely-deployed
raster resources (JPEG, PNG, GIF, XPM) and animated rasters (GIFs,
APNG, MNG).  It also allows static/animated vector graphics (SVG,
WMF).

Anything that's interactive fits more into the "embedded content"
model, in my opinion, and the author should use the <object> or
<embed> construct.  My definition of "interactive" in this sense is
"allowing the user or the user agent control over the visual
representation of the image".  This would include Play/Pause, Zoom,
Restart, Pan, Find, etc.  If an author wants to give the users some
way of controlling the image then they should embed the content.

This means that HTML browsers would treat SVG images (<img
src="foo.svg" />) as non-interactive (receiving no input events) and
having no accessible DOM (does not allow user agent to control the
image), but still animatable via SMIL.

Question 1: What about <script> elements inside the SVG file?  Are
they still executed?  By my definition of "interactive" above, they
would be, but I still don't like it.

Question 2: Does Opera 9.5's implementation of "SVG as an image" fit
with what I've thrown down here?  What do they exactly do?

Thanks,
Jeff

Received on Thursday, 24 January 2008 21:33:51 UTC