Changeset 194706 in webkit
- Timestamp:
- Jan 7, 2016 11:40:46 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194704 r194706 1 2016-01-07 Chris Dumez <cdumez@apple.com> 2 3 Directly-composited animated GIFs never resume once scrolled offscreen 4 https://bugs.webkit.org/show_bug.cgi?id=152817 5 <rdar://problem/19982020> 6 7 Reviewed by Daniel Bates. 8 9 Add a layout test to check that directly-composited animated GIFs are 10 properly suspended / resumed based on visibility inside the viewport. 11 12 * fast/images/composited-animated-gif-outside-viewport-expected.txt: Added. 13 * fast/images/composited-animated-gif-outside-viewport.html: Added. 14 1 15 2016-01-06 Joseph Pecoraro <pecoraro@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r194697 r194706 1 2016-01-07 Chris Dumez <cdumez@apple.com> 2 3 Directly-composited animated GIFs never resume once scrolled offscreen 4 https://bugs.webkit.org/show_bug.cgi?id=152817 5 <rdar://problem/19982020> 6 7 Reviewed by Daniel Bates. 8 9 Directly-composited animated GIFs would never resume once scrolled 10 offscreen. This is because calling repaint() in this case would not 11 cause BitmapImage::draw() to be called and the animation would thus 12 not be resumed. To address the problem, 13 repaintForPausedImageAnimationsIfNeeded() now calls 14 RenderBoxModelObject::contentChanged(ImageChanged) in addition to 15 repaint() to make sure the animation actually gets resumed, even in 16 the directly-composited animated GIF case. 17 18 Test: fast/images/composited-animated-gif-outside-viewport.html 19 20 * platform/graphics/BitmapImage.h: 21 Make currentFrame() public so it can be exposed via Internals for the 22 purpose of testing. 23 24 * rendering/RenderElement.cpp: 25 (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): 26 Call RenderBoxModelObject::contentChanged(ImageChanged) in addition to 27 calling repaint() to make sure the animation actually gets resumed in 28 the directly-composited animated GIFs case. 29 30 * testing/Internals.cpp: 31 (WebCore::Internals::imageFrameIndex): 32 * testing/Internals.h: 33 * testing/Internals.idl: 34 Expose new "unsigned long imageFrameIndex(Element)" operation on 35 Internals so layout tests can better check if an image is actually 36 animating. Previously, we would rely on the output of 37 internals.hasPausedImageAnimations(Element) but this is not sufficient 38 to cover this bug as our rendering code believed it has resumed the 39 animations but the GIF was not actually animating due to it being 40 directly-composited. 41 1 42 2016-01-07 Michael Catanzaro <mcatanzaro@igalia.com> 2 43 -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r192140 r194706 184 184 bool allowSubsampling() const { return m_allowSubsampling; } 185 185 void setAllowSubsampling(bool allowSubsampling) { m_allowSubsampling = allowSubsampling; } 186 187 size_t currentFrame() const { return m_currentFrame; } 186 188 187 189 private: … … 211 213 #endif 212 214 213 size_t currentFrame() const { return m_currentFrame; }214 215 size_t frameCount(); 215 216 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r194645 r194706 1518 1518 if (!shouldRepaintForImageAnimation(*this, visibleRect)) 1519 1519 return false; 1520 1520 1521 repaint(); 1522 1523 // For directly-composited animated GIFs it does not suffice to call repaint() to resume animation. We need to mark the image as changed. 1524 if (is<RenderBoxModelObject>(*this)) 1525 downcast<RenderBoxModelObject>(*this).contentChanged(ImageChanged); 1526 1521 1527 return true; 1522 1528 } -
trunk/Source/WebCore/testing/Internals.cpp
r194672 r194706 33 33 #include "ApplicationCacheStorage.h" 34 34 #include "BackForwardController.h" 35 #include "BitmapImage.h" 35 36 #include "CachedImage.h" 36 37 #include "CachedResourceLoader.h" … … 589 590 } 590 591 592 size_t Internals::imageFrameIndex(Element* element, ExceptionCode& ec) 593 { 594 if (!is<HTMLImageElement>(element)) { 595 ec = TypeError; 596 return 0; 597 } 598 599 auto* cachedImage = downcast<HTMLImageElement>(*element).cachedImage(); 600 if (!cachedImage) 601 return 0; 602 603 auto* image = cachedImage->image(); 604 return is<BitmapImage>(image) ? downcast<BitmapImage>(*image).currentFrame() : 0; 605 } 606 591 607 void Internals::clearPageCache() 592 608 { -
trunk/Source/WebCore/testing/Internals.h
r194117 r194706 105 105 unsigned memoryCacheSize() const; 106 106 107 size_t imageFrameIndex(Element*, ExceptionCode&); 108 107 109 void clearPageCache(); 108 110 unsigned pageCacheSize() const; -
trunk/Source/WebCore/testing/Internals.idl
r194117 r194706 206 206 [RaisesException] boolean isPageBoxVisible(long pageNumber); 207 207 208 [RaisesException] unsigned long imageFrameIndex(Element element); 209 208 210 readonly attribute InternalSettings settings; 209 211 readonly attribute unsigned long workerThreadCount;
Note: See TracChangeset
for help on using the changeset viewer.