Bug 12095
Summary: | Image (and thus SVGImage and PDFDocumentImage) need size-negotiation | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ddkilzer, hyatt, jeffschiller, rindahl, zimmermann |
Priority: | P2 | Keywords: | SVGHitList |
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
Bug Depends on: | 15638, 15849 | ||
Bug Blocks: | 15373, 21910 |
Eric Seidel (no email)
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Eric Seidel (no email)
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.
Eric Seidel (no email)
the CSS support bug is filed as bug 15849.
Simon Fraser (smfr)
http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute
David Kilzer (:ddkilzer)
See also Bug 5793.
Nikolas Zimmermann
(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.
Nikolas Zimmermann
Closing this master bug, it has been fixed for SVGImage. Its yet unclear if PDFDocumentImage wants this.