Bug 12095 - Image (and thus SVGImage and PDFDocumentImage) need size-negotiation
: Image (and thus SVGImage and PDFDocumentImage) need size-negotiation
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: SVG
: 420+
: Macintosh Mac OS X 10.4
: P2 Normal
Assigned To: Nobody
: SVGHitList
Depends on: 15638 15849
Blocks: 15373 21910
  Show dependency treegraph
 
Reported: 2007-01-03 07:59 PST by Eric Seidel
Modified: 2012-02-22 07:01 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel 2007-01-03 07:59:17 PST
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.
Comment 1 Eric Seidel 2007-11-05 18:35:16 PST
Ok, so we need to support percentage based intrinsic widths as part of CSS 2.1:
http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width

That will allow us to have <img> and <object> do proper size negotiation.  I'll file a separate bug on that.
Comment 2 Eric Seidel 2007-11-28 16:52:02 PST
the CSS support bug is filed as bug 15849.
Comment 4 David Kilzer (:ddkilzer) 2011-04-28 10:19:25 PDT
See also Bug 5793.
Comment 5 Nikolas Zimmermann 2011-06-09 13:15:23 PDT
(In reply to comment #1)
> Ok, so we need to support percentage based intrinsic widths as part of CSS 2.1:
> http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width
> 
> 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.
Comment 6 Nikolas Zimmermann 2012-02-22 07:01:05 PST
Closing this master bug, it has been fixed for SVGImage. Its yet unclear if PDFDocumentImage wants this.