NEW 121068
On ImageDocument, checking for FrameView is needed before ShrinkToFit
https://bugs.webkit.org/show_bug.cgi?id=121068
Summary On ImageDocument, checking for FrameView is needed before ShrinkToFit
KyungTae Kim
Reported 2013-09-09 19:17:25 PDT
Created attachment 211136 [details] PNG image When you load a image like file:///PNG.png, the ImageDocument is generated, then if it should shrink to fit, the scale for the image to fit is calculated, and the image's size is inserted. However, if ImageDocument::imageUpdated is called before the FrameView's size is not yet updated, the scale is calculated as 0 on ImageDocument::scale, and the image's size is set to 0 on ImageDocument::resizeImageToFit. Then the size is not changed after that because ImageDocument::m_imageSizeIsKnown is set. So, in this case, check the FrameView's size and not to set ImageDocument::m_imageSizeIsKnown is needed.
Attachments
PNG image (215.63 KB, image/png)
2013-09-09 19:17 PDT, KyungTae Kim
no flags
Patch (1.70 KB, patch)
2013-09-09 19:25 PDT, KyungTae Kim
beidson: review-
KyungTae Kim
Comment 1 2013-09-09 19:25:14 PDT
Darin Adler
Comment 2 2013-09-09 20:09:32 PDT
Comment on attachment 211138 [details] Patch Can we make a regression test, demonstrating the problem this fixes?
KyungTae Kim
Comment 3 2013-09-09 20:26:40 PDT
(In reply to comment #2) > (From update of attachment 211138 [details]) > Can we make a regression test, demonstrating the problem this fixes? I wanted to make a layout test but I don't know how to make it, because it needs direct load of a image. Is there any exist test case to use a image file itself as a test case?
KyungTae Kim
Comment 4 2013-09-09 20:38:40 PDT
(In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 211138 [details] [details]) > > Can we make a regression test, demonstrating the problem this fixes? > I wanted to make a layout test but I don't know how to make it, because it needs direct load of a image. > Is there any exist test case to use a image file itself as a test case? I tried to use a iframe like below, but in that case, the image was not shrink to fit. <iframe width=100% height=100% src="resources/PNG.png" id="frame"></iframe>
Brady Eidson
Comment 5 2016-05-24 22:02:41 PDT
Comment on attachment 211138 [details] Patch Assuming that patches for review since 2013 are stale, r-
Note You need to log in before you can comment on or make changes to this bug.