<!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
&lt;rdar://problem/30833754&gt;

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  &lt;cdumez@apple.com&gt;
+
+        [iOS] Throttle SVG SMIL animations to 30fps in low power mode
+        https://bugs.webkit.org/show_bug.cgi?id=169137
+        &lt;rdar://problem/30833754&gt;
+
+        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  &lt;sam@webkit.org&gt;
</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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+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>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;svg width=&quot;300px&quot; height=&quot;100px&quot;&gt;
+    &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;300&quot; height=&quot;100&quot; stroke=&quot;black&quot; stroke-width=&quot;1&quot; /&gt;
+    &lt;circle cx=&quot;0&quot; cy=&quot;50&quot; r=&quot;15&quot; fill=&quot;blue&quot; stroke=&quot;black&quot; stroke-width=&quot;1&quot;&gt;
+        &lt;animate attributeName=&quot;cx&quot; from=&quot;0&quot; to=&quot;100&quot; dur=&quot;5s&quot; repeatCount=&quot;indefinite&quot; /&gt;
+    &lt;/circle&gt;
+&lt;/svg&gt;
+&lt;script&gt;
+description(&quot;Tests that SVG animations are properly throttled in low power mode.&quot;);
+jsTestIsAsync = true;
+
+const svgElement = document.getElementsByTagName(&quot;svg&quot;)[0];
+
+window.onload = function() {
+    shouldBe(&quot;internals.svgAnimationsInterval(svgElement)&quot;, &quot;1/60.&quot;);
+    evalAndLog(&quot;internals.setLowPowerModeEnabled(true)&quot;);
+    shouldBe(&quot;internals.svgAnimationsInterval(svgElement)&quot;, &quot;1/30.&quot;);
+    evalAndLog(&quot;internals.setLowPowerModeEnabled(false)&quot;);
+    shouldBe(&quot;internals.svgAnimationsInterval(svgElement)&quot;, &quot;1/60.&quot;);
+    finishJSTest();
+}
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</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  &lt;cdumez@apple.com&gt;
+
+        [iOS] Throttle SVG SMIL animations to 30fps in low power mode
+        https://bugs.webkit.org/show_bug.cgi?id=169137
+        &lt;rdar://problem/30833754&gt;
+
+        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  &lt;pecoraro@apple.com&gt;
</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(&quot;100%&quot;))
</span><span class="cx">     , m_height(LengthModeHeight, ASCIILiteral(&quot;100%&quot;))
</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 &lt;algorithm&gt;
</span><span class="cx"> #include &lt;cmath&gt;
</span><ins>+#include &lt;wtf/Seconds.h&gt;
</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&amp; 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 &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ElementIterator.h&quot;
</span><ins>+#include &quot;Page.h&quot;
</ins><span class="cx"> #include &quot;SVGSMILElement.h&quot;
</span><span class="cx"> #include &quot;SVGSVGElement.h&quot;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</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&amp; 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-&gt;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&amp; smilElement : descendantsOfType&lt;SVGSMILElement&gt;(*m_ownerSVGElement))
</del><ins>+    for (auto&amp; smilElement : descendantsOfType&lt;SVGSMILElement&gt;(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&lt;SMILTimeContainer&gt;  {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;SMILTimeContainer&gt; create(SVGSVGElement* owner) { return adoptRef(*new SMILTimeContainer(owner)); }
</del><ins>+    static Ref&lt;SMILTimeContainer&gt; create(SVGSVGElement&amp; 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&amp;);
</span><span class="lines">@@ -49,6 +49,8 @@
</span><span class="cx">     void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&amp;);
</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&amp; 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&lt;ElementAttributePair, std::unique_ptr&lt;AnimationsVector&gt;&gt; GroupedAnimationsMap;
</span><span class="cx">     GroupedAnimationsMap m_scheduledAnimations;
</span><span class="cx"> 
</span><del>-    SVGSVGElement* m_ownerSVGElement;
</del><ins>+    SVGSVGElement&amp; 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 &lt;set&gt;.
</span><span class="cx">         SMILTime simpleDuration = this-&gt;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-&gt;animationFrameDelay();
</ins><span class="cx">     }
</span><span class="cx">     return m_intervalBegin &gt;= 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 &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;RenderedDocumentMarker.h&quot;
</span><span class="cx"> #include &quot;ResourceLoadObserver.h&quot;
</span><ins>+#include &quot;SMILTimeContainer.h&quot;
</ins><span class="cx"> #include &quot;SVGDocumentExtensions.h&quot;
</span><span class="cx"> #include &quot;SVGPathStringBuilder.h&quot;
</span><ins>+#include &quot;SVGSVGElement.h&quot;
</ins><span class="cx"> #include &quot;SchemeRegistry.h&quot;
</span><span class="cx"> #include &quot;ScriptedAnimationController.h&quot;
</span><span class="cx"> #include &quot;ScrollingCoordinator.h&quot;
</span><span class="lines">@@ -522,6 +524,21 @@
</span><span class="cx">     return document-&gt;accessSVGExtensions().areAnimationsPaused();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ExceptionOr&lt;double&gt; Internals::svgAnimationsInterval(SVGSVGElement&amp; element) const
+{
+    auto* document = contextDocument();
+    if (!document)
+        return 0;
+
+    if (!document-&gt;svgExtensions())
+        return 0;
+
+    if (document-&gt;accessSVGExtensions().areAnimationsPaused())
+        return 0;
+
+    return element.timeContainer().animationFrameDelay().value();
+}
+
</ins><span class="cx"> String Internals::address(Node&amp; node)
</span><span class="cx"> {
</span><span class="cx">     return String::format(&quot;%p&quot;, &amp;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&lt;double&gt; svgAnimationsInterval(SVGSVGElement&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     ExceptionOr&lt;void&gt; setDeviceProximity(const String&amp; 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>