Summary: | On ImageDocument, checking for FrameView is needed before ShrinkToFit | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | KyungTae Kim <ktf.kim> | ||||||
Component: | Images | Assignee: | KyungTae Kim <ktf.kim> | ||||||
Status: | NEW --- | ||||||||
Severity: | Normal | CC: | commit-queue, esprehn+autocc | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Created attachment 211138 [details]
Patch
Comment on attachment 211138 [details]
Patch
Can we make a regression test, demonstrating the problem this fixes?
(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? (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> Comment on attachment 211138 [details]
Patch
Assuming that patches for review since 2013 are stale, r-
|
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.