RESOLVED FIXED 185216
Hiding then showing an <object> of type image makes the underlaying image disappear
https://bugs.webkit.org/show_bug.cgi?id=185216
Summary Hiding then showing an <object> of type image makes the underlaying image dis...
Said Abou-Hallawa
Reported 2018-05-02 14:17:40 PDT
Created attachment 339339 [details] test case Open the attached test case. The test case contains an <object> element of type image. The script hides the <object> then it shows the <object> again. Result: An outline rectangle is drawn. Expected: The underlaying image of the <object> element is shown. The reason for this bug is the following: -- The ImageLoader and the <object> element stay alive but the RenderImage is destroyed when the element is made hidden. -- When the <object> element is shown again, a new RenderImage is created. -- ImageLoader::updateFromElement() does not call updateRenderer() or dispatchPendingBeforeLoadEvent() because the image is already loaded i.e. (newImage == oldImage). -- Therefore we do not set the CachedImage of the RenderImageResource of the RenderImage. -- When RenderImage::paintReplaced() is called after the image is made visible again, it does not find a CachedImage for its RenderImageResource. -- So RenderImage::paintReplaced() draws an outline rectangle instead.
Attachments
test case (861 bytes, text/html)
2018-05-02 14:17 PDT, Said Abou-Hallawa
no flags
Patch (4.76 KB, patch)
2018-05-02 14:41 PDT, Said Abou-Hallawa
no flags
Patch (4.35 KB, patch)
2018-05-02 15:54 PDT, Said Abou-Hallawa
no flags
Patch (4.30 KB, patch)
2018-05-02 16:58 PDT, Said Abou-Hallawa
no flags
Said Abou-Hallawa
Comment 1 2018-05-02 14:18:41 PDT
Said Abou-Hallawa
Comment 2 2018-05-02 14:41:36 PDT
Said Abou-Hallawa
Comment 3 2018-05-02 15:54:54 PDT
youenn fablet
Comment 4 2018-05-02 16:11:38 PDT
Comment on attachment 339361 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339361&action=review > Source/WebCore/html/HTMLPlugInImageElement.cpp:235 > + RenderImageResource& renderImageResource = renderImage.imageResource(); auto&, maybe no need for renderImage variable also.
Said Abou-Hallawa
Comment 5 2018-05-02 16:58:38 PDT
WebKit Commit Bot
Comment 6 2018-05-02 18:18:01 PDT
Comment on attachment 339364 [details] Patch Clearing flags on attachment: 339364 Committed r231292: <https://trac.webkit.org/changeset/231292>
WebKit Commit Bot
Comment 7 2018-05-02 18:18:02 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.