Summary: | Missing image for SVG embedded in <object> tag in HTML document | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kyle Rove <krove> | ||||||
Component: | SVG | Assignee: | Eric Seidel (no email) <eric> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | ||||||||
Priority: | P2 | ||||||||
Version: | 420+ | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.4 | ||||||||
URL: | http://www.sensoryoutput.com/freshview/index_svg.php | ||||||||
Attachments: |
|
Description
Kyle Rove
2005-09-28 17:41:17 PDT
Can you point me to an example? Or a reduced test case? Thanks. 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 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 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. Created attachment 4206 [details]
An alternative patch, which fixes HTMLObjectElementImpl to not use image mode for SVGs
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 on attachment 4206 [details]
An alternative patch, which fixes HTMLObjectElementImpl to not use image mode for SVGs
r=me
|