<!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>[201706] 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/201706">201706</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-05 21:56:38 -0700 (Sun, 05 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add experimental support for spring based CSS animations
https://bugs.webkit.org/show_bug.cgi?id=158403

Patch by Sam Weinig &lt;sam@webkit.org&gt; on 2016-06-05
Reviewed by Dean Jackson.

Source/WebCore:

Adds experimental support for a new CSS animation timing function that uses
spring to model the time function. To use it you replace your normal timing
function, be it cubic-bezier or steps, with a new function called spring().
For instance, for a transition you would write:

    transition-timing-function: spring(1 100 10 0);

The parameters are, in order:
    - Mass
    - Stiffness
    - Damping
    - Initial Velocity

Tests: animations/spring-computed-style.html
       animations/spring-function.html
       animations/spring-parsing.html

* WebCore.xcodeproj/project.pbxproj:
Add new file.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
Modernize and add support for the spring function.

* css/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseTransformOriginShorthand):
(WebCore::CSSParser::isSpringTimingFunctionEnabled):
(WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
(WebCore::CSSParser::parseSpringTimingFunctionValue):
(WebCore::CSSParser::parseAnimationTimingFunction):
* css/CSSParser.h:
* css/CSSParserMode.h:
Add parsing support for the spring() function.

* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSCubicBezierTimingFunctionValue::customCSSText):
(WebCore::CSSCubicBezierTimingFunctionValue::equals):
(WebCore::CSSStepsTimingFunctionValue::customCSSText):
(WebCore::CSSStepsTimingFunctionValue::equals):
(WebCore::CSSSpringTimingFunctionValue::customCSSText):
(WebCore::CSSSpringTimingFunctionValue::equals):
* css/CSSTimingFunctionValue.h:
(WebCore::CSSSpringTimingFunctionValue::create):
(WebCore::CSSSpringTimingFunctionValue::mass):
(WebCore::CSSSpringTimingFunctionValue::stiffness):
(WebCore::CSSSpringTimingFunctionValue::damping):
(WebCore::CSSSpringTimingFunctionValue::initialVelocity):
(WebCore::CSSSpringTimingFunctionValue::CSSSpringTimingFunctionValue):
Modernize and add support for the spring function.

* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
Pipe the spring function into the animation.

* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isSpringTimingFunctionValue):
Add support for the spring function.

* page/Settings.in:
Add a setting to control if the spring function is enabled.

* page/animation/AnimationBase.cpp:
(WebCore::solveSpringFunction):
(WebCore::AnimationBase::progress):
Add support for solving the spring function. Since the spring requires time to be absolute,
get the real time by multiplying the ratio t, to the total duration.

* platform/animation/TimingFunction.cpp:
(WebCore::operator&lt;&lt;):
* platform/animation/TimingFunction.h:
(WebCore::TimingFunction::~TimingFunction):
(WebCore::TimingFunction::isSpringTimingFunction):
Add support for the spring timing function.

* platform/graphics/SpringSolver.h: Added.
(WebCore::SpringSolver::SpringSolver):
(WebCore::SpringSolver::solve):
Add a Spring solver that matches the one in CoreAnimation.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createBasicAnimation):
(WebCore::GraphicsLayerCA::createSpringAnimation):
(WebCore::GraphicsLayerCA::setupAnimation):
* platform/graphics/ca/GraphicsLayerCA.h:
Map animations with spring timing functions to CASpringAnimations.

* platform/graphics/ca/PlatformCAAnimation.cpp:
(WebCore::operator&lt;&lt;):
(WebCore::PlatformCAAnimation::isBasicAnimation):
* platform/graphics/ca/PlatformCAAnimation.h:
(WebCore::PlatformCAAnimation::setActualStartTimeIfNeeded):
(WebCore::PlatformCAAnimation::PlatformCAAnimation):
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::toCAMediaTimingFunction):
(PlatformCAAnimationCocoa::PlatformCAAnimationCocoa):
(PlatformCAAnimationCocoa::setTimingFunction):
(PlatformCAAnimationCocoa::copyTimingFunctionFrom):
(PlatformCAAnimationCocoa::setFromValue):
(PlatformCAAnimationCocoa::copyFromValueFrom):
(PlatformCAAnimationCocoa::setToValue):
(PlatformCAAnimationCocoa::copyToValueFrom):
Add a new type of PlatformCAAnimation, Spring, which is a sub-type of Basic.

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;StepsTimingFunction&gt;::decode):
(IPC::ArgumentCoder&lt;SpringTimingFunction&gt;::encode):
(IPC::ArgumentCoder&lt;SpringTimingFunction&gt;::decode):
(IPC::ArgumentCoder&lt;FloatPoint&gt;::encode):
* Shared/WebCoreArgumentCoders.h:
* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::Properties::encode):
(WebKit::PlatformCAAnimationRemote::Properties::decode):
(WebKit::addAnimationToLayer):
Pipe through support for the Spring animation.

LayoutTests:

* animations/script-tests/spring-computed-style.js: Added.
* animations/script-tests/spring-parsing.js: Added.
* animations/spring-computed-style-expected.txt: Added.
* animations/spring-computed-style.html: Added.
* animations/spring-function-expected.txt: Added.
* animations/spring-function.html: Added.
* animations/spring-parsing-expected.txt: Added.
* animations/spring-parsing.html: Added.
Add tests for the spring timing function.</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="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserModeh">trunk/Source/WebCore/css/CSSParserMode.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSTimingFunctionValuecpp">trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSTimingFunctionValueh">trunk/Source/WebCore/css/CSSTimingFunctionValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSToStyleMapcpp">trunk/Source/WebCore/css/CSSToStyleMap.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuecpp">trunk/Source/WebCore/css/CSSValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueh">trunk/Source/WebCore/css/CSSValue.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebCorepageanimationAnimationBasecpp">trunk/Source/WebCore/page/animation/AnimationBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformanimationTimingFunctioncpp">trunk/Source/WebCore/platform/animation/TimingFunction.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformanimationTimingFunctionh">trunk/Source/WebCore/platform/animation/TimingFunction.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCAAnimationcpp">trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCAAnimationh">trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCAAnimationCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp">trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsanimationsscripttestsspringcomputedstylejs">trunk/LayoutTests/animations/script-tests/spring-computed-style.js</a></li>
<li><a href="#trunkLayoutTestsanimationsscripttestsspringparsingjs">trunk/LayoutTests/animations/script-tests/spring-parsing.js</a></li>
<li><a href="#trunkLayoutTestsanimationsspringcomputedstyleexpectedtxt">trunk/LayoutTests/animations/spring-computed-style-expected.txt</a></li>
<li><a href="#trunkLayoutTestsanimationsspringcomputedstylehtml">trunk/LayoutTests/animations/spring-computed-style.html</a></li>
<li><a href="#trunkLayoutTestsanimationsspringfunctionexpectedtxt">trunk/LayoutTests/animations/spring-function-expected.txt</a></li>
<li><a href="#trunkLayoutTestsanimationsspringfunctionhtml">trunk/LayoutTests/animations/spring-function.html</a></li>
<li><a href="#trunkLayoutTestsanimationsspringparsingexpectedtxt">trunk/LayoutTests/animations/spring-parsing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsanimationsspringparsinghtml">trunk/LayoutTests/animations/spring-parsing.html</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSpringSolverh">trunk/Source/WebCore/platform/graphics/SpringSolver.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/LayoutTests/ChangeLog        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-06-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add experimental support for spring based CSS animations
+        https://bugs.webkit.org/show_bug.cgi?id=158403
+
+        Reviewed by Dean Jackson.
+
+        * animations/script-tests/spring-computed-style.js: Added.
+        * animations/script-tests/spring-parsing.js: Added.
+        * animations/spring-computed-style-expected.txt: Added.
+        * animations/spring-computed-style.html: Added.
+        * animations/spring-function-expected.txt: Added.
+        * animations/spring-function.html: Added.
+        * animations/spring-parsing-expected.txt: Added.
+        * animations/spring-parsing.html: Added.
+        Add tests for the spring timing function.
+
</ins><span class="cx"> 2016-06-05  Gyuyoung Kim  &lt;gyuyoung.kim@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed EFL gardening on June 6. Unskip passing tests and mark failing tests.
</span></span></pre></div>
<a id="trunkLayoutTestsanimationsscripttestsspringcomputedstylejs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/script-tests/spring-computed-style.js (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/script-tests/spring-computed-style.js                                (rev 0)
+++ trunk/LayoutTests/animations/script-tests/spring-computed-style.js        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+description(&quot;Test the computed style of the spring() function on the transition-timing-function property.&quot;);
+
+if (window.internals)
+    internals.settings.setSpringTimingFunctionEnabled(true);
+
+// These have to be global for the test helpers to see them.
+var stylesheet, springStyle;
+var styleElement = document.createElement(&quot;style&quot;);
+document.head.appendChild(styleElement);
+stylesheet = styleElement.sheet;
+
+function testComputedSpring(description, spring, expectedValue)
+{
+    debug(&quot;&quot;);
+    debug(description + &quot; : &quot; + spring);
+
+    stylesheet.insertRule(&quot;body { transition-timing-function: &quot; + spring + &quot;; }&quot;, 0);
+
+    springStyle = window.getComputedStyle(document.body).getPropertyCSSValue(&quot;transition-timing-function&quot;);
+    shouldBe(&quot;springStyle.cssText&quot;, &quot;'&quot; + expectedValue + &quot;'&quot;);
+    
+    stylesheet.deleteRule(0);
+}
+
+debug(&quot;&quot;)
+debug(&quot;Valid spring tests&quot;);
+debug(&quot;&quot;)
+
+testComputedSpring(&quot;Basic&quot;, &quot;spring(1 100 10 0)&quot;, &quot;spring(1 100 10 0)&quot;);
+testComputedSpring(&quot;Negative Velocity&quot;, &quot;spring(1 100 10 -10)&quot;, &quot;spring(1 100 10 -10)&quot;);
+testComputedSpring(&quot;Positive Velocity&quot;, &quot;spring(1 100 10 10)&quot;, &quot;spring(1 100 10 10)&quot;);
+testComputedSpring(&quot;Zero Damping&quot;, &quot;spring(1 100 0 10)&quot;, &quot;spring(1 100 0 10)&quot;);
+testComputedSpring(&quot;Minimum Values&quot;, &quot;spring(1 1 0 -999999)&quot;, &quot;spring(1 1 0 -999999)&quot;);
+
+debug(&quot;&quot;)
+debug(&quot;Invalid spring tests&quot;);
+debug(&quot;&quot;)
+
+testComputedSpring(&quot;No parameters&quot;, &quot;spring()&quot;, &quot;ease&quot;);
+testComputedSpring(&quot;Not enough parameters&quot;, &quot;spring(1 100 10)&quot;, &quot;ease&quot;);
+testComputedSpring(&quot;Too many parameters&quot;, &quot;spring(1 100 10 0 0)&quot;, &quot;ease&quot;);
+testComputedSpring(&quot;Illegal Mass (&lt; 0)&quot;, &quot;spring(-1 100 10 0)&quot;, &quot;ease&quot;);
+testComputedSpring(&quot;Illegal Mass (== 0)&quot;, &quot;spring(0 100 10 0)&quot;, &quot;ease&quot;);
+testComputedSpring(&quot;Illegal Stiffness (&lt; 0)&quot;, &quot;spring(1 -1 10 0)&quot;, &quot;ease&quot;);
+testComputedSpring(&quot;Illegal Stiffness (== 0)&quot;, &quot;spring(1 0 10 0)&quot;, &quot;ease&quot;);
+testComputedSpring(&quot;Illegal Damping (&lt; 0)&quot;, &quot;spring(1 100 -1 0)&quot;, &quot;ease&quot;);
+
+successfullyParsed = true;
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsscripttestsspringparsingjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/script-tests/spring-parsing.js (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/script-tests/spring-parsing.js                                (rev 0)
+++ trunk/LayoutTests/animations/script-tests/spring-parsing.js        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+description(&quot;Test the parsing of the spring() function on the transition-timing-function property.&quot;);
+
+if (window.internals)
+    internals.settings.setSpringTimingFunctionEnabled(true);
+
+// These have to be global for the test helpers to see them.
+var stylesheet, cssRule, declaration, propertyValue, subRule;
+var styleElement = document.createElement(&quot;style&quot;);
+document.head.appendChild(styleElement);
+stylesheet = styleElement.sheet;
+
+function testSpring(description, spring, expectedValue)
+{
+    debug(&quot;&quot;);
+    debug(description + &quot; : &quot; + spring);
+
+    stylesheet.insertRule(&quot;body { transition-timing-function: &quot; + spring + &quot;; }&quot;, 0);
+    cssRule = stylesheet.cssRules.item(0);
+
+    shouldBe(&quot;cssRule.type&quot;, &quot;1&quot;);
+
+    declaration = cssRule.style;
+    if (!expectedValue) {
+        shouldBe(&quot;declaration.length&quot;, &quot;0&quot;);
+        shouldBeEqualToString(&quot;declaration.getPropertyValue('transition-timing-function')&quot;, &quot;&quot;);
+        return;
+    }
+
+    shouldBe(&quot;declaration.length&quot;, &quot;1&quot;);
+    shouldBe(&quot;declaration.getPropertyValue('transition-timing-function')&quot;, &quot;'&quot; + expectedValue + &quot;'&quot;);
+
+    propertyValue = declaration.getPropertyCSSValue(&quot;transition-timing-function&quot;);
+    shouldBe(&quot;propertyValue.cssText&quot;, &quot;'&quot; + expectedValue + &quot;'&quot;);
+
+    stylesheet.deleteRule(0);
+}
+
+debug(&quot;&quot;)
+debug(&quot;Valid spring tests&quot;);
+debug(&quot;&quot;)
+
+testSpring(&quot;Basic&quot;, &quot;spring(1 100 10 0)&quot;, &quot;spring(1 100 10 0)&quot;);
+testSpring(&quot;Negative Velocity&quot;, &quot;spring(1 100 10 -10)&quot;, &quot;spring(1 100 10 -10)&quot;);
+testSpring(&quot;Positive Velocity&quot;, &quot;spring(1 100 10 10)&quot;, &quot;spring(1 100 10 10)&quot;);
+testSpring(&quot;Zero Damping&quot;, &quot;spring(1 100 0 10)&quot;, &quot;spring(1 100 0 10)&quot;);
+testSpring(&quot;Minimum Values&quot;, &quot;spring(1 1 0 -999999)&quot;, &quot;spring(1 1 0 -999999)&quot;);
+
+debug(&quot;&quot;)
+debug(&quot;Invalid spring tests&quot;);
+debug(&quot;&quot;)
+
+testSpring(&quot;No parameters&quot;, &quot;spring()&quot;, null);
+testSpring(&quot;Not enough parameters&quot;, &quot;spring(1 100 10)&quot;, null);
+testSpring(&quot;Too many parameters&quot;, &quot;spring(1 100 10 0 0)&quot;, null);
+testSpring(&quot;Illegal Mass (&lt; 0)&quot;, &quot;spring(-1 100 10 0)&quot;, null);
+testSpring(&quot;Illegal Mass (== 0)&quot;, &quot;spring(0 100 10 0)&quot;, null);
+testSpring(&quot;Illegal Stiffness (&lt; 0)&quot;, &quot;spring(1 -1 10 0)&quot;, null);
+testSpring(&quot;Illegal Stiffness (== 0)&quot;, &quot;spring(1 0 10 0)&quot;, null);
+testSpring(&quot;Illegal Damping (&lt; 0)&quot;, &quot;spring(1 100 -1 0)&quot;, null);
+
+successfullyParsed = true;
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsspringcomputedstyleexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/spring-computed-style-expected.txt (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/spring-computed-style-expected.txt                                (rev 0)
+++ trunk/LayoutTests/animations/spring-computed-style-expected.txt        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+Test the computed style of the spring() function on the transition-timing-function property.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Valid spring tests
+
+
+Basic : spring(1 100 10 0)
+PASS springStyle.cssText is 'spring(1 100 10 0)'
+
+Negative Velocity : spring(1 100 10 -10)
+PASS springStyle.cssText is 'spring(1 100 10 -10)'
+
+Positive Velocity : spring(1 100 10 10)
+PASS springStyle.cssText is 'spring(1 100 10 10)'
+
+Zero Damping : spring(1 100 0 10)
+PASS springStyle.cssText is 'spring(1 100 0 10)'
+
+Minimum Values : spring(1 1 0 -999999)
+PASS springStyle.cssText is 'spring(1 1 0 -999999)'
+
+Invalid spring tests
+
+
+No parameters : spring()
+PASS springStyle.cssText is 'ease'
+
+Not enough parameters : spring(1 100 10)
+PASS springStyle.cssText is 'ease'
+
+Too many parameters : spring(1 100 10 0 0)
+PASS springStyle.cssText is 'ease'
+
+Illegal Mass (&lt; 0) : spring(-1 100 10 0)
+PASS springStyle.cssText is 'ease'
+
+Illegal Mass (== 0) : spring(0 100 10 0)
+PASS springStyle.cssText is 'ease'
+
+Illegal Stiffness (&lt; 0) : spring(1 -1 10 0)
+PASS springStyle.cssText is 'ease'
+
+Illegal Stiffness (== 0) : spring(1 0 10 0)
+PASS springStyle.cssText is 'ease'
+
+Illegal Damping (&lt; 0) : spring(1 100 -1 0)
+PASS springStyle.cssText is 'ease'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsspringcomputedstylehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/spring-computed-style.html (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/spring-computed-style.html                                (rev 0)
+++ trunk/LayoutTests/animations/spring-computed-style.html        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;script-tests/spring-computed-style.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsspringfunctionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/spring-function-expected.txt (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/spring-function-expected.txt                                (rev 0)
+++ trunk/LayoutTests/animations/spring-function-expected.txt        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This test performs an animation of the left property. It animates over 1 second. It takes 3 snapshots and expects each result to be within a specified range.
+PASS - &quot;left&quot; property for &quot;box1&quot; element at 0.25s saw something close to: 512
+PASS - &quot;left&quot; property for &quot;box1&quot; element at 0.5s saw something close to: 537
+PASS - &quot;left&quot; property for &quot;box1&quot; element at 0.75s saw something close to: 487
+
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsspringfunctionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/spring-function.html (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/spring-function.html                                (rev 0)
+++ trunk/LayoutTests/animations/spring-function.html        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html lang=&quot;en&quot;&gt;
+&lt;head&gt;
+  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
+  &lt;title&gt;Test timing functions&lt;/title&gt;
+  &lt;script&gt;
+    if (window.internals)
+        internals.settings.setSpringTimingFunctionEnabled(true);
+  &lt;/script&gt;
+  &lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
+    .box {
+      position: relative;
+      left: 100px;
+      top: 0px;
+      height: 5px;
+      width: 5px;
+      background-color: blue;
+      animation-duration: 1s;
+      animation-name: anim;
+    }
+    @keyframes anim {
+        from { left: 0px; }
+        to   { left: 500px; }
+    }
+    #box1 {
+      animation-timing-function: spring(1 100 10 0);
+    }
+    
+  &lt;/style&gt;
+  &lt;script src=&quot;resources/animation-test-helpers.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
+  &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
+
+    const expectedValues = [
+      // [animation-name, time, element-id, property, expected-value, tolerance]
+      [&quot;anim&quot;, 0.25, &quot;box1&quot;, &quot;left&quot;, 512, 5],
+      [&quot;anim&quot;, 0.50, &quot;box1&quot;, &quot;left&quot;, 537, 5],
+      [&quot;anim&quot;, 0.75, &quot;box1&quot;, &quot;left&quot;, 487, 5],
+    ];
+
+    runAnimationTest(expectedValues);
+
+  &lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test performs an animation of the left property. It animates over 1 second.
+It takes 3 snapshots and expects each result to be within a specified range.
+&lt;div class=&quot;box&quot; id=&quot;box1&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;result&quot;&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsspringparsingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/spring-parsing-expected.txt (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/spring-parsing-expected.txt                                (rev 0)
+++ trunk/LayoutTests/animations/spring-parsing-expected.txt        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+Test the parsing of the spring() function on the transition-timing-function property.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+
+Valid spring tests
+
+
+Basic : spring(1 100 10 0)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 10 0)'
+PASS propertyValue.cssText is 'spring(1 100 10 0)'
+
+Negative Velocity : spring(1 100 10 -10)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 10 -10)'
+PASS propertyValue.cssText is 'spring(1 100 10 -10)'
+
+Positive Velocity : spring(1 100 10 10)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 10 10)'
+PASS propertyValue.cssText is 'spring(1 100 10 10)'
+
+Zero Damping : spring(1 100 0 10)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 100 0 10)'
+PASS propertyValue.cssText is 'spring(1 100 0 10)'
+
+Minimum Values : spring(1 1 0 -999999)
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('transition-timing-function') is 'spring(1 1 0 -999999)'
+PASS propertyValue.cssText is 'spring(1 1 0 -999999)'
+
+Invalid spring tests
+
+
+No parameters : spring()
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+
+Not enough parameters : spring(1 100 10)
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+
+Too many parameters : spring(1 100 10 0 0)
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+
+Illegal Mass (&lt; 0) : spring(-1 100 10 0)
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+
+Illegal Mass (== 0) : spring(0 100 10 0)
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+
+Illegal Stiffness (&lt; 0) : spring(1 -1 10 0)
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+
+Illegal Stiffness (== 0) : spring(1 0 10 0)
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+
+Illegal Damping (&lt; 0) : spring(1 100 -1 0)
+PASS cssRule.type is 1
+PASS declaration.length is 0
+PASS declaration.getPropertyValue('transition-timing-function') is &quot;&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsspringparsinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/spring-parsing.html (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/spring-parsing.html                                (rev 0)
+++ trunk/LayoutTests/animations/spring-parsing.html        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;script-tests/spring-parsing.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/ChangeLog        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -1,3 +1,122 @@
</span><ins>+2016-06-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add experimental support for spring based CSS animations
+        https://bugs.webkit.org/show_bug.cgi?id=158403
+
+        Reviewed by Dean Jackson.
+
+        Adds experimental support for a new CSS animation timing function that uses
+        spring to model the time function. To use it you replace your normal timing
+        function, be it cubic-bezier or steps, with a new function called spring().
+        For instance, for a transition you would write:
+
+            transition-timing-function: spring(1 100 10 0);
+        
+        The parameters are, in order:
+            - Mass
+            - Stiffness
+            - Damping
+            - Initial Velocity
+
+        Tests: animations/spring-computed-style.html
+               animations/spring-function.html
+               animations/spring-parsing.html
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add new file.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::createTimingFunctionValue):
+        Modernize and add support for the spring function.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParserContext::CSSParserContext):
+        (WebCore::operator==):
+        (WebCore::CSSParser::CSSParser):
+        (WebCore::CSSParser::parseTransformOriginShorthand):
+        (WebCore::CSSParser::isSpringTimingFunctionEnabled):
+        (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
+        (WebCore::CSSParser::parseSpringTimingFunctionValue):
+        (WebCore::CSSParser::parseAnimationTimingFunction):
+        * css/CSSParser.h:
+        * css/CSSParserMode.h:
+        Add parsing support for the spring() function.
+
+        * css/CSSTimingFunctionValue.cpp:
+        (WebCore::CSSCubicBezierTimingFunctionValue::customCSSText):
+        (WebCore::CSSCubicBezierTimingFunctionValue::equals):
+        (WebCore::CSSStepsTimingFunctionValue::customCSSText):
+        (WebCore::CSSStepsTimingFunctionValue::equals):
+        (WebCore::CSSSpringTimingFunctionValue::customCSSText):
+        (WebCore::CSSSpringTimingFunctionValue::equals):
+        * css/CSSTimingFunctionValue.h:
+        (WebCore::CSSSpringTimingFunctionValue::create):
+        (WebCore::CSSSpringTimingFunctionValue::mass):
+        (WebCore::CSSSpringTimingFunctionValue::stiffness):
+        (WebCore::CSSSpringTimingFunctionValue::damping):
+        (WebCore::CSSSpringTimingFunctionValue::initialVelocity):
+        (WebCore::CSSSpringTimingFunctionValue::CSSSpringTimingFunctionValue):
+        Modernize and add support for the spring function.
+
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
+        Pipe the spring function into the animation.
+
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::equals):
+        (WebCore::CSSValue::cssText):
+        (WebCore::CSSValue::destroy):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isSpringTimingFunctionValue):
+        Add support for the spring function.
+        
+        * page/Settings.in:
+        Add a setting to control if the spring function is enabled.
+
+        * page/animation/AnimationBase.cpp:
+        (WebCore::solveSpringFunction):
+        (WebCore::AnimationBase::progress):
+        Add support for solving the spring function. Since the spring requires time to be absolute,
+        get the real time by multiplying the ratio t, to the total duration.
+
+        * platform/animation/TimingFunction.cpp:
+        (WebCore::operator&lt;&lt;):
+        * platform/animation/TimingFunction.h:
+        (WebCore::TimingFunction::~TimingFunction):
+        (WebCore::TimingFunction::isSpringTimingFunction):
+        Add support for the spring timing function.
+
+        * platform/graphics/SpringSolver.h: Added.
+        (WebCore::SpringSolver::SpringSolver):
+        (WebCore::SpringSolver::solve):
+        Add a Spring solver that matches the one in CoreAnimation.
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
+        (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
+        (WebCore::GraphicsLayerCA::createBasicAnimation):
+        (WebCore::GraphicsLayerCA::createSpringAnimation):
+        (WebCore::GraphicsLayerCA::setupAnimation):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        Map animations with spring timing functions to CASpringAnimations.
+
+        * platform/graphics/ca/PlatformCAAnimation.cpp:
+        (WebCore::operator&lt;&lt;):
+        (WebCore::PlatformCAAnimation::isBasicAnimation):
+        * platform/graphics/ca/PlatformCAAnimation.h:
+        (WebCore::PlatformCAAnimation::setActualStartTimeIfNeeded):
+        (WebCore::PlatformCAAnimation::PlatformCAAnimation):
+        * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
+        (WebCore::toCAMediaTimingFunction):
+        (PlatformCAAnimationCocoa::PlatformCAAnimationCocoa):
+        (PlatformCAAnimationCocoa::setTimingFunction):
+        (PlatformCAAnimationCocoa::copyTimingFunctionFrom):
+        (PlatformCAAnimationCocoa::setFromValue):
+        (PlatformCAAnimationCocoa::copyFromValueFrom):
+        (PlatformCAAnimationCocoa::setToValue):
+        (PlatformCAAnimationCocoa::copyToValueFrom):
+        Add a new type of PlatformCAAnimation, Spring, which is a sub-type of Basic.
+
</ins><span class="cx"> 2016-06-05  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Addressing post-review comments on r201635.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -2764,6 +2764,7 @@
</span><span class="cx">                 7C74D43C1882400400E5ED57 /* UTextProviderUTF16.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */; };
</span><span class="cx">                 7C7941E41C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */; };
</span><span class="cx">                 7C7941E51C56C29300A4C58E /* DataDetectorsCoreSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */; };
</span><ins>+                7C83DE861D04CC5D00FEBCF3 /* SpringSolver.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */; };
</ins><span class="cx">                 7C91A38F1B498ABE003F9EFA /* JSNodeOrString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */; };
</span><span class="cx">                 7C91A3901B498ABE003F9EFA /* JSNodeOrString.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */; };
</span><span class="cx">                 7C93F3491AA6BA5E00A98BAB /* CompiledContentExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C93F3471AA6BA5E00A98BAB /* CompiledContentExtension.cpp */; };
</span><span class="lines">@@ -10430,6 +10431,7 @@
</span><span class="cx">                 7C74D43A1882400400E5ED57 /* UTextProviderUTF16.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTextProviderUTF16.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C7941E21C56C29300A4C58E /* DataDetectorsCoreSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetectorsCoreSoftLink.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C7941E31C56C29300A4C58E /* DataDetectorsCoreSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsCoreSoftLink.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpringSolver.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7C91A38D1B498ABE003F9EFA /* JSNodeOrString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeOrString.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C91A38E1B498ABE003F9EFA /* JSNodeOrString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNodeOrString.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7C93F3471AA6BA5E00A98BAB /* CompiledContentExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompiledContentExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22064,6 +22066,7 @@
</span><span class="cx">                                 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */,
</span><span class="cx">                                 CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */,
</span><span class="cx">                                 CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */,
</span><ins>+                                7C83DE851D04CBD400FEBCF3 /* SpringSolver.h */,
</ins><span class="cx">                                 B23540F00D00782E002382FA /* StringTruncator.cpp */,
</span><span class="cx">                                 B23540F10D00782E002382FA /* StringTruncator.h */,
</span><span class="cx">                                 849F77750EFEC6200090849D /* StrokeStyleApplier.h */,
</span><span class="lines">@@ -27840,6 +27843,7 @@
</span><span class="cx">                                 BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */,
</span><span class="cx">                                 BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */,
</span><span class="cx">                                 44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
</span><ins>+                                7C83DE861D04CC5D00FEBCF3 /* SpringSolver.h in Headers */,
</ins><span class="cx">                                 BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
</span><span class="cx">                                 0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
</span><span class="cx">                                 5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -1498,10 +1498,10 @@
</span><span class="cx"> {
</span><span class="cx">     switch (timingFunction-&gt;type()) {
</span><span class="cx">     case TimingFunction::CubicBezierFunction: {
</span><del>-        const CubicBezierTimingFunction* bezierTimingFunction = static_cast&lt;const CubicBezierTimingFunction*&gt;(timingFunction);
-        if (bezierTimingFunction-&gt;timingFunctionPreset() != CubicBezierTimingFunction::Custom) {
</del><ins>+        auto&amp; function = *static_cast&lt;const CubicBezierTimingFunction*&gt;(timingFunction);
+        if (function.timingFunctionPreset() != CubicBezierTimingFunction::Custom) {
</ins><span class="cx">             CSSValueID valueId = CSSValueInvalid;
</span><del>-            switch (bezierTimingFunction-&gt;timingFunctionPreset()) {
</del><ins>+            switch (function.timingFunctionPreset()) {
</ins><span class="cx">             case CubicBezierTimingFunction::Ease:
</span><span class="cx">                 valueId = CSSValueEase;
</span><span class="cx">                 break;
</span><span class="lines">@@ -1512,18 +1512,22 @@
</span><span class="cx">                 valueId = CSSValueEaseOut;
</span><span class="cx">                 break;
</span><span class="cx">             default:
</span><del>-                ASSERT(bezierTimingFunction-&gt;timingFunctionPreset() == CubicBezierTimingFunction::EaseInOut);
</del><ins>+                ASSERT(function.timingFunctionPreset() == CubicBezierTimingFunction::EaseInOut);
</ins><span class="cx">                 valueId = CSSValueEaseInOut;
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">             return CSSValuePool::singleton().createIdentifierValue(valueId);
</span><span class="cx">         }
</span><del>-        return CSSCubicBezierTimingFunctionValue::create(bezierTimingFunction-&gt;x1(), bezierTimingFunction-&gt;y1(), bezierTimingFunction-&gt;x2(), bezierTimingFunction-&gt;y2());
</del><ins>+        return CSSCubicBezierTimingFunctionValue::create(function.x1(), function.y1(), function.x2(), function.y2());
</ins><span class="cx">     }
</span><span class="cx">     case TimingFunction::StepsFunction: {
</span><del>-        const StepsTimingFunction* stepsTimingFunction = static_cast&lt;const StepsTimingFunction*&gt;(timingFunction);
-        return CSSStepsTimingFunctionValue::create(stepsTimingFunction-&gt;numberOfSteps(), stepsTimingFunction-&gt;stepAtStart());
</del><ins>+        auto&amp; function = *static_cast&lt;const StepsTimingFunction*&gt;(timingFunction);
+        return CSSStepsTimingFunctionValue::create(function.numberOfSteps(), function.stepAtStart());
</ins><span class="cx">     }
</span><ins>+    case TimingFunction::SpringFunction: {
+        auto&amp; function = *static_cast&lt;const SpringTimingFunction*&gt;(timingFunction);
+        return CSSSpringTimingFunctionValue::create(function.mass(), function.stiffness(), function.damping(), function.initialVelocity());
+    }
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT(timingFunction-&gt;type() == TimingFunction::LinearFunction);
</span><span class="cx">         return CSSValuePool::singleton().createIdentifierValue(CSSValueLinear);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -270,6 +270,7 @@
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">         textAutosizingEnabled = settings-&gt;textAutosizingEnabled();
</span><span class="cx"> #endif
</span><ins>+        springTimingFunctionEnabled = settings-&gt;springTimingFunctionEnabled();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -291,7 +292,8 @@
</span><span class="cx"> #endif
</span><span class="cx">         &amp;&amp; a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks
</span><span class="cx">         &amp;&amp; a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
</span><del>-        &amp;&amp; a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior;
</del><ins>+        &amp;&amp; a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior
+        &amp;&amp; a.springTimingFunctionEnabled == b.springTimingFunctionEnabled;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CSSParser::CSSParser(const CSSParserContext&amp; context)
</span><span class="lines">@@ -5157,23 +5159,38 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CSSParser::parseCubicBezierTimingFunctionValue(CSSParserValueList&amp; args, double&amp; result)
</del><ins>+bool CSSParser::isSpringTimingFunctionEnabled() const
</ins><span class="cx"> {
</span><ins>+    return m_context.springTimingFunctionEnabled;
+}
+
+Optional&lt;double&gt; CSSParser::parseCubicBezierTimingFunctionValue(CSSParserValueList&amp; args)
+{
</ins><span class="cx">     ValueWithCalculation argumentWithCalculation(*args.current());
</span><span class="cx">     if (!validateUnit(argumentWithCalculation, FNumber))
</span><del>-        return false;
-    result = parsedDouble(argumentWithCalculation);
</del><ins>+        return Nullopt;
+    Optional&lt;double&gt; result = parsedDouble(argumentWithCalculation);
</ins><span class="cx">     CSSParserValue* nextValue = args.next();
</span><span class="cx">     if (!nextValue) {
</span><span class="cx">         // The last number in the function has no comma after it, so we're done.
</span><del>-        return true;
</del><ins>+        return result;
</ins><span class="cx">     }
</span><span class="cx">     if (!isComma(nextValue))
</span><del>-        return false;
</del><ins>+        return Nullopt;
</ins><span class="cx">     args.next();
</span><del>-    return true;
</del><ins>+    return result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Optional&lt;double&gt; CSSParser::parseSpringTimingFunctionValue(CSSParserValueList&amp; args)
+{
+    ValueWithCalculation argumentWithCalculation(*args.current());
+    if (!validateUnit(argumentWithCalculation, FNumber))
+        return Nullopt;
+    Optional&lt;double&gt; result = parsedDouble(argumentWithCalculation);
+    args.next();
+    return result;
+}
+
</ins><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseAnimationTimingFunction()
</span><span class="cx"> {
</span><span class="cx">     CSSParserValue&amp; value = *m_valueList-&gt;current();
</span><span class="lines">@@ -5219,29 +5236,69 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (equalLettersIgnoringASCIICase(value.function-&gt;name, &quot;cubic-bezier(&quot;)) {
</span><del>-        // For cubic bezier, 4 values must be specified.
</del><ins>+        // For cubic bezier, 4 values must be specified (comma-separated).
</ins><span class="cx">         if (!args || args-&gt;size() != 7)
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         // There are two points specified. The x values must be between 0 and 1 but the y values can exceed this range.
</span><del>-        double x1, y1, x2, y2;
</del><span class="cx"> 
</span><del>-        if (!parseCubicBezierTimingFunctionValue(*args, x1))
</del><ins>+        auto x1 = parseCubicBezierTimingFunctionValue(*args);
+        if (!x1)
</ins><span class="cx">             return nullptr;
</span><del>-        if (x1 &lt; 0 || x1 &gt; 1)
</del><ins>+        if (x1.value() &lt; 0 || x1.value() &gt; 1)
</ins><span class="cx">             return nullptr;
</span><del>-        if (!parseCubicBezierTimingFunctionValue(*args, y1))
</del><ins>+
+        auto y1 = parseCubicBezierTimingFunctionValue(*args);
+        if (!y1)
</ins><span class="cx">             return nullptr;
</span><del>-        if (!parseCubicBezierTimingFunctionValue(*args, x2))
</del><ins>+
+        auto x2 = parseCubicBezierTimingFunctionValue(*args);
+        if (!x2)
</ins><span class="cx">             return nullptr;
</span><del>-        if (x2 &lt; 0 || x2 &gt; 1)
</del><ins>+        if (x2.value() &lt; 0 || x2.value() &gt; 1)
</ins><span class="cx">             return nullptr;
</span><del>-        if (!parseCubicBezierTimingFunctionValue(*args, y2))
</del><ins>+
+        auto y2 = parseCubicBezierTimingFunctionValue(*args);
+        if (!y2)
</ins><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><del>-        return CSSCubicBezierTimingFunctionValue::create(x1, y1, x2, y2);
</del><ins>+        return CSSCubicBezierTimingFunctionValue::create(x1.value(), y1.value(), x2.value(), y2.value());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (isSpringTimingFunctionEnabled() &amp;&amp; equalLettersIgnoringASCIICase(value.function-&gt;name, &quot;spring(&quot;)) {
+        // For a spring, 4 values must be specified (space-separated).
+        if (!args || args-&gt;size() != 4)
+            return nullptr;
+        
+        // Mass must be greater than 0.
+        auto mass = parseSpringTimingFunctionValue(*args);
+        if (!mass)
+            return nullptr;
+        if (mass.value() &lt;= 0)
+            return nullptr;
+
+        // Stiffness must be greater than 0.
+        auto stiffness = parseSpringTimingFunctionValue(*args);
+        if (!stiffness)
+            return nullptr;
+        if (stiffness.value() &lt;= 0)
+            return nullptr;
+
+        // Damping coefficient must be greater than or equal to 0.
+        auto damping = parseSpringTimingFunctionValue(*args);
+        if (!damping)
+            return nullptr;
+        if (damping.value() &lt; 0)
+            return nullptr;
+
+        // Initial velocity may have any value.
+        auto initialVelocity = parseSpringTimingFunctionValue(*args);
+        if (!initialVelocity)
+            return nullptr;
+
+        return CSSSpringTimingFunctionValue::create(mass.value(), stiffness.value(), damping.value(), initialVelocity.value());
+    }
+
</ins><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSParser.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -214,11 +214,14 @@
</span><span class="cx">     static Vector&lt;double&gt; parseKeyframeSelector(const String&amp;);
</span><span class="cx"> 
</span><span class="cx">     bool parseTransformOriginShorthand(RefPtr&lt;CSSPrimitiveValue&gt;&amp;, RefPtr&lt;CSSPrimitiveValue&gt;&amp;, RefPtr&lt;CSSValue&gt;&amp;);
</span><del>-    bool parseCubicBezierTimingFunctionValue(CSSParserValueList&amp; args, double&amp; result);
</del><ins>+    Optional&lt;double&gt; parseCubicBezierTimingFunctionValue(CSSParserValueList&amp;);
+    Optional&lt;double&gt; parseSpringTimingFunctionValue(CSSParserValueList&amp;);
</ins><span class="cx">     bool parseAnimationProperty(CSSPropertyID, RefPtr&lt;CSSValue&gt;&amp;, AnimationParseContext&amp;);
</span><span class="cx">     bool parseTransitionShorthand(CSSPropertyID, bool important);
</span><span class="cx">     bool parseAnimationShorthand(CSSPropertyID, bool important);
</span><span class="cx"> 
</span><ins>+    bool isSpringTimingFunctionEnabled() const;
+
</ins><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; parseColumnWidth();
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; parseColumnCount();
</span><span class="cx">     bool parseColumnsShorthand(bool important);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserModeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserMode.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserMode.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSParserMode.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx">     bool needsSiteSpecificQuirks { false };
</span><span class="cx">     bool enforcesCSSMIMETypeInNoQuirksMode { true };
</span><span class="cx">     bool useLegacyBackgroundSizeShorthandBehavior { false };
</span><ins>+    bool springTimingFunctionEnabled { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> bool operator==(const CSSParserContext&amp;, const CSSParserContext&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSTimingFunctionValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007, 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,17 +26,23 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;CSSTimingFunctionValue.h&quot;
</span><span class="cx"> 
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><ins>+#include &lt;wtf/text/StringBuilder.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> String CSSCubicBezierTimingFunctionValue::customCSSText() const
</span><span class="cx"> {
</span><del>-    return &quot;cubic-bezier(&quot;
-        + String::number(m_x1) + &quot;, &quot;
-        + String::number(m_y1) + &quot;, &quot;
-        + String::number(m_x2) + &quot;, &quot;
-        + String::number(m_y2) + ')';
</del><ins>+    StringBuilder builder;
+    builder.appendLiteral(&quot;cubic-bezier(&quot;);
+    builder.appendNumber(m_x1);
+    builder.appendLiteral(&quot;, &quot;);
+    builder.appendNumber(m_y1);
+    builder.appendLiteral(&quot;, &quot;);
+    builder.appendNumber(m_x2);
+    builder.appendLiteral(&quot;, &quot;);
+    builder.appendNumber(m_y2);
+    builder.append(')');    
+    return builder.toString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CSSCubicBezierTimingFunctionValue::equals(const CSSCubicBezierTimingFunctionValue&amp; other) const
</span><span class="lines">@@ -44,10 +50,16 @@
</span><span class="cx">     return m_x1 == other.m_x1 &amp;&amp; m_x2 == other.m_x2 &amp;&amp; m_y1 == other.m_y1 &amp;&amp; m_y2 == other.m_y2;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> String CSSStepsTimingFunctionValue::customCSSText() const
</span><span class="cx"> {
</span><del>-    return &quot;steps(&quot; + String::number(m_steps) + &quot;, &quot; + (m_stepAtStart ? &quot;start&quot; : &quot;end&quot;) + ')';
</del><ins>+    StringBuilder builder;
+    builder.appendLiteral(&quot;steps(&quot;);
+    builder.appendNumber(m_steps);
+    if (m_stepAtStart)
+        builder.appendLiteral(&quot;, start)&quot;);
+    else
+        builder.appendLiteral(&quot;, end)&quot;);
+    return builder.toString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue&amp; other) const
</span><span class="lines">@@ -55,4 +67,25 @@
</span><span class="cx">     return m_steps == other.m_steps &amp;&amp; m_stepAtStart == other.m_stepAtStart;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String CSSSpringTimingFunctionValue::customCSSText() const
+{
+    StringBuilder builder;
+    builder.appendLiteral(&quot;spring(&quot;);
+    builder.appendNumber(m_mass);
+    builder.append(' ');
+    builder.appendNumber(m_stiffness);
+    builder.append(' ');
+    builder.appendNumber(m_damping);
+    builder.append(' ');
+    builder.appendNumber(m_initialVelocity);
+    builder.append(')');
+    return builder.toString();
+}
+
+bool CSSSpringTimingFunctionValue::equals(const CSSSpringTimingFunctionValue&amp; other) const
+{
+    return m_mass == other.m_mass &amp;&amp; m_stiffness == other.m_stiffness &amp;&amp; m_damping == other.m_damping &amp;&amp; m_initialVelocity == other.m_initialVelocity;
+}
+
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSTimingFunctionValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSTimingFunctionValue.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSTimingFunctionValue.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSTimingFunctionValue.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007, 2008, 2012, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -89,9 +89,42 @@
</span><span class="cx">     bool m_stepAtStart;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+class CSSSpringTimingFunctionValue : public CSSValue {
+public:
+    static Ref&lt;CSSSpringTimingFunctionValue&gt; create(double mass, double stiffness, double damping, double initialVelocity)
+    {
+        return adoptRef(*new CSSSpringTimingFunctionValue(mass, stiffness, damping, initialVelocity));
+    }
+
+    double mass() const { return m_mass; }
+    double stiffness() const { return m_stiffness; }
+    double damping() const { return m_damping; }
+    double initialVelocity() const { return m_initialVelocity; }
+
+    String customCSSText() const;
+
+    bool equals(const CSSSpringTimingFunctionValue&amp;) const;
+
+private:
+    CSSSpringTimingFunctionValue(double mass, double stiffness, double damping, double initialVelocity)
+        : CSSValue(SpringTimingFunctionClass)
+        , m_mass(mass)
+        , m_stiffness(stiffness)
+        , m_damping(damping)
+        , m_initialVelocity(initialVelocity)
+    {
+    }
+
+    double m_mass;
+    double m_stiffness;
+    double m_damping;
+    double m_initialVelocity;
+};
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCubicBezierTimingFunctionValue, isCubicBezierTimingFunctionValue())
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSStepsTimingFunctionValue, isStepsTimingFunctionValue())
</span><ins>+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSSpringTimingFunctionValue, isSpringTimingFunctionValue())
</ins><span class="cx"> 
</span><span class="cx"> #endif // CSSTimingFunctionValue_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToStyleMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToStyleMap.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToStyleMap.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSToStyleMap.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -510,6 +510,9 @@
</span><span class="cx">     } else if (is&lt;CSSStepsTimingFunctionValue&gt;(value)) {
</span><span class="cx">         auto&amp; stepsTimingFunction = downcast&lt;CSSStepsTimingFunctionValue&gt;(value);
</span><span class="cx">         animation.setTimingFunction(StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepAtStart()));
</span><ins>+    } else if (is&lt;CSSSpringTimingFunctionValue&gt;(value)) {
+        auto&amp; springTimingFunction = downcast&lt;CSSSpringTimingFunctionValue&gt;(value);
+        animation.setTimingFunction(SpringTimingFunction::create(springTimingFunction.mass(), springTimingFunction.stiffness(), springTimingFunction.damping(), springTimingFunction.initialVelocity()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSValue.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -226,6 +226,8 @@
</span><span class="cx">             return compareCSSValues&lt;CSSCubicBezierTimingFunctionValue&gt;(*this, other);
</span><span class="cx">         case StepsTimingFunctionClass:
</span><span class="cx">             return compareCSSValues&lt;CSSStepsTimingFunctionValue&gt;(*this, other);
</span><ins>+        case SpringTimingFunctionClass:
+            return compareCSSValues&lt;CSSSpringTimingFunctionValue&gt;(*this, other);
</ins><span class="cx">         case UnicodeRangeClass:
</span><span class="cx">             return compareCSSValues&lt;CSSUnicodeRangeValue&gt;(*this, other);
</span><span class="cx">         case ValueListClass:
</span><span class="lines">@@ -332,6 +334,8 @@
</span><span class="cx">         return downcast&lt;CSSCubicBezierTimingFunctionValue&gt;(*this).customCSSText();
</span><span class="cx">     case StepsTimingFunctionClass:
</span><span class="cx">         return downcast&lt;CSSStepsTimingFunctionValue&gt;(*this).customCSSText();
</span><ins>+    case SpringTimingFunctionClass:
+        return downcast&lt;CSSSpringTimingFunctionValue&gt;(*this).customCSSText();
</ins><span class="cx">     case UnicodeRangeClass:
</span><span class="cx">         return downcast&lt;CSSUnicodeRangeValue&gt;(*this).customCSSText();
</span><span class="cx">     case ValueListClass:
</span><span class="lines">@@ -457,6 +461,9 @@
</span><span class="cx">     case StepsTimingFunctionClass:
</span><span class="cx">         delete downcast&lt;CSSStepsTimingFunctionValue&gt;(this);
</span><span class="cx">         return;
</span><ins>+    case SpringTimingFunctionClass:
+        delete downcast&lt;CSSSpringTimingFunctionValue&gt;(this);
+        return;
</ins><span class="cx">     case UnicodeRangeClass:
</span><span class="cx">         delete downcast&lt;CSSUnicodeRangeValue&gt;(this);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/css/CSSValue.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -104,6 +104,7 @@
</span><span class="cx">     bool isShadowValue() const { return m_classType == ShadowClass; }
</span><span class="cx">     bool isCubicBezierTimingFunctionValue() const { return m_classType == CubicBezierTimingFunctionClass; }
</span><span class="cx">     bool isStepsTimingFunctionValue() const { return m_classType == StepsTimingFunctionClass; }
</span><ins>+    bool isSpringTimingFunctionValue() const { return m_classType == SpringTimingFunctionClass; }
</ins><span class="cx">     bool isWebKitCSSTransformValue() const { return m_classType == WebKitCSSTransformClass; }
</span><span class="cx">     bool isLineBoxContainValue() const { return m_classType == LineBoxContainClass; }
</span><span class="cx">     bool isCalcValue() const {return m_classType == CalculationClass; }
</span><span class="lines">@@ -161,6 +162,7 @@
</span><span class="cx">         // Timing function classes.
</span><span class="cx">         CubicBezierTimingFunctionClass,
</span><span class="cx">         StepsTimingFunctionClass,
</span><ins>+        SpringTimingFunctionClass,
</ins><span class="cx"> 
</span><span class="cx">         // Other class types.
</span><span class="cx">         AspectRatioClass,
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/page/Settings.in        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -267,3 +267,5 @@
</span><span class="cx"> selectionPaintingWithoutSelectionGapsEnabled initial=false
</span><span class="cx"> 
</span><span class="cx"> shouldConvertInvalidURLsToBlank initial=true
</span><ins>+
+springTimingFunctionEnabled initial=false
</ins></span></pre></div>
<a id="trunkSourceWebCorepageanimationAnimationBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/AnimationBase.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/AnimationBase.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/page/animation/AnimationBase.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &quot;RenderBox.h&quot;
</span><span class="cx"> #include &quot;RenderStyle.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><ins>+#include &quot;SpringSolver.h&quot;
</ins><span class="cx"> #include &quot;UnitBezier.h&quot;
</span><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="lines">@@ -70,6 +71,12 @@
</span><span class="cx">     return floor(numSteps * t) / numSteps;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline double solveSpringFunction(double mass, double stiffness, double damping, double initialVelocity, double t, double duration)
+{
+    SpringSolver solver(mass, stiffness, damping, initialVelocity);
+    return solver.solve(t * duration);
+}
+
</ins><span class="cx"> AnimationBase::AnimationBase(const Animation&amp; animation, RenderElement* renderer, CompositeAnimation* compositeAnimation)
</span><span class="cx">     : m_object(renderer)
</span><span class="cx">     , m_compositeAnimation(compositeAnimation)
</span><span class="lines">@@ -648,13 +655,17 @@
</span><span class="cx"> 
</span><span class="cx">     switch (timingFunction-&gt;type()) {
</span><span class="cx">     case TimingFunction::CubicBezierFunction: {
</span><del>-        const CubicBezierTimingFunction* function = static_cast&lt;const CubicBezierTimingFunction*&gt;(timingFunction);
-        return solveCubicBezierFunction(function-&gt;x1(), function-&gt;y1(), function-&gt;x2(), function-&gt;y2(), fractionalTime, m_animation-&gt;duration());
</del><ins>+        auto&amp; function = *static_cast&lt;const CubicBezierTimingFunction*&gt;(timingFunction);
+        return solveCubicBezierFunction(function.x1(), function.y1(), function.x2(), function.y2(), fractionalTime, m_animation-&gt;duration());
</ins><span class="cx">     }
</span><span class="cx">     case TimingFunction::StepsFunction: {
</span><del>-        const StepsTimingFunction* stepsTimingFunction = static_cast&lt;const StepsTimingFunction*&gt;(timingFunction);
-        return solveStepsFunction(stepsTimingFunction-&gt;numberOfSteps(), stepsTimingFunction-&gt;stepAtStart(), fractionalTime);
</del><ins>+        auto&amp; function = *static_cast&lt;const StepsTimingFunction*&gt;(timingFunction);
+        return solveStepsFunction(function.numberOfSteps(), function.stepAtStart(), fractionalTime);
</ins><span class="cx">     }
</span><ins>+    case TimingFunction::SpringFunction: {
+        auto&amp; function = *static_cast&lt;const SpringTimingFunction*&gt;(timingFunction);
+        return solveSpringFunction(function.mass(), function.stiffness(), function.damping(), function.initialVelocity(), fractionalTime, m_animation-&gt;duration());
+    }
</ins><span class="cx">     case TimingFunction::LinearFunction:
</span><span class="cx">         return fractionalTime;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformanimationTimingFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/animation/TimingFunction.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/animation/TimingFunction.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/platform/animation/TimingFunction.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -37,16 +37,21 @@
</span><span class="cx">         ts &lt;&lt; &quot;linear&quot;;
</span><span class="cx">         break;
</span><span class="cx">     case TimingFunction::CubicBezierFunction: {
</span><del>-        const CubicBezierTimingFunction&amp; cubicBezierFunction = static_cast&lt;const CubicBezierTimingFunction&amp;&gt;(timingFunction);
-        ts &lt;&lt; &quot;cubic-bezier(&quot; &lt;&lt; cubicBezierFunction.x1() &lt;&lt; &quot;, &quot; &lt;&lt; cubicBezierFunction.y1() &lt;&lt; &quot;, &quot; &lt;&lt;  cubicBezierFunction.x2() &lt;&lt; &quot;, &quot; &lt;&lt; cubicBezierFunction.y2() &lt;&lt; &quot;)&quot;;
</del><ins>+        auto&amp; function = static_cast&lt;const CubicBezierTimingFunction&amp;&gt;(timingFunction);
+        ts &lt;&lt; &quot;cubic-bezier(&quot; &lt;&lt; function.x1() &lt;&lt; &quot;, &quot; &lt;&lt; function.y1() &lt;&lt; &quot;, &quot; &lt;&lt;  function.x2() &lt;&lt; &quot;, &quot; &lt;&lt; function.y2() &lt;&lt; &quot;)&quot;;
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     case TimingFunction::StepsFunction: {
</span><del>-        const StepsTimingFunction&amp; stepsFunction = static_cast&lt;const StepsTimingFunction&amp;&gt;(timingFunction);
-        ts &lt;&lt; &quot;steps(&quot; &lt;&lt; stepsFunction.numberOfSteps() &lt;&lt; &quot;, &quot; &lt;&lt; (stepsFunction.stepAtStart() ? &quot;start&quot; : &quot;end&quot;) &lt;&lt; &quot;)&quot;;
</del><ins>+        auto&amp; function = static_cast&lt;const StepsTimingFunction&amp;&gt;(timingFunction);
+        ts &lt;&lt; &quot;steps(&quot; &lt;&lt; function.numberOfSteps() &lt;&lt; &quot;, &quot; &lt;&lt; (function.stepAtStart() ? &quot;start&quot; : &quot;end&quot;) &lt;&lt; &quot;)&quot;;
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+    case TimingFunction::SpringFunction: {
+        auto&amp; function = static_cast&lt;const SpringTimingFunction&amp;&gt;(timingFunction);
+        ts &lt;&lt; &quot;spring(&quot; &lt;&lt; function.mass() &lt;&lt; &quot; &quot; &lt;&lt; function.stiffness() &lt;&lt; &quot; &quot; &lt;&lt;  function.damping() &lt;&lt; &quot; &quot; &lt;&lt; function.initialVelocity() &lt;&lt; &quot;)&quot;;
+        break;
</ins><span class="cx">     }
</span><ins>+    }
</ins><span class="cx">     return ts;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformanimationTimingFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/animation/TimingFunction.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/animation/TimingFunction.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/platform/animation/TimingFunction.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     virtual PassRefPtr&lt;TimingFunction&gt; clone() const = 0;
</span><span class="cx"> 
</span><span class="cx">     enum TimingFunctionType {
</span><del>-        LinearFunction, CubicBezierFunction, StepsFunction
</del><ins>+        LinearFunction, CubicBezierFunction, StepsFunction, SpringFunction
</ins><span class="cx">     };
</span><span class="cx">     
</span><span class="cx">     virtual ~TimingFunction() { }
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">     bool isLinearTimingFunction() const { return m_type == LinearFunction; }
</span><span class="cx">     bool isCubicBezierTimingFunction() const { return m_type == CubicBezierFunction; }
</span><span class="cx">     bool isStepsTimingFunction() const { return m_type == StepsFunction; }
</span><ins>+    bool isSpringTimingFunction() const { return m_type == SpringFunction; }
</ins><span class="cx">     
</span><span class="cx">     virtual bool operator==(const TimingFunction&amp; other) = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -58,7 +59,7 @@
</span><span class="cx">     TimingFunctionType m_type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class LinearTimingFunction : public TimingFunction {
</del><ins>+class LinearTimingFunction final : public TimingFunction {
</ins><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;LinearTimingFunction&gt; create()
</span><span class="cx">     {
</span><span class="lines">@@ -84,7 +85,7 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class CubicBezierTimingFunction : public TimingFunction {
</del><ins>+class CubicBezierTimingFunction final : public TimingFunction {
</ins><span class="cx"> public:
</span><span class="cx">     enum TimingFunctionPreset {
</span><span class="cx">         Ease,
</span><span class="lines">@@ -185,7 +186,7 @@
</span><span class="cx">     TimingFunctionPreset m_timingFunctionPreset;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class StepsTimingFunction : public TimingFunction {
</del><ins>+class StepsTimingFunction final : public TimingFunction {
</ins><span class="cx"> public:
</span><span class="cx">     
</span><span class="cx">     static PassRefPtr&lt;StepsTimingFunction&gt; create(int steps, bool stepAtStart)
</span><span class="lines">@@ -231,6 +232,64 @@
</span><span class="cx">     bool m_stepAtStart;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+class SpringTimingFunction final : public TimingFunction {
+public:
+    static Ref&lt;SpringTimingFunction&gt; create(double mass, double stiffness, double damping, double initialVelocity)
+    {
+        return adoptRef(*new SpringTimingFunction(mass, stiffness, damping, initialVelocity));
+    }
+
+    static Ref&lt;SpringTimingFunction&gt; create()
+    {
+        // This create() function should only be used by the argument decoders, and it is expected that
+        // real values will be filled in using setValues().
+        return create(0, 0, 0, 0);
+    }
+    
+    bool operator==(const TimingFunction&amp; other) override
+    {
+        if (other.isSpringTimingFunction()) {
+            const SpringTimingFunction&amp; otherString = *static_cast&lt;const SpringTimingFunction*&gt;(&amp;other);
+
+            return m_mass == otherString.m_mass &amp;&amp; m_stiffness == otherString.m_stiffness &amp;&amp; m_damping == otherString.m_damping &amp;&amp; m_initialVelocity == otherString.m_initialVelocity;
+        }
+        return false;
+    }
+
+    double mass() const { return m_mass; }
+    double stiffness() const { return m_stiffness; }
+    double damping() const { return m_damping; }
+    double initialVelocity() const { return m_initialVelocity; }
+    
+    void setValues(double mass, double stiffness, double damping, double initialVelocity)
+    {
+        m_mass = mass;
+        m_stiffness = stiffness;
+        m_damping = damping;
+        m_initialVelocity = initialVelocity;
+    }
+
+private:
+    explicit SpringTimingFunction(double mass, double stiffness, double damping, double initialVelocity)
+        : TimingFunction(SpringFunction)
+        , m_mass(mass)
+        , m_stiffness(stiffness)
+        , m_damping(damping)
+        , m_initialVelocity(initialVelocity)
+    {
+    }
+
+    PassRefPtr&lt;TimingFunction&gt; clone() const override
+    {
+        return adoptRef(new SpringTimingFunction(m_mass, m_stiffness, m_damping, m_initialVelocity));
+    }
+
+    double m_mass;
+    double m_stiffness;
+    double m_damping;
+    double m_initialVelocity;
+};
+
</ins><span class="cx"> class TextStream;
</span><span class="cx"> WEBCORE_EXPORT TextStream&amp; operator&lt;&lt;(TextStream&amp;, const TimingFunction&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSpringSolverh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/SpringSolver.h (0 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SpringSolver.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/SpringSolver.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace WebCore {
+
+class SpringSolver {
+public:
+    SpringSolver(double mass, double stiffness, double damping, double initialVelocity)
+    {
+        m_w0 = std::sqrt(stiffness / mass);
+        m_zeta = damping / (2 * std::sqrt(stiffness * mass));
+
+        if (m_zeta &lt; 1) {
+            // Under-damped.
+            m_wd = m_w0 * std::sqrt(1 - m_zeta * m_zeta);
+            m_A = 1;
+            m_B = (m_zeta * m_w0 + -initialVelocity) / m_wd;
+        } else {
+            // Critically damped (ignoring over-damped case for now).
+            m_A = 1;
+            m_B = -initialVelocity + m_w0;
+        }
+    }
+
+    double solve(double t)
+    {
+        if (m_zeta &lt; 1) {
+            // Under-damped
+            t = std::exp(-t * m_zeta * m_w0) * (m_A * std::cos(m_wd * t) + m_B * std::sin(m_wd * t));
+        } else {
+            // Critically damped (ignoring over-damped case for now).
+            t = (m_A + m_B * t) * std::exp(-t * m_w0);
+        }
+
+        // Map range from [1..0] to [0..1].
+        return 1 - t;
+    }
+
+private:
+    double m_w0;
+    double m_zeta;
+    double m_wd;
+    double m_A;
+    double m_B;
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -2743,7 +2743,10 @@
</span><span class="cx">         caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive);
</span><span class="cx">         valuesOK = setAnimationKeyframes(valueList, animation, caAnimation.get());
</span><span class="cx">     } else {
</span><del>-        caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive);
</del><ins>+        if (animation-&gt;timingFunction()-&gt;isSpringTimingFunction())
+            caAnimation = createSpringAnimation(animation, propertyIdToString(valueList.property()), additive);
+        else
+            caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive);
</ins><span class="cx">         valuesOK = setAnimationEndpoints(valueList, animation, caAnimation.get());
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -2767,7 +2770,10 @@
</span><span class="cx">         caAnimation = createKeyframeAnimation(animation, propertyIdToString(valueList.property()), additive);
</span><span class="cx">         validMatrices = setTransformAnimationKeyframes(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize);
</span><span class="cx">     } else {
</span><del>-        caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive);
</del><ins>+        if (animation-&gt;timingFunction()-&gt;isSpringTimingFunction())
+            caAnimation = createSpringAnimation(animation, propertyIdToString(valueList.property()), additive);
+        else
+            caAnimation = createBasicAnimation(animation, propertyIdToString(valueList.property()), additive);
</ins><span class="cx">         validMatrices = setTransformAnimationEndpoints(valueList, animation, caAnimation.get(), animationIndex, transformOp, isMatrixAnimation, boxSize);
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -2901,13 +2907,20 @@
</span><span class="cx">     return basicAnim;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;PlatformCAAnimation&gt;GraphicsLayerCA::createKeyframeAnimation(const Animation* anim, const String&amp; keyPath, bool additive)
</del><ins>+PassRefPtr&lt;PlatformCAAnimation&gt; GraphicsLayerCA::createKeyframeAnimation(const Animation* anim, const String&amp; keyPath, bool additive)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;PlatformCAAnimation&gt; keyframeAnim = createPlatformCAAnimation(PlatformCAAnimation::Keyframe, keyPath);
</span><span class="cx">     setupAnimation(keyframeAnim.get(), anim, additive);
</span><span class="cx">     return keyframeAnim;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;PlatformCAAnimation&gt; GraphicsLayerCA::createSpringAnimation(const Animation* anim, const String&amp; keyPath, bool additive)
+{
+    auto basicAnim = createPlatformCAAnimation(PlatformCAAnimation::Spring, keyPath);
+    setupAnimation(basicAnim.get(), anim, additive);
+    return basicAnim;
+}
+
</ins><span class="cx"> void GraphicsLayerCA::setupAnimation(PlatformCAAnimation* propertyAnim, const Animation* anim, bool additive)
</span><span class="cx"> {
</span><span class="cx">     double duration = anim-&gt;duration();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -242,6 +242,7 @@
</span><span class="cx">     // Return autoreleased animation (use RetainPtr?)
</span><span class="cx">     PassRefPtr&lt;PlatformCAAnimation&gt; createBasicAnimation(const Animation*, const String&amp; keyPath, bool additive);
</span><span class="cx">     PassRefPtr&lt;PlatformCAAnimation&gt; createKeyframeAnimation(const Animation*, const String&amp;, bool additive);
</span><ins>+    RefPtr&lt;PlatformCAAnimation&gt; createSpringAnimation(const Animation*, const String&amp;, bool additive);
</ins><span class="cx">     void setupAnimation(PlatformCAAnimation*, const Animation*, bool additive);
</span><span class="cx">     
</span><span class="cx">     const TimingFunction* timingFunctionForAnimationValue(const AnimationValue&amp;, const Animation&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCAAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">     switch (type) {
</span><span class="cx">     case PlatformCAAnimation::Basic: ts &lt;&lt; &quot;basic&quot;; break;
</span><span class="cx">     case PlatformCAAnimation::Keyframe: ts &lt;&lt; &quot;keyframe&quot;; break;
</span><ins>+    case PlatformCAAnimation::Spring: ts &lt;&lt; &quot;spring&quot;; break;
</ins><span class="cx">     }
</span><span class="cx">     return ts;
</span><span class="cx"> }
</span><span class="lines">@@ -69,4 +70,9 @@
</span><span class="cx">     return ts;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool PlatformCAAnimation::isBasicAnimation() const
+{
+    return animationType() == Basic || animationType() == Spring;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCAAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCAAnimation.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> 
</span><span class="cx"> class PlatformCAAnimation : public RefCounted&lt;PlatformCAAnimation&gt; {
</span><span class="cx"> public:
</span><del>-    enum AnimationType { Basic, Keyframe };
</del><ins>+    enum AnimationType { Basic, Keyframe, Spring };
</ins><span class="cx">     enum FillModeType { NoFillMode, Forwards, Backwards, Both };
</span><span class="cx">     enum ValueFunctionType { NoValueFunction, RotateX, RotateY, RotateZ, ScaleX, ScaleY, ScaleZ, Scale, TranslateX, TranslateY, TranslateZ, Translate };
</span><span class="cx"> 
</span><span class="lines">@@ -123,6 +123,8 @@
</span><span class="cx">         if (beginTime() &lt;= 0)
</span><span class="cx">             setBeginTime(t);
</span><span class="cx">     }
</span><ins>+
+    bool isBasicAnimation() const;
</ins><span class="cx">     
</span><span class="cx"> protected:
</span><span class="cx">     PlatformCAAnimation(AnimationType type = Basic)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCAAnimationCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -161,20 +161,30 @@
</span><span class="cx"> PlatformCAAnimationCocoa::PlatformCAAnimationCocoa(AnimationType type, const String&amp; keyPath)
</span><span class="cx">     : PlatformCAAnimation(type)
</span><span class="cx"> {
</span><del>-    if (type == Basic)
</del><ins>+    switch (type) {
+    case Basic:
</ins><span class="cx">         m_animation = [CABasicAnimation animationWithKeyPath:keyPath];
</span><del>-    else
</del><ins>+        break;
+    case Keyframe:
</ins><span class="cx">         m_animation = [CAKeyframeAnimation animationWithKeyPath:keyPath];
</span><ins>+        break;
+    case Spring:
+        m_animation = [CASpringAnimation animationWithKeyPath:keyPath];
+        break;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PlatformCAAnimationCocoa::PlatformCAAnimationCocoa(PlatformAnimationRef animation)
</span><span class="cx"> {
</span><del>-    if ([static_cast&lt;CAAnimation*&gt;(animation) isKindOfClass:[CABasicAnimation class]])
-        setType(Basic);
-    else if ([static_cast&lt;CAAnimation*&gt;(animation) isKindOfClass:[CAKeyframeAnimation class]])
</del><ins>+    if ([static_cast&lt;CAAnimation*&gt;(animation) isKindOfClass:[CABasicAnimation class]]) {
+        if ([static_cast&lt;CAAnimation*&gt;(animation) isKindOfClass:[CASpringAnimation class]])
+            setType(Spring);
+        else
+            setType(Basic);
+    } else if ([static_cast&lt;CAAnimation*&gt;(animation) isKindOfClass:[CAKeyframeAnimation class]])
</ins><span class="cx">         setType(Keyframe);
</span><span class="cx">     else {
</span><del>-        ASSERT(0);
</del><ins>+        ASSERT_NOT_REACHED();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -305,7 +315,23 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setTimingFunction(const TimingFunction* value, bool reverse)
</span><span class="cx"> {
</span><del>-    [m_animation setTimingFunction:toCAMediaTimingFunction(value, reverse)];
</del><ins>+    switch (animationType()) {
+    case Basic:
+    case Keyframe:
+        [m_animation setTimingFunction:toCAMediaTimingFunction(value, reverse)];
+        break;
+    case Spring:
+        if (value-&gt;isSpringTimingFunction()) {
+            // FIXME: Handle reverse.
+            auto&amp; function = *static_cast&lt;const SpringTimingFunction*&gt;(value);
+            CASpringAnimation *springAnimation = (CASpringAnimation *)m_animation.get();
+            springAnimation.mass = function.mass();
+            springAnimation.stiffness = function.stiffness();
+            springAnimation.damping = function.damping();
+            springAnimation.initialVelocity = function.initialVelocity();
+        }
+        break;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::copyTimingFunctionFrom(const PlatformCAAnimation&amp; value)
</span><span class="lines">@@ -346,14 +372,14 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setFromValue(float value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx">     [static_cast&lt;CABasicAnimation*&gt;(m_animation.get()) setFromValue:[NSNumber numberWithDouble:value]];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setFromValue(const WebCore::TransformationMatrix&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     [static_cast&lt;CABasicAnimation*&gt;(m_animation.get()) setFromValue:[NSValue valueWithCATransform3D:value]];
</span><span class="lines">@@ -361,7 +387,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setFromValue(const FloatPoint3D&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     NSArray* array = [NSArray arrayWithObjects:
</span><span class="lines">@@ -374,7 +400,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setFromValue(const WebCore::Color&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     NSArray* array = [NSArray arrayWithObjects:
</span><span class="lines">@@ -394,7 +420,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::copyFromValueFrom(const PlatformCAAnimation&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic || value.animationType() != Basic)
</del><ins>+    if (!isBasicAnimation() || !value.isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     CABasicAnimation* otherAnimation = static_cast&lt;CABasicAnimation*&gt;(downcast&lt;PlatformCAAnimationCocoa&gt;(value).m_animation.get());
</span><span class="lines">@@ -403,14 +429,14 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setToValue(float value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx">     [static_cast&lt;CABasicAnimation*&gt;(m_animation.get()) setToValue:[NSNumber numberWithDouble:value]];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setToValue(const WebCore::TransformationMatrix&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     [static_cast&lt;CABasicAnimation*&gt;(m_animation.get()) setToValue:[NSValue valueWithCATransform3D:value]];
</span><span class="lines">@@ -418,7 +444,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setToValue(const FloatPoint3D&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     NSArray* array = [NSArray arrayWithObjects:
</span><span class="lines">@@ -431,7 +457,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::setToValue(const WebCore::Color&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic)
</del><ins>+    if (!isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     NSArray* array = [NSArray arrayWithObjects:
</span><span class="lines">@@ -451,7 +477,7 @@
</span><span class="cx"> 
</span><span class="cx"> void PlatformCAAnimationCocoa::copyToValueFrom(const PlatformCAAnimation&amp; value)
</span><span class="cx"> {
</span><del>-    if (animationType() != Basic || value.animationType() != Basic)
</del><ins>+    if (!isBasicAnimation() || !value.isBasicAnimation())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     CABasicAnimation* otherAnimation = static_cast&lt;CABasicAnimation*&gt;(downcast&lt;PlatformCAAnimationCocoa&gt;(value).m_animation.get());
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-06-05  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Add experimental support for spring based CSS animations
+        https://bugs.webkit.org/show_bug.cgi?id=158403
+
+        Reviewed by Dean Jackson.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;StepsTimingFunction&gt;::decode):
+        (IPC::ArgumentCoder&lt;SpringTimingFunction&gt;::encode):
+        (IPC::ArgumentCoder&lt;SpringTimingFunction&gt;::decode):
+        (IPC::ArgumentCoder&lt;FloatPoint&gt;::encode):
+        * Shared/WebCoreArgumentCoders.h:
+        * Shared/WebPreferencesDefinitions.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+        * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
+        (WebKit::PlatformCAAnimationRemote::Properties::encode):
+        (WebKit::PlatformCAAnimationRemote::Properties::decode):
+        (WebKit::addAnimationToLayer):
+        Pipe through support for the Spring animation.
+
</ins><span class="cx"> 2016-06-05  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Change ProxyObject.[[Get]] not to use custom accessor
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedCoordinatedGraphicsCoordinatedGraphicsArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -365,7 +365,15 @@
</span><span class="cx">         encoder &lt;&lt; steps-&gt;stepAtStart();
</span><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+    case TimingFunction::SpringFunction: {
+        const SpringTimingFunction* spring = static_cast&lt;const SpringTimingFunction*&gt;(timingFunction);
+        encoder &lt;&lt; spring-&gt;mass();
+        encoder &lt;&lt; spring-&gt;stiffness();
+        encoder &lt;&lt; spring-&gt;damping();
+        encoder &lt;&lt; spring-&gt;initialVelocity();
+        break;
</ins><span class="cx">     }
</span><ins>+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool decodeTimingFunction(ArgumentDecoder&amp; decoder, RefPtr&lt;TimingFunction&gt;&amp; timingFunction)
</span><span class="lines">@@ -413,7 +421,24 @@
</span><span class="cx">         timingFunction = StepsTimingFunction::create(numberOfSteps, stepAtStart);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><ins>+    case TimingFunction::SpringFunction: {
+        double mass;
+        if (!decoder.decode(mass))
+            return false;
+        double stiffness;
+        if (!decoder.decode(stiffness))
+            return false;
+        double damping;
+        if (!decoder.decode(damping))
+            return false;
+        double initialVelocity;
+        if (!decoder.decode(initialVelocity))
+            return false;
+
+        timingFunction = SpringTimingFunction::create(mass, stiffness, damping, initialVelocity);
+        return true;
</ins><span class="cx">     }
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -265,6 +265,40 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;SpringTimingFunction&gt;::encode(ArgumentEncoder&amp; encoder, const SpringTimingFunction&amp; timingFunction)
+{
+    encoder.encodeEnum(timingFunction.type());
+    
+    encoder &lt;&lt; timingFunction.mass();
+    encoder &lt;&lt; timingFunction.stiffness();
+    encoder &lt;&lt; timingFunction.damping();
+    encoder &lt;&lt; timingFunction.initialVelocity();
+}
+
+bool ArgumentCoder&lt;SpringTimingFunction&gt;::decode(ArgumentDecoder&amp; decoder, SpringTimingFunction&amp; timingFunction)
+{
+    // Type is decoded by the caller.
+    double mass;
+    if (!decoder.decode(mass))
+        return false;
+
+    double stiffness;
+    if (!decoder.decode(stiffness))
+        return false;
+
+    double damping;
+    if (!decoder.decode(damping))
+        return false;
+
+    double initialVelocity;
+    if (!decoder.decode(initialVelocity))
+        return false;
+
+    timingFunction.setValues(mass, stiffness, damping, initialVelocity);
+
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder&lt;FloatPoint&gt;::encode(ArgumentEncoder&amp; encoder, const FloatPoint&amp; floatPoint)
</span><span class="cx"> {
</span><span class="cx">     SimpleArgumentCoder&lt;FloatPoint&gt;::encode(encoder, floatPoint);
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><span class="cx"> class SessionID;
</span><ins>+class SpringTimingFunction;
</ins><span class="cx"> class StepsTimingFunction;
</span><span class="cx"> class StickyPositionViewportConstraints;
</span><span class="cx"> class TextCheckingRequestData;
</span><span class="lines">@@ -151,6 +152,11 @@
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::StepsTimingFunction&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::SpringTimingFunction&gt; {
+    static void encode(ArgumentEncoder&amp;, const WebCore::SpringTimingFunction&amp;);
+    static bool decode(ArgumentDecoder&amp;, WebCore::SpringTimingFunction&amp;);
+};
+
</ins><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::CertificateInfo&gt; {
</span><span class="cx">     static void encode(ArgumentEncoder&amp;, const WebCore::CertificateInfo&amp;);
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::CertificateInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -293,6 +293,7 @@
</span><span class="cx">     macro(CSSGridLayoutEnabled, cssGridLayoutEnabled, Bool, bool, true, &quot;CSS Grid&quot;, &quot;CSS Grid Layout Module support&quot;) \
</span><span class="cx">     macro(CustomElementsEnabled, customElementsEnabled, Bool, bool, true, &quot;Custom Elements&quot;, &quot;HTML Custom Elements prototype&quot;) \
</span><span class="cx">     macro(WebGL2Enabled, webGL2Enabled, Bool, bool, true, &quot;WebGL 2.0&quot;, &quot;WebGL 2 prototype&quot;) \
</span><ins>+    macro(SpringTimingFunctionEnabled, springTimingFunctionEnabled, Bool, bool, true, &quot;CSS Spring Animations&quot;, &quot;CSS Spring Animation prototype&quot;) \
</ins><span class="cx">     \
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -3150,6 +3150,8 @@
</span><span class="cx">     RuntimeEnabledFeatures::sharedFeatures().setWebGL2Enabled(store.getBoolValueForKey(WebPreferencesKey::webGL2EnabledKey()));
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    settings.setSpringTimingFunctionEnabled(store.getBoolValueForKey(WebPreferencesKey::springTimingFunctionEnabledKey()));
+
</ins><span class="cx">     bool processSuppressionEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
</span><span class="cx">     if (m_processSuppressionEnabled != processSuppressionEnabled) {
</span><span class="cx">         m_processSuppressionEnabled = processSuppressionEnabled;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCAAnimationRemotemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm (201705 => 201706)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2016-06-06 03:59:46 UTC (rev 201705)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm        2016-06-06 04:56:38 UTC (rev 201706)
</span><span class="lines">@@ -196,6 +196,10 @@
</span><span class="cx">         case TimingFunction::StepsFunction:
</span><span class="cx">             encoder &lt;&lt; *static_cast&lt;StepsTimingFunction*&gt;(timingFunction.get());
</span><span class="cx">             break;
</span><ins>+
+        case TimingFunction::SpringFunction:
+            encoder &lt;&lt; *static_cast&lt;SpringTimingFunction*&gt;(timingFunction.get());
+            break;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -282,6 +286,12 @@
</span><span class="cx">                 if (!decoder.decode(*static_cast&lt;StepsTimingFunction*&gt;(timingFunction.get())))
</span><span class="cx">                     return false;
</span><span class="cx">                 break;
</span><ins>+
+            case TimingFunction::SpringFunction:
+                timingFunction = SpringTimingFunction::create();
+                if (!decoder.decode(*static_cast&lt;SpringTimingFunction*&gt;(timingFunction.get())))
+                    return false;
+                break;
</ins><span class="cx">             }
</span><span class="cx">             
</span><span class="cx">             properties.timingFunctions.uncheckedAppend(timingFunction.release());
</span><span class="lines">@@ -754,7 +764,29 @@
</span><span class="cx">         caAnimation = keyframeAnimation;
</span><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+    case PlatformCAAnimation::Spring: {
+        RetainPtr&lt;CASpringAnimation&gt; springAnimation;
+        springAnimation = [CASpringAnimation animationWithKeyPath:properties.keyPath];
+        
+        if (properties.keyValues.size() &gt; 1) {
+            [springAnimation setFromValue:animationValueFromKeyframeValue(properties.keyValues[0])];
+            [springAnimation setToValue:animationValueFromKeyframeValue(properties.keyValues[1])];
+        }
+        
+        if (properties.timingFunctions.size()) {
+            auto&amp; timingFunction = properties.timingFunctions[0];
+            if (timingFunction-&gt;isSpringTimingFunction()) {
+                auto&amp; function = *static_cast&lt;const SpringTimingFunction*&gt;(timingFunction.get());
+                [springAnimation setMass:function.mass()];
+                [springAnimation setStiffness:function.stiffness()];
+                [springAnimation setDamping:function.damping()];
+                [springAnimation setInitialVelocity:function.initialVelocity()];
+            }
+        }
+        caAnimation = springAnimation;
+        break;
</ins><span class="cx">     }
</span><ins>+    }
</ins><span class="cx">     
</span><span class="cx">     [caAnimation setBeginTime:properties.beginTime];
</span><span class="cx">     [caAnimation setDuration:properties.duration];
</span></span></pre>
</div>
</div>

</body>
</html>