Summary: | Animated GIFs fail to play in multi-column layout | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Anton Eprev <eprev> | ||||
Component: | Layout and Rendering | Assignee: | Dave Hyatt <hyatt> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | beidson, bfulgham, hyatt, sabouhallawa, simon.fraser, webkit-bug-importer, zalan | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Safari 10 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Anton Eprev
2017-02-06 13:04:29 PST
This is not an image drawing or animation issue. It is a rendering issue. I think it is related to column layout. In the test case https://jsfiddle.net/sdxaxuv5/, RenderElement::newImageAnimationFrameAvailable(), which is called via BitmapImage::advanceAnimation(, succeeds to call RenderObject::imageChanged() for the first four <img> elements in the column <div> element. But it fails to call it for the last two <img> elements. This happens because shouldRepaintForImageAnimation() returns true for the first four images but it returns false for the last two images. Because the image rect is not marked for painting, the last two images do not animate. Fixing the repaint issue should force the image to draw the next image frame. Created attachment 303659 [details]
Patch
Comment on attachment 303659 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=303659&action=review Has this ever worked? > Source/WebCore/rendering/RenderBox.cpp:2301 > + if (is<RenderMultiColumnFlowThread>(this)) { is<RenderMultiColumnFlowThread>(*this) > Source/WebCore/rendering/RenderBox.cpp:2309 > + if (RenderRegion* region = downcast<RenderMultiColumnFlowThread>(this)->physicalTranslationFromFlowToRegion((physicalPoint))) { if (auto* region = downcast<RenderMultiColumnFlowThread>(*this).physicalTranslationFromFlowToRegion((physicalPoint))) Comment on attachment 303659 [details]
Patch
Seems like this could be tested via tracking repaint rects.
|