Summary: | Animated SVG images are not paused when outside viewport | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||||
Component: | SVG | Assignee: | Chris Dumez <cdumez> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | barraclough, buildbot, kling, koivisto, rniwa, sabouhallawa, simon.fraser, webkit-bug-importer, zimmermann | ||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=170335 | ||||||||||||||
Bug Depends on: | 171243 | ||||||||||||||
Bug Blocks: | 170043 | ||||||||||||||
Attachments: |
|
Description
Chris Dumez
2017-03-27 18:33:59 PDT
Created attachment 305545 [details]
WIP Patch
Created attachment 305547 [details]
WIP Patch
Comment on attachment 305547 [details] WIP Patch Attachment 305547 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3425668 New failing tests: svg/animations/animated-svg-image-outside-viewport-paused.html svg/animations/animated-svg-image-removed-from-document-paused.html Created attachment 305574 [details]
Archive of layout-test-results from ews103 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 305620 [details]
Patch
Comment on attachment 305620 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=305620&action=review > Source/WebCore/loader/cache/CachedImage.cpp:121 > + if (m_image) > + m_image->startAnimation(); It might be clearer if this was renamed to something like startAnimationIfNeeded() as it doesn't actually always start it. > Source/WebCore/loader/cache/CachedImage.cpp:526 > + bool shouldPauseAnimation = true; > + > CachedResourceClientWalker<CachedImageClient> clientWalker(m_clients); > - while (CachedImageClient* client = clientWalker.next()) > - client->newImageAnimationFrameAvailable(*this); > + while (CachedImageClient* client = clientWalker.next()) { > + bool canPause = false; > + client->newImageAnimationFrameAvailable(*this, canPause); One bool would be enough (canPause could be moved outside the loop). > Source/WebCore/rendering/RenderElement.cpp:1496 > +void RenderElement::newImageAnimationFrameAvailable(CachedImage& image, bool& canPause) Another option would be to use an enum return value. > Source/WebCore/rendering/RenderView.cpp:1402 > + return Vector<CachedImage*>(); Are these CachedImages somehow guaranteed to stay alive? Created attachment 305639 [details]
Patch
Comment on attachment 305639 [details] Patch Clearing flags on attachment: 305639 Committed r214503: <http://trac.webkit.org/changeset/214503> All reviewed patches have been landed. Closing bug. |