W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2009

[whatwg] <embed> and <object>

From: Thomas Broyer <t.broyer@gmail.com>
Date: Tue, 16 Jun 2009 10:11:50 +0200
Message-ID: <a9699fd20906160111v2f19351dyec5682e1898247b@mail.gmail.com>
On Tue, Jun 16, 2009 at 1:37 AM, Stephen Paul Weber wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Two questions.
>
> 1) What is the difference between <embed> and <object> in the spec? ?The
> wording is quite different, but seem to say basically the same thing: "plugin
> data".

<object> is not necessarily about plugins (see below).

> 2) Under <object> it says: "The object element can represent an external
> resource, which, depending on the type of the resource, will either be
> treated as an image, as a nested browsing context, or as an external
> resource to be processed by a plugin."
>
> Why specify that a User Agent will use a plugin to process the data if it is
> not an image or nested browsing context? ?Why not leave that decision up to
> the User Agent?

Basically,
if it is an image, <object> is equivalent to <img>
if it is a nested browsing context, <object> is equivalent to <iframe>
otherwise, <object> is equivalent to <embed>

(except that <object> has a richer fallback mechanism than <img>,
<embed> doesn't have one at all)

Though, now that HTML5 introduces <video> and <audio>, I wonder if
<object> couldn't be equivalent to those when type of the resource is
some video or sound...

-- 
Thomas Broyer
Received on Tuesday, 16 June 2009 01:11:50 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:13 UTC