⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 227882 in webkit


Ignore:
Timestamp:
Jan 31, 2018, 1:09:17 AM (9 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r227841. rdar://problem/37059544

Location:
branches/safari-605-branch
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/LayoutTests/ChangeLog

    r227878 r227882  
     12018-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
    1162018-01-30  Jason Marcell  <jmarcell@apple.com>
    217
  • branches/safari-605-branch/Source/WebCore/ChangeLog

    r227877 r227882  
     12018-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
    1302018-01-30  Jason Marcell  <jmarcell@apple.com>
    231
  • branches/safari-605-branch/Source/WebCore/rendering/RenderElement.cpp

    r226910 r227882  
    6868#include "RenderTheme.h"
    6969#include "RenderView.h"
     70#include "SVGImage.h"
    7071#include "SVGRenderSupport.h"
    7172#include "Settings.h"
    … …  
    15141515    repaint();
    15151516
    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    }
    15181525
    15191526    // 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  
    7070SVGImage::SVGImage(ImageObserver& observer)
    7171    : Image(&observer)
     72    , m_startAnimationTimer(*this, &SVGImage::startAnimationTimerFired)
    7273{
    7374}
    … …  
    378379}
    379380
     381void SVGImage::startAnimationTimerFired()
     382{
     383    startAnimation();
     384}
     385
     386void SVGImage::scheduleStartAnimation()
     387{
     388    auto rootElement = this->rootElement();
     389    if (!rootElement || !rootElement->animationsPaused())
     390        return;
     391    m_startAnimationTimer.startOneShot(0_s);
     392}
     393
    380394void SVGImage::startAnimation()
    381395{
    … …  
    389403void SVGImage::stopAnimation()
    390404{
     405    m_startAnimationTimer.stop();
    391406    auto rootElement = this->rootElement();
    392407    if (!rootElement)
  • branches/safari-605-branch/Source/WebCore/svg/graphics/SVGImage.h

    r224615 r227882  
    6161    bool isAnimating() const final;
    6262
     63    void scheduleStartAnimation();
     64
    6365#if USE(CAIRO)
    6466    NativeImagePtr nativeImageForCurrentFrame(const GraphicsContext* = nullptr) final;
    … …  
    9092    bool currentFrameKnownToBeOpaque() const final { return false; }
    9193
     94    void startAnimationTimerFired();
     95
    9296    explicit SVGImage(ImageObserver&);
    9397    ImageDrawResult draw(GraphicsContext&, const FloatRect& fromRect, const FloatRect& toRect, CompositeOperator, BlendMode, DecodingMode, ImageOrientationDescription) final;
    … …  
    101105    std::unique_ptr<Page> m_page;
    102106    FloatSize m_intrinsicSize;
     107
     108    Timer m_startAnimationTimer;
    103109};
    104110
Note: See TracChangeset for help on using the changeset viewer.