Changeset 227882 in webkit
- Timestamp:
- Jan 31, 2018, 1:09:17 AM (9 years ago)
- Location:
- branches/safari-605-branch
- 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
-
branches/safari-605-branch/LayoutTests/ChangeLog
r227878 r227882 1 2018-01-31 Jason Marcell <jmarcell@apple.com> 2 3 Cherry-pick r227841. rdar://problem/37059544 4 5 2018-01-30 Dean Jackson <dino@apple.com> 6 7 CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded 8 https://bugs.webkit.org/show_bug.cgi?id=182299 9 <rdar://problem/36853088> 10 11 Reviewed by Simon Fraser. 12 13 * svg/animated-svgImage-scroll-expected.txt: Added. 14 * svg/animated-svgImage-scroll.html: Added. 15 1 16 2018-01-30 Jason Marcell <jmarcell@apple.com> 2 17 -
branches/safari-605-branch/Source/WebCore/ChangeLog
r227877 r227882 1 2018-01-31 Jason Marcell <jmarcell@apple.com> 2 3 Cherry-pick r227841. rdar://problem/37059544 4 5 2018-01-30 Dean Jackson <dino@apple.com> 6 7 CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded 8 https://bugs.webkit.org/show_bug.cgi?id=182299 9 <rdar://problem/36853088> 10 11 Reviewed by Simon Fraser. 12 13 Mostly speculative fix for the case where a scrollTo moves an 14 animated SVG image into view, causing its animation to restart during 15 a paint operation. This was causing a release ASSERT, so we now defer 16 the resumption of the animation into a timer. 17 18 Test: svg/animated-svgImage-scroll.html 19 20 * rendering/RenderElement.cpp: 21 (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the 22 animation if it is an SVGImage. 23 * svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts. 24 (WebCore::SVGImage::SVGImage): 25 (WebCore::SVGImage::startAnimationTimerFired): 26 (WebCore::SVGImage::enqueueStartAnimation): 27 (WebCore::SVGImage::stopAnimation): 28 * svg/graphics/SVGImage.h: 29 1 30 2018-01-30 Jason Marcell <jmarcell@apple.com> 2 31 -
branches/safari-605-branch/Source/WebCore/rendering/RenderElement.cpp
r226910 r227882 68 68 #include "RenderTheme.h" 69 69 #include "RenderView.h" 70 #include "SVGImage.h" 70 71 #include "SVGRenderSupport.h" 71 72 #include "Settings.h" … … 1514 1515 repaint(); 1515 1516 1516 if (auto* image = cachedImage.image()) 1517 image->startAnimation(); 1517 if (auto* image = cachedImage.image()) { 1518 // SVGImages might cause a layout when starting an animation, so 1519 // schedule them rather than start immediately. 1520 if (is<SVGImage>(image)) 1521 downcast<SVGImage>(image)->scheduleStartAnimation(); 1522 else 1523 image->startAnimation(); 1524 } 1518 1525 1519 1526 // For directly-composited animated GIFs it does not suffice to call repaint() to resume animation. We need to mark the image as changed. -
branches/safari-605-branch/Source/WebCore/svg/graphics/SVGImage.cpp
r226425 r227882 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) -
branches/safari-605-branch/Source/WebCore/svg/graphics/SVGImage.h
r224615 r227882 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.