Bug 5175 - Missing image for SVG embedded in <object> tag in HTML document
Summary: Missing image for SVG embedded in <object> tag in HTML document
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Eric Seidel (no email)
URL: http://www.sensoryoutput.com/freshvie...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-28 17:41 PDT by Kyle Rove
Modified: 2005-10-06 04:40 PDT (History)
0 users

See Also:


Attachments
patch that makes Webkit+svg render <object> tags with image/svg+xml type (924 bytes, patch)
2005-10-04 19:54 PDT, Julien Palmas
eric: review-
Details | Formatted Diff | Diff
An alternative patch, which fixes HTMLObjectElementImpl to not use image mode for SVGs (758 bytes, patch)
2005-10-05 00:30 PDT, Eric Seidel (no email)
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Rove 2005-09-28 17:41:17 PDT
Overview Description:

HTML document with <object> tags referencing SVG do not show the SVG content, instead displaying 
the missing image icon. HTML pages with the <embed> tag, do properly show the SVG content, as in 
http://www.sensoryoutput.com/freshview/index_svg2.php

Steps to Reproduce:

1) Create an HTML page with <object> tag referencing an SVG document.
2) View that HTML page.
               
Actual Results: A missing image icon shows up in place of the expected SVG document.

Expected Results: Should see SVG document.

Build Date & Platform: WebKit+SVG nightly build 2005-09-28
Comment 1 Eric Seidel (no email) 2005-10-03 01:28:00 PDT
Can you point me to an example?  Or a reduced test case?  Thanks.
Comment 2 Eric Seidel (no email) 2005-10-03 14:51:20 PDT
Ok, now I notice the URL given is actually an example:

http://www.sensoryoutput.com/freshview/index_svg.php

but directly accessing the svg:

http://www.sensoryoutput.com/mint/pepper/kylerove/freshview/caches/pastweek_graph.svg

works.

Definitely a bug, and different from http://bugzilla.opendarwin.org/show_bug.cgi?id=5246
Comment 3 Julien Palmas 2005-10-04 19:54:39 PDT
Created attachment 4202 [details]
patch that makes Webkit+svg render <object> tags with image/svg+xml type

Hack to render html pages with svg in <object> tags.

The problem comes from KWQPixmap.mm, canRenderImageType methods that returns
yes for the serviceType "image/svg+xml". Is this a desired behaviour that
WebCoreImageRendererFactory supports the svg MIME type ? If yes, the hack
should not take place in canRenderImageType but rather in html_objectimpl.cpp,
HTMLObjectElementImpl::attach()
Comment 4 Eric Seidel (no email) 2005-10-04 22:13:45 PDT
Comment on attachment 4202 [details]
patch that makes Webkit+svg render <object> tags with image/svg+xml type

So a couple things.

1.  We use spaces and not tabs, per:
http://webkit.opendarwin.org/blog/?page_id=25

2.  We would need any SVG specific changes to KWQ to be inside SVG_SUPPORT
change blocks.

Otherwise this looks OK.  We don't need any comments on this type of change. 
It would be better to investigate why WebCoreImageRendererFactory allows this
as a MIME type though.
Comment 5 Eric Seidel (no email) 2005-10-05 00:30:45 PDT
Created attachment 4206 [details]
An alternative patch, which fixes HTMLObjectElementImpl to not use image mode for SVGs
Comment 6 Eric Seidel (no email) 2005-10-05 00:33:26 PDT
Thank you Julien for all your hard work on this bug!    I've gone ahead and adapted your patch and moved 
the code into HTMLObjectElementImpl.  What was causing this was the fact that I created an 
NSSVGImageRep which registers with the NSImage system as able to support SVG images.  Then, due to:
http://bugzilla.opendarwin.org/show_bug.cgi?id=5270
WebKit thought it could support SVGs when it really couldn't.

This patch makes it so that WebCore will always default to it's own SVG rendering for <object> tags (and 
only for object tags), even if the image system says it supports them.
Comment 7 Maciej Stachowiak 2005-10-05 01:11:50 PDT
Comment on attachment 4206 [details]
An alternative patch, which fixes HTMLObjectElementImpl to not use image mode for SVGs

r=me