<!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>[213473] 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/213473">213473</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-03-06 15:07:50 -0800 (Mon, 06 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Throttle CSS animations to 30fps in low power mode
https://bugs.webkit.org/show_bug.cgi?id=169138
&lt;rdar://problem/30837805&gt;

Reviewed by Said Abou-Hallawa.

Source/WebCore:

Throttle software CSS animations to 30fps in low power mode on iOS
to save battery.

Test: fast/animation/css-animation-throttling-lowPowerMode.html

* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
(WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
(WebCore::CSSAnimationControllerPrivate::animationInterval):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
(WebCore::CSSAnimationController::updateThrottlingState):
(WebCore::CSSAnimationController::animationInterval):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::animationsInterval):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add layout test coverage.

* fast/animation/css-animation-throttling-lowPowerMode-expected.txt: Added.
* fast/animation/css-animation-throttling-lowPowerMode.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="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSAnimationControllercpp">trunk/Source/WebCore/page/animation/CSSAnimationController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSAnimationControllerh">trunk/Source/WebCore/page/animation/CSSAnimationController.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSAnimationControllerPrivateh">trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h</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="#trunkLayoutTestsfastanimationcssanimationthrottlinglowPowerModeexpectedtxt">trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastanimationcssanimationthrottlinglowPowerModehtml">trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/LayoutTests/ChangeLog        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-03-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [iOS] Throttle CSS animations to 30fps in low power mode
+        https://bugs.webkit.org/show_bug.cgi?id=169138
+        &lt;rdar://problem/30837805&gt;
+
+        Reviewed by Said Abou-Hallawa.
+
+        Add layout test coverage.
+
+        * fast/animation/css-animation-throttling-lowPowerMode-expected.txt: Added.
+        * fast/animation/css-animation-throttling-lowPowerMode.html: Added.
+
</ins><span class="cx"> 2017-03-06  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix URLs relative to file URLs with paths beginning with Windows drive letters
</span></span></pre></div>
<a id="trunkLayoutTestsfastanimationcssanimationthrottlinglowPowerModeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode-expected.txt (0 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode-expected.txt        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Tests that CSS animations are 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.animationsInterval is 0.015
+internals.setLowPowerModeEnabled(true)
+PASS internals.animationsInterval is 0.030
+internals.setLowPowerModeEnabled(false)
+PASS internals.animationsInterval is 0.015
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Test text
</ins></span></pre></div>
<a id="trunkLayoutTestsfastanimationcssanimationthrottlinglowPowerModehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html (0 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html                                (rev 0)
+++ trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+@keyframes my-animation {        
+  from {
+    left : 0px;
+  }
+  to {
+    left : 100px;
+  }      
+}
+
+.run-animation {
+  position: relative;
+  animation: my-animation 0.5s infinite;
+  animation-direction: alternate;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;testElement&quot; class=&quot;run-animation&quot;&gt;Test text&lt;/p&gt;
+&lt;script&gt;
+description(&quot;Tests that CSS animations are throttled in low power mode.&quot;);
+jsTestIsAsync = true;
+
+const element = document.getElementById(&quot;testElement&quot;);
+element.onanimationstart = function() {
+    element.onanimationstart = null;
+
+    shouldBe(&quot;internals.animationsInterval&quot;, &quot;0.015&quot;);
+    evalAndLog(&quot;internals.setLowPowerModeEnabled(true)&quot;);
+    shouldBe(&quot;internals.animationsInterval&quot;, &quot;0.030&quot;);
+    evalAndLog(&quot;internals.setLowPowerModeEnabled(false)&quot;);
+    shouldBe(&quot;internals.animationsInterval&quot;, &quot;0.015&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 (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/ChangeLog        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2017-03-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [iOS] Throttle CSS animations to 30fps in low power mode
+        https://bugs.webkit.org/show_bug.cgi?id=169138
+        &lt;rdar://problem/30837805&gt;
+
+        Reviewed by Said Abou-Hallawa.
+
+        Throttle software CSS animations to 30fps in low power mode on iOS
+        to save battery.
+
+        Test: fast/animation/css-animation-throttling-lowPowerMode.html
+
+        * page/Page.cpp:
+        (WebCore::Page::handleLowModePowerChange):
+        * page/animation/CSSAnimationController.cpp:
+        (WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
+        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
+        (WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
+        (WebCore::CSSAnimationControllerPrivate::animationInterval):
+        (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
+        (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
+        (WebCore::CSSAnimationController::updateThrottlingState):
+        (WebCore::CSSAnimationController::animationInterval):
+        * page/animation/CSSAnimationController.h:
+        * page/animation/CSSAnimationControllerPrivate.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::animationsInterval):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2017-03-03  Matt Rajca  &lt;mrajca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Media: notify clients when the user never plays a media element that was prevented from auto-playing
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/page/Page.cpp        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -1137,6 +1137,7 @@
</span><span class="cx"> void Page::handleLowModePowerChange(bool isLowPowerModeEnabled)
</span><span class="cx"> {
</span><span class="cx">     updateScriptedAnimationsThrottlingReason(*this, isLowPowerModeEnabled ? ThrottlingReasonOperation::Add : ThrottlingReasonOperation::Remove, ScriptedAnimationController::ThrottlingReason::LowPowerMode);
</span><ins>+    mainFrame().animation().updateThrottlingState();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Page::userStyleSheetLocationChanged()
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSAnimationControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSAnimationController.cpp (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSAnimationController.cpp        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/page/animation/CSSAnimationController.cpp        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -49,8 +49,9 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> // Allow a little more than 60fps to make sure we can at least hit that frame rate.
</span><del>-static const double cAnimationTimerDelay = 0.015;
-static const double cBeginAnimationUpdateTimeNotSet = -1;
</del><ins>+static const Seconds animationTimerDelay { 0.015 };
+// Allow a little more than 30fps to make sure we can at least hit that frame rate.
+static const Seconds animationTimerThrottledDelay { 0.030 };
</ins><span class="cx"> 
</span><span class="cx"> class AnimationPrivateUpdateBlock {
</span><span class="cx"> public:
</span><span class="lines">@@ -72,10 +73,8 @@
</span><span class="cx">     : m_animationTimer(*this, &amp;CSSAnimationControllerPrivate::animationTimerFired)
</span><span class="cx">     , m_updateStyleIfNeededDispatcher(*this, &amp;CSSAnimationControllerPrivate::updateStyleIfNeededDispatcherFired)
</span><span class="cx">     , m_frame(frame)
</span><del>-    , m_beginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet)
</del><span class="cx">     , m_beginAnimationUpdateCount(0)
</span><span class="cx">     , m_waitingForAsyncStartNotification(false)
</span><del>-    , m_isSuspended(false)
</del><span class="cx">     , m_allowsNewAnimationsWhileSuspended(false)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -176,8 +175,12 @@
</span><span class="cx"> 
</span><span class="cx">     // If we want service immediately, we start a repeating timer to reduce the overhead of starting
</span><span class="cx">     if (!timeToNextService) {
</span><del>-        if (!m_animationTimer.isActive() || !m_animationTimer.repeatInterval())
-            m_animationTimer.startRepeating(cAnimationTimerDelay);
</del><ins>+        auto* page = m_frame.page();
+        bool shouldThrottle = page &amp;&amp; page-&gt;isLowPowerModeEnabled();
+        Seconds delay = shouldThrottle ? animationTimerThrottledDelay : animationTimerDelay;
+
+        if (!m_animationTimer.isActive() || m_animationTimer.repeatInterval() != delay.value())
+            m_animationTimer.startRepeating(delay);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -284,6 +287,22 @@
</span><span class="cx">     return animation.isAnimatingProperty(property, true, runningState);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CSSAnimationControllerPrivate::updateThrottlingState()
+{
+    updateAnimationTimer();
+
+    for (auto* childFrame = m_frame.tree().firstChild(); childFrame; childFrame = childFrame-&gt;tree().nextSibling())
+        childFrame-&gt;animation().updateThrottlingState();
+}
+
+Seconds CSSAnimationControllerPrivate::animationInterval() const
+{
+    if (!m_animationTimer.isActive())
+        return Seconds { INFINITY };
+
+    return Seconds { m_animationTimer.repeatInterval() };
+}
+
</ins><span class="cx"> void CSSAnimationControllerPrivate::suspendAnimations()
</span><span class="cx"> {
</span><span class="cx">     if (isSuspended())
</span><span class="lines">@@ -400,16 +419,16 @@
</span><span class="cx"> double CSSAnimationControllerPrivate::beginAnimationUpdateTime()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_beginAnimationUpdateCount);
</span><del>-    if (m_beginAnimationUpdateTime == cBeginAnimationUpdateTimeNotSet)
</del><ins>+    if (!m_beginAnimationUpdateTime)
</ins><span class="cx">         m_beginAnimationUpdateTime = monotonicallyIncreasingTime();
</span><span class="cx"> 
</span><del>-    return m_beginAnimationUpdateTime;
</del><ins>+    return m_beginAnimationUpdateTime.value();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSAnimationControllerPrivate::beginAnimationUpdate()
</span><span class="cx"> {
</span><span class="cx">     if (!m_beginAnimationUpdateCount)
</span><del>-        setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
</del><ins>+        m_beginAnimationUpdateTime = std::nullopt;
</ins><span class="cx">     ++m_beginAnimationUpdateCount;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -725,6 +744,16 @@
</span><span class="cx">     m_data-&gt;animationFrameCallbackFired();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CSSAnimationController::updateThrottlingState()
+{
+    m_data-&gt;updateThrottlingState();
+}
+
+Seconds CSSAnimationController::animationInterval() const
+{
+    return m_data-&gt;animationInterval();
+}
+
</ins><span class="cx"> bool CSSAnimationController::animationsAreSuspendedForDocument(Document* document)
</span><span class="cx"> {
</span><span class="cx">     return m_data-&gt;animationsAreSuspendedForDocument(document);
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSAnimationControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSAnimationController.h (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSAnimationController.h        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/page/animation/CSSAnimationController.h        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -72,6 +72,9 @@
</span><span class="cx">     WEBCORE_EXPORT void resumeAnimations();
</span><span class="cx">     void serviceAnimations();
</span><span class="cx"> 
</span><ins>+    void updateThrottlingState();
+    WEBCORE_EXPORT Seconds animationInterval() const;
+
</ins><span class="cx">     WEBCORE_EXPORT void suspendAnimationsForDocument(Document*);
</span><span class="cx">     WEBCORE_EXPORT void resumeAnimationsForDocument(Document*);
</span><span class="cx">     WEBCORE_EXPORT bool animationsAreSuspendedForDocument(Document*);
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSAnimationControllerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -67,6 +67,9 @@
</span><span class="cx">     void resumeAnimations();
</span><span class="cx">     void animationFrameCallbackFired();
</span><span class="cx"> 
</span><ins>+    void updateThrottlingState();
+    Seconds animationInterval() const;
+
</ins><span class="cx">     void suspendAnimationsForDocument(Document*);
</span><span class="cx">     void resumeAnimationsForDocument(Document*);
</span><span class="cx">     bool animationsAreSuspendedForDocument(Document*);
</span><span class="lines">@@ -85,7 +88,6 @@
</span><span class="cx">     bool computeExtentOfAnimation(RenderElement&amp;, LayoutRect&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     double beginAnimationUpdateTime();
</span><del>-    void setBeginAnimationUpdateTime(double t) { m_beginAnimationUpdateTime = t; }
</del><span class="cx">     
</span><span class="cx">     void beginAnimationUpdate();
</span><span class="cx">     void endAnimationUpdate();
</span><span class="lines">@@ -135,7 +137,7 @@
</span><span class="cx">     Vector&lt;Ref&lt;Element&gt;&gt; m_elementChangesToDispatch;
</span><span class="cx">     HashSet&lt;Document*&gt; m_suspendedDocuments;
</span><span class="cx"> 
</span><del>-    double m_beginAnimationUpdateTime;
</del><ins>+    std::optional&lt;double&gt; m_beginAnimationUpdateTime;
</ins><span class="cx"> 
</span><span class="cx">     using AnimationsSet = HashSet&lt;RefPtr&lt;AnimationBase&gt;&gt;;
</span><span class="cx">     AnimationsSet m_animationsWaitingForStyle;
</span><span class="lines">@@ -144,7 +146,7 @@
</span><span class="cx">     int m_beginAnimationUpdateCount;
</span><span class="cx"> 
</span><span class="cx">     bool m_waitingForAsyncStartNotification;
</span><del>-    bool m_isSuspended;
</del><ins>+    bool m_isSuspended { false };
</ins><span class="cx"> 
</span><span class="cx">     // Used to flag whether we should revert to previous buggy
</span><span class="cx">     // behavior of allowing new transitions and animations to
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/testing/Internals.cpp        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -796,6 +796,15 @@
</span><span class="cx">     return document-&gt;frame()-&gt;animation().animationsAreSuspendedForDocument(document);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+double Internals::animationsInterval() const
+{
+    Document* document = contextDocument();
+    if (!document || !document-&gt;frame())
+        return INFINITY;
+
+    return document-&gt;frame()-&gt;animation().animationInterval().value();
+}
+
</ins><span class="cx"> ExceptionOr&lt;void&gt; Internals::suspendAnimations() const
</span><span class="cx"> {
</span><span class="cx">     Document* document = contextDocument();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/testing/Internals.h        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -148,6 +148,7 @@
</span><span class="cx">     ExceptionOr&lt;void&gt; resumeAnimations() const;
</span><span class="cx">     ExceptionOr&lt;bool&gt; pauseAnimationAtTimeOnElement(const String&amp; animationName, double pauseTime, Element&amp;);
</span><span class="cx">     ExceptionOr&lt;bool&gt; pauseAnimationAtTimeOnPseudoElement(const String&amp; animationName, double pauseTime, Element&amp;, const String&amp; pseudoId);
</span><ins>+    double animationsInterval() const;
</ins><span class="cx"> 
</span><span class="cx">     // CSS Transition testing.
</span><span class="cx">     ExceptionOr&lt;bool&gt; pauseTransitionAtTimeOnElement(const String&amp; propertyName, double pauseTime, Element&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (213472 => 213473)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2017-03-06 23:07:27 UTC (rev 213472)
+++ trunk/Source/WebCore/testing/Internals.idl        2017-03-06 23:07:50 UTC (rev 213473)
</span><span class="lines">@@ -135,6 +135,7 @@
</span><span class="cx">     [MayThrowException] boolean animationsAreSuspended();
</span><span class="cx">     [MayThrowException] boolean pauseAnimationAtTimeOnElement(DOMString animationName, unrestricted double pauseTime, Element element);
</span><span class="cx">     [MayThrowException] boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, unrestricted double pauseTime, Element element, DOMString pseudoId);
</span><ins>+    readonly attribute double animationsInterval;
</ins><span class="cx"> 
</span><span class="cx">     // CSS Transition testing.
</span><span class="cx">     [MayThrowException] boolean pauseTransitionAtTimeOnElement(DOMString propertyName, unrestricted double pauseTime, Element element);
</span></span></pre>
</div>
</div>

</body>
</html>