Image (and thus SVGImage and PDFDocumentImage) need size-negotiation
Image needs new methods:
virtual FloatSize Image::intrinsicSize()
virtual FloatSize Image::sizeForViewport(const FloatSize& destSize)
(or some equivalent API)
to allow for scalable images to draw filling the viewport. These would replace the current size() call. SVGImage would override sizeForViewport() to return the maximum scaled size for that viewport. Code already exists in SVGImage::size() for doing this kind of sizing, it's just not wired up (as no destSize is passed in).
SVGImage::draw will now likely require a call to FrameView::setSize, or perhaps that size call has moved to the Page now or one of the clients. The layout machinery should automatically take care of re-laying out the SVG at the new size.
Ok, so we need to support percentage based intrinsic widths as part of CSS 2.1:
That will allow us to have <img> and <object> do proper size negotiation. I'll file a separate bug on that.
the CSS support bug is filed as bug 15849.
See also Bug 5793.
(In reply to comment #1)
> Ok, so we need to support percentage based intrinsic widths as part of CSS 2.1:
> That will allow us to have <img> and <object> do proper size negotiation. I'll file a separate bug on that.
Fixed in trunk already for <object>/<iframe>/<embed>. Soon <img>/background-image will switch to the new size negotiation logic as well, see bug 15849.
Closing this master bug, it has been fixed for SVGImage. Its yet unclear if PDFDocumentImage wants this.