<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[213393] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/213393">213393</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-03-03 15:54:48 -0800 (Fri, 03 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>[iOS] Throttle SVG SMIL animations to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169137
<rdar://problem/30833754>
Reviewed by Simon Fraser.
Source/WebCore:
Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
battery.
Test: svg/animations/animations-lowPowerMode-throttling.html
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement):
* svg/SVGSVGElement.idl:
* svg/animation/SMILTime.h:
(WebCore::SMILTime::SMILTime):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::SMILTimeContainer):
(WebCore::SMILTimeContainer::animationFrameDelay):
(WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SMILTimeContainer.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::calculateNextProgressTime):
* testing/Internals.cpp:
(WebCore::Internals::svgAnimationsInterval):
* testing/Internals.h:
* testing/Internals.idl:
LayoutTests:
Add layout test coverage.
* svg/animations/animations-lowPowerMode-throttling-expected.txt: Added.
* svg/animations/animations-lowPowerMode-throttling.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSVGElementcpp">trunk/Source/WebCore/svg/SVGSVGElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGSVGElementidl">trunk/Source/WebCore/svg/SVGSVGElement.idl</a></li>
<li><a href="#trunkSourceWebCoresvganimationSMILTimeh">trunk/Source/WebCore/svg/animation/SMILTime.h</a></li>
<li><a href="#trunkSourceWebCoresvganimationSMILTimeContainercpp">trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp</a></li>
<li><a href="#trunkSourceWebCoresvganimationSMILTimeContainerh">trunk/Source/WebCore/svg/animation/SMILTimeContainer.h</a></li>
<li><a href="#trunkSourceWebCoresvganimationSVGSMILElementcpp">trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvganimationsanimationslowPowerModethrottlingexpectedtxt">trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvganimationsanimationslowPowerModethrottlinghtml">trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/LayoutTests/ChangeLog        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-03-03 Chris Dumez <cdumez@apple.com>
+
+ [iOS] Throttle SVG SMIL animations to 30fps in low power mode
+ https://bugs.webkit.org/show_bug.cgi?id=169137
+ <rdar://problem/30833754>
+
+ Reviewed by Simon Fraser.
+
+ Add layout test coverage.
+
+ * svg/animations/animations-lowPowerMode-throttling-expected.txt: Added.
+ * svg/animations/animations-lowPowerMode-throttling.html: Added.
+
</ins><span class="cx"> 2017-03-03 Sam Weinig <sam@webkit.org>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r209760): Apple Pay doesn't work on casper.com, shopspring.com, maybe other sites
</span></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationslowPowerModethrottlingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling-expected.txt (0 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling-expected.txt         (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling-expected.txt        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Tests that SVG animations are properly throttled in low power mode.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS internals.svgAnimationsInterval(svgElement) is 1/60.
+internals.setLowPowerModeEnabled(true)
+PASS internals.svgAnimationsInterval(svgElement) is 1/30.
+internals.setLowPowerModeEnabled(false)
+PASS internals.svgAnimationsInterval(svgElement) is 1/60.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvganimationsanimationslowPowerModethrottlinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling.html (0 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling.html         (rev 0)
+++ trunk/LayoutTests/svg/animations/animations-lowPowerMode-throttling.html        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<svg width="300px" height="100px">
+ <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" />
+ <circle cx="0" cy="50" r="15" fill="blue" stroke="black" stroke-width="1">
+ <animate attributeName="cx" from="0" to="100" dur="5s" repeatCount="indefinite" />
+ </circle>
+</svg>
+<script>
+description("Tests that SVG animations are properly throttled in low power mode.");
+jsTestIsAsync = true;
+
+const svgElement = document.getElementsByTagName("svg")[0];
+
+window.onload = function() {
+ shouldBe("internals.svgAnimationsInterval(svgElement)", "1/60.");
+ evalAndLog("internals.setLowPowerModeEnabled(true)");
+ shouldBe("internals.svgAnimationsInterval(svgElement)", "1/30.");
+ evalAndLog("internals.setLowPowerModeEnabled(false)");
+ shouldBe("internals.svgAnimationsInterval(svgElement)", "1/60.");
+ finishJSTest();
+}
+</script>
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/ChangeLog        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2017-03-03 Chris Dumez <cdumez@apple.com>
+
+ [iOS] Throttle SVG SMIL animations to 30fps in low power mode
+ https://bugs.webkit.org/show_bug.cgi?id=169137
+ <rdar://problem/30833754>
+
+ Reviewed by Simon Fraser.
+
+ Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
+ battery.
+
+ Test: svg/animations/animations-lowPowerMode-throttling.html
+
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::SVGSVGElement):
+ * svg/SVGSVGElement.idl:
+ * svg/animation/SMILTime.h:
+ (WebCore::SMILTime::SMILTime):
+ * svg/animation/SMILTimeContainer.cpp:
+ (WebCore::SMILTimeContainer::SMILTimeContainer):
+ (WebCore::SMILTimeContainer::animationFrameDelay):
+ (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
+ (WebCore::SMILTimeContainer::updateAnimations):
+ * svg/animation/SMILTimeContainer.h:
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::SVGSMILElement::calculateNextProgressTime):
+ * testing/Internals.cpp:
+ (WebCore::Internals::svgAnimationsInterval):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
</ins><span class="cx"> 2017-03-03 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] WebCore.framework is missing a symlink from Frameworks to Versions/Current/Frameworks when the latter exists
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSVGElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSVGElement.cpp (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSVGElement.cpp        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/svg/SVGSVGElement.cpp        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> , m_y(LengthModeHeight)
</span><span class="cx"> , m_width(LengthModeWidth, ASCIILiteral("100%"))
</span><span class="cx"> , m_height(LengthModeHeight, ASCIILiteral("100%"))
</span><del>- , m_timeContainer(SMILTimeContainer::create(this))
</del><ins>+ , m_timeContainer(SMILTimeContainer::create(*this))
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(hasTagName(SVGNames::svgTag));
</span><span class="cx"> registerAnimatedPropertiesForSVGSVGElement();
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGSVGElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGSVGElement.idl (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGSVGElement.idl        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/svg/SVGSVGElement.idl        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -24,7 +24,10 @@
</span><span class="cx"> // FIXME: Fix SVGSVGElement inheritance (css::DocumentCSS)!
</span><span class="cx"> // FIXME: no events::DocumentEvent available!
</span><span class="cx">
</span><del>-interface SVGSVGElement : SVGGraphicsElement {
</del><ins>+[
+ JSGenerateToNativeObject,
+ ExportMacro=WEBCORE_EXPORT,
+] interface SVGSVGElement : SVGGraphicsElement {
</ins><span class="cx"> readonly attribute SVGAnimatedLength x;
</span><span class="cx"> readonly attribute SVGAnimatedLength y;
</span><span class="cx"> readonly attribute SVGAnimatedLength width;
</span></span></pre></div>
<a id="trunkSourceWebCoresvganimationSMILTimeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/animation/SMILTime.h (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/animation/SMILTime.h        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/svg/animation/SMILTime.h        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -27,15 +27,15 @@
</span><span class="cx">
</span><span class="cx"> #include <algorithm>
</span><span class="cx"> #include <cmath>
</span><ins>+#include <wtf/Seconds.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-const double SMILAnimationFrameDelay = 1.0 / 60;
-
</del><span class="cx"> class SMILTime {
</span><span class="cx"> public:
</span><span class="cx"> SMILTime() : m_time(0) { }
</span><span class="cx"> SMILTime(double time) : m_time(time) { ASSERT(!std::isnan(time)); }
</span><ins>+ SMILTime(Seconds time) : m_time(time.value()) { ASSERT(!std::isnan(time.value())); }
</ins><span class="cx"> SMILTime(const SMILTime& o) : m_time(o.m_time) { }
</span><span class="cx">
</span><span class="cx"> static SMILTime unresolved() { return unresolvedValue; }
</span></span></pre></div>
<a id="trunkSourceWebCoresvganimationSMILTimeContainercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "ElementIterator.h"
</span><ins>+#include "Page.h"
</ins><span class="cx"> #include "SVGSMILElement.h"
</span><span class="cx"> #include "SVGSVGElement.h"
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span><span class="lines">@@ -34,7 +35,10 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner)
</del><ins>+static const Seconds SMILAnimationFrameDelay { 1.0 / 60 };
+static const Seconds SMILAnimationFrameThrottledDelay { 1.0 / 30 };
+
+SMILTimeContainer::SMILTimeContainer(SVGSVGElement& owner)
</ins><span class="cx"> : m_beginTime(0)
</span><span class="cx"> , m_pauseTime(0)
</span><span class="cx"> , m_accumulatedActiveTime(0)
</span><span class="lines">@@ -100,6 +104,14 @@
</span><span class="cx"> startTimer(elapsed(), 0);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Seconds SMILTimeContainer::animationFrameDelay() const
+{
+ auto* page = m_ownerSVGElement.document().page();
+ if (!page)
+ return SMILAnimationFrameDelay;
+ return page->isLowPowerModeEnabled() ? SMILAnimationFrameThrottledDelay : SMILAnimationFrameDelay;
+}
+
</ins><span class="cx"> SMILTime SMILTimeContainer::elapsed() const
</span><span class="cx"> {
</span><span class="cx"> if (!m_beginTime)
</span><span class="lines">@@ -218,7 +230,7 @@
</span><span class="cx"> {
</span><span class="cx"> unsigned timingElementCount = 0;
</span><span class="cx">
</span><del>- for (auto& smilElement : descendantsOfType<SVGSMILElement>(*m_ownerSVGElement))
</del><ins>+ for (auto& smilElement : descendantsOfType<SVGSMILElement>(m_ownerSVGElement))
</ins><span class="cx"> smilElement.setDocumentOrderIndex(timingElementCount++);
</span><span class="cx">
</span><span class="cx"> m_documentOrderIndexesDirty = false;
</span><span class="lines">@@ -306,7 +318,7 @@
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> m_preventScheduledAnimationsChanges = false;
</span><span class="cx"> #endif
</span><del>- startTimer(elapsed, earliestFireTime, SMILAnimationFrameDelay);
</del><ins>+ startTimer(elapsed, earliestFireTime, animationFrameDelay());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -318,7 +330,7 @@
</span><span class="cx"> m_preventScheduledAnimationsChanges = false;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- startTimer(elapsed, earliestFireTime, SMILAnimationFrameDelay);
</del><ins>+ startTimer(elapsed, earliestFireTime, animationFrameDelay());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvganimationSMILTimeContainerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/animation/SMILTimeContainer.h (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/animation/SMILTimeContainer.h        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/svg/animation/SMILTimeContainer.h        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">
</span><span class="cx"> class SMILTimeContainer final : public RefCounted<SMILTimeContainer> {
</span><span class="cx"> public:
</span><del>- static Ref<SMILTimeContainer> create(SVGSVGElement* owner) { return adoptRef(*new SMILTimeContainer(owner)); }
</del><ins>+ static Ref<SMILTimeContainer> create(SVGSVGElement& owner) { return adoptRef(*new SMILTimeContainer(owner)); }
</ins><span class="cx"> ~SMILTimeContainer();
</span><span class="cx">
</span><span class="cx"> void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&);
</span><span class="lines">@@ -49,6 +49,8 @@
</span><span class="cx"> void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&);
</span><span class="cx"> void notifyIntervalsChanged();
</span><span class="cx">
</span><ins>+ WEBCORE_EXPORT Seconds animationFrameDelay() const;
+
</ins><span class="cx"> SMILTime elapsed() const;
</span><span class="cx">
</span><span class="cx"> bool isActive() const;
</span><span class="lines">@@ -63,7 +65,7 @@
</span><span class="cx"> void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- SMILTimeContainer(SVGSVGElement* owner);
</del><ins>+ SMILTimeContainer(SVGSVGElement& owner);
</ins><span class="cx">
</span><span class="cx"> void timerFired();
</span><span class="cx"> void startTimer(SMILTime elapsed, SMILTime fireTime, SMILTime minimumDelay = 0);
</span><span class="lines">@@ -87,7 +89,7 @@
</span><span class="cx"> typedef HashMap<ElementAttributePair, std::unique_ptr<AnimationsVector>> GroupedAnimationsMap;
</span><span class="cx"> GroupedAnimationsMap m_scheduledAnimations;
</span><span class="cx">
</span><del>- SVGSVGElement* m_ownerSVGElement;
</del><ins>+ SVGSVGElement& m_ownerSVGElement;
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> bool m_preventScheduledAnimationsChanges;
</span></span></pre></div>
<a id="trunkSourceWebCoresvganimationSVGSMILElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -1036,6 +1036,7 @@
</span><span class="cx">
</span><span class="cx"> SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const
</span><span class="cx"> {
</span><ins>+ ASSERT(m_timeContainer);
</ins><span class="cx"> if (m_activeState == Active) {
</span><span class="cx"> // If duration is indefinite the value does not actually change over time. Same is true for <set>.
</span><span class="cx"> SMILTime simpleDuration = this->simpleDuration();
</span><span class="lines">@@ -1047,7 +1048,7 @@
</span><span class="cx"> return repeatingDurationEnd;
</span><span class="cx"> return m_intervalEnd;
</span><span class="cx"> }
</span><del>- return elapsed + SMILAnimationFrameDelay;
</del><ins>+ return elapsed + m_timeContainer->animationFrameDelay();
</ins><span class="cx"> }
</span><span class="cx"> return m_intervalBegin >= elapsed ? m_intervalBegin : SMILTime::unresolved();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/testing/Internals.cpp        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -111,8 +111,10 @@
</span><span class="cx"> #include "RenderView.h"
</span><span class="cx"> #include "RenderedDocumentMarker.h"
</span><span class="cx"> #include "ResourceLoadObserver.h"
</span><ins>+#include "SMILTimeContainer.h"
</ins><span class="cx"> #include "SVGDocumentExtensions.h"
</span><span class="cx"> #include "SVGPathStringBuilder.h"
</span><ins>+#include "SVGSVGElement.h"
</ins><span class="cx"> #include "SchemeRegistry.h"
</span><span class="cx"> #include "ScriptedAnimationController.h"
</span><span class="cx"> #include "ScrollingCoordinator.h"
</span><span class="lines">@@ -522,6 +524,21 @@
</span><span class="cx"> return document->accessSVGExtensions().areAnimationsPaused();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ExceptionOr<double> Internals::svgAnimationsInterval(SVGSVGElement& element) const
+{
+ auto* document = contextDocument();
+ if (!document)
+ return 0;
+
+ if (!document->svgExtensions())
+ return 0;
+
+ if (document->accessSVGExtensions().areAnimationsPaused())
+ return 0;
+
+ return element.timeContainer().animationFrameDelay().value();
+}
+
</ins><span class="cx"> String Internals::address(Node& node)
</span><span class="cx"> {
</span><span class="cx"> return String::format("%p", &node);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/testing/Internals.h        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> class Range;
</span><span class="cx"> class RenderedDocumentMarker;
</span><span class="cx"> class RTCPeerConnection;
</span><ins>+class SVGSVGElement;
</ins><span class="cx"> class SerializedScriptValue;
</span><span class="cx"> class SourceBuffer;
</span><span class="cx"> class StyleSheet;
</span><span class="lines">@@ -256,6 +257,7 @@
</span><span class="cx"> InternalSettings* settings() const;
</span><span class="cx"> unsigned workerThreadCount() const;
</span><span class="cx"> bool areSVGAnimationsPaused() const;
</span><ins>+ ExceptionOr<double> svgAnimationsInterval(SVGSVGElement&) const;
</ins><span class="cx">
</span><span class="cx"> ExceptionOr<void> setDeviceProximity(const String& eventType, double value, double min, double max);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (213392 => 213393)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2017-03-03 23:03:18 UTC (rev 213392)
+++ trunk/Source/WebCore/testing/Internals.idl        2017-03-03 23:54:48 UTC (rev 213393)
</span><span class="lines">@@ -247,6 +247,7 @@
</span><span class="cx"> readonly attribute unsigned long workerThreadCount;
</span><span class="cx">
</span><span class="cx"> readonly attribute boolean areSVGAnimationsPaused;
</span><ins>+ [MayThrowException] double svgAnimationsInterval(SVGSVGElement element);
</ins><span class="cx">
</span><span class="cx"> // Flags for layerTreeAsText.
</span><span class="cx"> const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
</span></span></pre>
</div>
</div>
</body>
</html>