[whatwg] Proposal: @srctype or @type on <iframe>

Gordon P. Hemsley gphemsley at gmail.com
Mon Jul 12 23:31:19 PDT 2010

Hello all.

There a number of attributes that are designed to give the user agent a
preview of what MIME type to except for referenced resource. (And there are
also attributes like @hreflang that preview other things.) And yet,
<iframe>, which has to load a full document, has no ability to allow the
user agent to determine compatibility.

Thus, I propose doing one of the following:
(1) add @srctype to <iframe>
(2) extend the meaning of @type that applies to <a>, <area>, and <link> to
apply to <iframe>, as well

I'm more inclined to believe that option (2) is the better option.

But now for the reasoning.

It should not be assumed that whatever resource included via <iframe> is
going to be of type 'text/html' or another easily parsable type. Thus, it
could be helpful for the author to give the user agent a hint as to what
type of document it is requesting be displayed inline, and allow the user
agent to choose not to display the contents of the <iframe> if it feels it
cannot support it.

The particular use case that prompted me to think about this is including a
PDF via <iframe>. In Firefox (last I checked), one is required to install a
separate add-on in order to support in-browser display of PDF files on Mac
OS X, since there is no native or integrated Adobe Reader support available.
Without the add-on, the user will be prompted to download the PDF file,
which can be very disconcerting if the user wasn't even expecting a PDF
file. And I'm sure there are plenty of other instances where this same
situation occurs. (TIFF files, perhaps? Like on the U.S. Patent Office's

Now, I'm not a spec implementor by any means, but I am a web author and a
web user, so I've been on both sides of this issue. And it doesn't appear
that it would be too complicated to extend the existing support of @type.



Gordon P. Hemsley
me at gphemsley.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100713/40743eef/attachment-0002.htm>

More information about the whatwg mailing list