Bug 97223 - Images not loading when the SVG document is embedded via <img>
Summary: Images not loading when the SVG document is embedded via <img>
Status: RESOLVED DUPLICATE of bug 15443
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Florin Malita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-20 08:54 PDT by Florin Malita
Modified: 2012-09-21 10:20 PDT (History)
2 users (show)

See Also:


Attachments
PNG image (green rect) not loaded (658 bytes, text/html)
2012-09-20 08:54 PDT, Florin Malita
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florin Malita 2012-09-20 08:54:01 PDT
Created attachment 164928 [details]
PNG image (green rect) not loaded

When embedding SVG content via SVGImage, SVGImageElements are not loaded.

Chromium issue: http://code.google.com/p/chromium/issues/detail?id=149180
Comment 1 Florin Malita 2012-09-20 09:04:47 PDT
Seems to be caused by the SVGImage resource loader not having autoLoadImages set (because the page settings are default-initialized). I believe it's safe to enable it. 

There is a warning in SVGImage::dataChanged() regarding self-referencing SVGImages:

        // FIXME: If this SVG ends up loading itself, we might leak the world.
        // The Cache code does not know about CachedImages holding Frames and
        // won't know to break the cycle.
        // This will become an issue when SVGImage will be able to load other
        // SVGImage objects, but we're safe now, because SVGImage can only be
        // loaded by a top-level document.

Some quick testing indicates that even with autoLoadImages enabled, the above still holds: because the SVGImage document doesn't have a baseURL, any attempt to resolve the URL for nested SVGImages returns "", effectively limiting the recursion to one level. We can always add a test to catch any future breakage in this area.
Comment 2 Florin Malita 2012-09-20 16:06:01 PDT
Unfortunately, things are not quite as simple for non-Chromium platforms because they require a valid networking context/frame loader client (which SVGImage::dataChanged does not provide). So flipping the auto load bit is not enough...
Comment 3 Alexey Proskuryakov 2012-09-21 10:20:21 PDT

*** This bug has been marked as a duplicate of bug 15443 ***