W3C home > Mailing lists > Public > public-html@w3.org > July 2008

Re: img issue: should we restrict the URI

From: Jeff Schiller <codedread@gmail.com>
Date: Tue, 29 Jul 2008 22:37:14 -0500
Message-ID: <da131fde0807292037h431de36bk1daf75d3c71c6541@mail.gmail.com>
To: "Ian Hickson" <ian@hixie.ch>
Cc: "HTML WG" <public-html@w3.org>
On Tue, Jul 29, 2008 at 9:14 PM, Ian Hickson <ian@hixie.ch> wrote:

> On Thu, 24 Jan 2008, Jeff Schiller wrote:
> >
> > 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.
> So should UAs support text/plain and text/html resources in <img>
> elements?

First - I do not think we should restrict the URI.  For example
http://www.example.com/foo.php could return image/png.  Originally, I
thought maybe the idea was to restrict the URIs to some predefined set of
file prefixes (.png, .gif, .jpg, etc) - but I then realized that it was
asking the question of whether the resource that the URI points to should be
of a certain list of types.

I still don't like the idea of only a certain set of types as it is isn't
forward-looking and it requires drawing some lines in the sand and say this
type is 'blessed' and this type is not.

One simple option would be to state that the (proposed) MIME type of the
resource must begin with "image/".  If that, for some reason, is not
sufficient then I think we have to go deeper and figure out what the purpose
of a html:img element is.

I struggled a little bit with the defintiion of an 'image' from an HTML
perspective.  I think the best one I can muster is:

The purpose of an image is to display a visual, non-interactive
representation that cannot be sufficiently achieved through other markup
(such as text, hyperlink or table).

Might get some accessibility folks angry because this automatically means
the 'alt' text of an image is an inferior representation - but I think
that's just the cruel fact.

Anyway, with the above definition of an image, I think it would be
sufficient to say:

"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."

This would rule out things like text and HTML since, by definition, those
things are not images.

However, if someone sees a reason why it would be good to treat text/html as
an image, please elaborate.

Finally, I also think that some guidelines should be defined for how certain
resources are treated as images vs. embedded content.  That's the reason I
include 'non-interactive' in my definition above and we need to define what
that means.  Of course I'm coming from the SVG angle here since UAs are
right now trying to figure out the rules for how they will treat SVG when
included as an img vs. as an object/embed/iframe.

Jeff Schiller
Received on Wednesday, 30 July 2008 03:37:51 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:25:21 UTC