Re: Progress on SVG book -- question concerning <embed> vs <object> in HTML

On Sat, 04 Apr 2009 16:46:34 +0200, Dailey, David P. <david.dailey@sru.edu> wrote:

> Hi Doug,
> 
> I was at the very end of a most thorough and elegant reply when Microsoft Outlook Web Access crashed and left no trace of my work. This will be more to the point... sigh!
> 
>
> DD> Way back when, <embed> was recommended by Adobe as the preferred way to
>> put SVG in HTML. [history as I understand it was that <object> plus
>> script introduced a security problem forcing Adobe to disable it]
>
> DS: Hmmm... I don't recall this.  Was this a recent development?
>
> I learned about it from Martin Honnen (http://tech.groups.yahoo.com/group/svg-developers/message/57827 ) a while back.
> Originally when I read the release notes associated with 3.03, it sounded like it had been fixed, but Martin's reading suggests that the disabling of script through <object> discussed in 3.01 was still valid for 3.03.  Alas, nowadays SVG in <object> does not even render in IE/ASV unless one uses the <param> trick.
>
> DS: I know that <object> used to crash some browsers, like Safari, which is
> why we hesitated using it a while back.  But it seems to work well in
> Opera, Firefox, and Safari now.
>
> Yes Chrome too. Only IE/ASV is a problem. Although I seem to have this idea that <object> exposes the Firefox oddity that getSVGDocument() doesn't work there, but that it does in <embed>. Will have to do a bit more testing on that I suppose.

For Opera up to 9.5x (I think, may have been up to 9.2x) <object> was more robust than <embed> for svg, e.g it was possible that it failed to load natively (or at all depending on plugins) in some situations. Nowadays I think it should be fine with either, though my personal preference is still <object>.

Both getSVGDocument and contentDocument are tested in Acid3 (on <object> and <iframe>), test #74.

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Tuesday, 7 April 2009 07:19:34 UTC