Prepare SVG image intrinsic size negotiation: Stop sharing SVGImages.
This is needed as SVG image will soon depend on the place where its used.
Size negotiation has to be implemented for border-image/mask-image/background-image/html:img/svg:image.
This is all done already, I'm splitting up my master patch into smaller pieces, this is part one.
Created attachment 105433 [details]
Comment on attachment 105433 [details]
Attachment 105433 [details] did not pass chromium-ews (chromium-xvfb):
New failing tests:
Created attachment 105595 [details]
Fix regressions, should now pass cr-linux-ews again.
Comment on attachment 105595 [details]
Oops, uploaded wrong version.
Created attachment 105601 [details]
Created attachment 105604 [details]
Heh, Patch v3 still contained a missing change to RenderImage.cpp, sorry for the patch spam. This time I got merging everything right.
The patch looks sane to me. But I'd suggest that you ask someone with more experiences in CachedResources. The sentence about the "less dangerous way" scares me :P
CC'ing some experts, this is probably for Antti to review.
Why is this needed in the first place? Isn't SVG scaling just a paint/hit test time transform?
Anyway, I don't think this is the right way to go. Repeatedly re-requesting a resource from network so we can render it in different sizes is not good and we shouldn't complicate the cache code further by introducing the strange concept of "unique cached resource".
Eventually we probably want to separate the cache storage layer (which holds the bits) and the interoperation layer (the decoded forms of the resource). That would make things easier here too.
For now, if you need to cache SVG trees in multiple sizes then that's exactly what you should do. HashMap<IntSize, SVGImage> and all that.
As discussed with Antti, this approach is bad - I've come up with a new concept, that's going to be discussed in a new bug report, see bug 69416.