From a book I'm reading at the moment:
Originally Posted by Hello! HTML5 & CSS3
I have Inkscape installed which uses SVG as its native file format. So I put an img element in a test html page with its source pointing to an Inkscape SVG file. Yup it displayed fine. Then I did the object version. Again it displayed fine. I viewed this in Firefox (Mac version 14.0.1) and used Firebug (v1.10.0) to look at the DOM. What I see doesn't tally with what it says in the book: "…object-embedding approach has results similar to including the SVG inline: the SVG elements are available in the DOM…". I find the object node (the one which links to the SVG file) in Firebug's display of the DOM. That node has an empty list/array ("[ ]") for both childNodes and children.<object type="image/svg+xml" data="svg-2.svg"></object>
In browsers with native support for SVG, the object-embedding approach has results similar to including the SVG inline: the SVG elements are available in the DOM and can be manipulated. This technique works in every browser that has SVG support
Why isn't the SVG code part of the DOM do you think?



Reply With Quote

Bookmarks