On first load, SVG images that depend on the image size will be sized incorrectly. Additionally, the SVG image cache is not used much of the time because it depends on a call to CachedImage::setContainerSizeForRenderer(...) that it never receives. Patch forthcoming!
Created attachment 179602 [details] First pass - Queue container size requests while images are loading.
Comment on attachment 179602 [details] First pass - Queue container size requests while images are loading. View in context: https://bugs.webkit.org/attachment.cgi?id=179602&action=review > Source/WebCore/ChangeLog:33 > + (CachedImage): Nit: remove this line
Comment on attachment 179602 [details] First pass - Queue container size requests while images are loading. View in context: https://bugs.webkit.org/attachment.cgi?id=179602&action=review > Source/WebCore/loader/cache/CachedImage.cpp:335 > + for (ContainerSizeRequests::iterator it = m_pendingContainerSizeRequests.begin(); it != m_pendingContainerSizeRequests.end(); ++it) > + setContainerSizeForRenderer(it->key, it->value.first, it->value.second); We should clear pending requests after we send them. > Source/WebCore/loader/cache/CachedImage.h:64 > - void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float); > + void setContainerSizeForRenderer(const CachedImageClient*, const IntSize&, float); We should just remove "renderer" from this. It's somewhat of a layering violation IMO for the loader to know anything about the rendering tree. This can be in a follow-up patch if you'd rather.
Thanks dino. :)
Created attachment 179868 [details] Patch for landing
Thanks for the reviews Dino and Eric! (In reply to comment #3) > (From update of attachment 179602 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=179602&action=review > > > Source/WebCore/loader/cache/CachedImage.cpp:335 > > + for (ContainerSizeRequests::iterator it = m_pendingContainerSizeRequests.begin(); it != m_pendingContainerSizeRequests.end(); ++it) > > + setContainerSizeForRenderer(it->key, it->value.first, it->value.second); > > We should clear pending requests after we send them. Done. > > > Source/WebCore/loader/cache/CachedImage.h:64 > > - void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float); > > + void setContainerSizeForRenderer(const CachedImageClient*, const IntSize&, float); > > We should just remove "renderer" from this. It's somewhat of a layering violation IMO for the loader to know anything about the rendering tree. This can be in a follow-up patch if you'd rather. I agree; lets do it as a followup though. I filed WK105244 to track this.
Comment on attachment 179868 [details] Patch for landing Clearing flags on attachment: 179868 Committed r137981: <http://trac.webkit.org/changeset/137981>
All reviewed patches have been landed. Closing bug.