Changeset 227841 in webkit
- Timestamp:
- Jan 30, 2018, 11:46:38 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/svg/animated-svgImage-scroll-expected.txt (added)
-
LayoutTests/svg/animated-svgImage-scroll.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderElement.cpp (modified) (2 diffs)
-
Source/WebCore/svg/graphics/SVGImage.cpp (modified) (3 diffs)
-
Source/WebCore/svg/graphics/SVGImage.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r227785 r227841 1 2018-01-30 Dean Jackson <dino@apple.com> 2 3 CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded 4 https://bugs.webkit.org/show_bug.cgi?id=182299 5 <rdar://problem/36853088> 6 7 Reviewed by Simon Fraser. 8 9 * svg/animated-svgImage-scroll-expected.txt: Added. 10 * svg/animated-svgImage-scroll.html: Added. 11 1 12 2018-01-30 Frederic Wang <fwang@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r227796 r227841 1 2018-01-30 Dean Jackson <dino@apple.com> 2 3 CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded 4 https://bugs.webkit.org/show_bug.cgi?id=182299 5 <rdar://problem/36853088> 6 7 Reviewed by Simon Fraser. 8 9 Mostly speculative fix for the case where a scrollTo moves an 10 animated SVG image into view, causing its animation to restart during 11 a paint operation. This was causing a release ASSERT, so we now defer 12 the resumption of the animation into a timer. 13 14 Test: svg/animated-svgImage-scroll.html 15 16 * rendering/RenderElement.cpp: 17 (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the 18 animation if it is an SVGImage. 19 * svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts. 20 (WebCore::SVGImage::SVGImage): 21 (WebCore::SVGImage::startAnimationTimerFired): 22 (WebCore::SVGImage::enqueueStartAnimation): 23 (WebCore::SVGImage::stopAnimation): 24 * svg/graphics/SVGImage.h: 25 1 26 2018-01-30 Chris Dumez <cdumez@apple.com> 2 27 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r227791 r227841 69 69 #include "RenderTreeBuilder.h" 70 70 #include "RenderView.h" 71 #include "SVGImage.h" 71 72 #include "SVGRenderSupport.h" 72 73 #include "Settings.h" … … 1469 1470 repaint(); 1470 1471 1471 if (auto* image = cachedImage.image()) 1472 image->startAnimation(); 1472 if (auto* image = cachedImage.image()) { 1473 // SVGImages might cause a layout when starting an animation, so 1474 // schedule them rather than start immediately. 1475 if (is<SVGImage>(image)) 1476 downcast<SVGImage>(image)->scheduleStartAnimation(); 1477 else 1478 image->startAnimation(); 1479 } 1473 1480 1474 1481 // For directly-composited animated GIFs it does not suffice to call repaint() to resume animation. We need to mark the image as changed. -
trunk/Source/WebCore/svg/graphics/SVGImage.cpp
r226425 r227841 70 70 SVGImage::SVGImage(ImageObserver& observer) 71 71 : Image(&observer) 72 , m_startAnimationTimer(*this, &SVGImage::startAnimationTimerFired) 72 73 { 73 74 } … … 378 379 } 379 380 381 void SVGImage::startAnimationTimerFired() 382 { 383 startAnimation(); 384 } 385 386 void SVGImage::scheduleStartAnimation() 387 { 388 auto rootElement = this->rootElement(); 389 if (!rootElement || !rootElement->animationsPaused()) 390 return; 391 m_startAnimationTimer.startOneShot(0_s); 392 } 393 380 394 void SVGImage::startAnimation() 381 395 { … … 389 403 void SVGImage::stopAnimation() 390 404 { 405 m_startAnimationTimer.stop(); 391 406 auto rootElement = this->rootElement(); 392 407 if (!rootElement) -
trunk/Source/WebCore/svg/graphics/SVGImage.h
r224615 r227841 61 61 bool isAnimating() const final; 62 62 63 void scheduleStartAnimation(); 64 63 65 #if USE(CAIRO) 64 66 NativeImagePtr nativeImageForCurrentFrame(const GraphicsContext* = nullptr) final; … … 90 92 bool currentFrameKnownToBeOpaque() const final { return false; } 91 93 94 void startAnimationTimerFired(); 95 92 96 explicit SVGImage(ImageObserver&); 93 97 ImageDrawResult draw(GraphicsContext&, const FloatRect& fromRect, const FloatRect& toRect, CompositeOperator, BlendMode, DecodingMode, ImageOrientationDescription) final; … … 101 105 std::unique_ptr<Page> m_page; 102 106 FloatSize m_intrinsicSize; 107 108 Timer m_startAnimationTimer; 103 109 }; 104 110
Note:
See TracChangeset
for help on using the changeset viewer.