[whatwg] <embed> and <object>

Thomas Broyer t.broyer at gmail.com
Tue Jun 16 01:11:50 PDT 2009

On Tue, Jun 16, 2009 at 1:37 AM, Stephen Paul Weber wrote:
> 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?

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

More information about the whatwg mailing list