RESOLVED FIXED 99489
Incorrect embedded SVG image sizing on first load
https://bugs.webkit.org/show_bug.cgi?id=99489
Summary Incorrect embedded SVG image sizing on first load
Florin Malita
Reported 2012-10-16 12:30:28 PDT
Created attachment 168997 [details] No red should be visible, only a large green rect. This seems to be timing sensitive, so it may take a few tries: when the attached test is first opened in a new tab/window, the embedded SVG image (data:image/svg+xml) is not scaled according to its container transform.
Attachments
No red should be visible, only a large green rect. (472 bytes, text/html)
2012-10-16 12:30 PDT, Florin Malita
no flags
Patch (3.96 KB, patch)
2012-10-17 12:52 PDT, Florin Malita
no flags
Florin Malita
Comment 1 2012-10-17 10:59:37 PDT
Looks like a race between layout and the image loader: * SVGImageCache::lookupOrCreateBitmapImageForRenderer() needs a m_sizeAndScalesMap entry for the renderer * the only time this is set is from RenderSVGImage::layout() (via updateImageViewport() >> m_imageResource->setContainerSizeForRenderer() >> m_cachedImage->setContainerSizeForRenderer() >> m_svgImageCache->setRequestedSizeAndScales()) The problem is that for this to work, the cached image needs to be present/loaded when RenderSVGImage::layout() is called. If loading finishes after layout, setRequestedSizeAndScales() never gets called. Extending RenderSVGImage::imageChanged() to either force a relayout or just call setRequestedSizeAndScales() should cover this case.
Florin Malita
Comment 2 2012-10-17 12:52:25 PDT
Nikolas Zimmermann
Comment 3 2012-10-21 07:52:52 PDT
Comment on attachment 169237 [details] Patch Good catch!
WebKit Review Bot
Comment 4 2012-10-22 07:10:28 PDT
Comment on attachment 169237 [details] Patch Clearing flags on attachment: 169237 Committed r132069: <http://trac.webkit.org/changeset/132069>
WebKit Review Bot
Comment 5 2012-10-22 07:10:31 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.