<!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>[177821] trunk/Source/WebCore</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/177821">177821</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-12-29 20:39:59 -0800 (Mon, 29 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move animation / transition CSS properties to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=139999
Reviewed by Darin Adler.
Move animation / transition CSS properties to the new StyleBuilder by
teaching makeprop.pl how to generate them.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSToStyleMapcpp">trunk/Source/WebCore/css/CSSToStyleMap.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSToStyleMaph">trunk/Source/WebCore/css/CSSToStyleMap.h</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorecssmakeproppl">trunk/Source/WebCore/css/makeprop.pl</a></li>
<li><a href="#trunkSourceWebCoreplatformanimationAnimationcpp">trunk/Source/WebCore/platform/animation/Animation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformanimationAnimationh">trunk/Source/WebCore/platform/animation/Animation.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStylecpp">trunk/Source/WebCore/rendering/style/RenderStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/ChangeLog        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-12-29 Chris Dumez <cdumez@apple.com>
+
+ Move animation / transition CSS properties to the new StyleBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=139999
+
+ Reviewed by Darin Adler.
+
+ Move animation / transition CSS properties to the new StyleBuilder by
+ teaching makeprop.pl how to generate them.
+
</ins><span class="cx"> 2014-12-29 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove more dead code
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -1154,7 +1154,7 @@
</span><span class="cx"> list.get().append(cssValuePool().createValue(animList->animation(i).delay(), CSSPrimitiveValue::CSS_S));
</span><span class="cx"> } else {
</span><span class="cx"> // Note that initialAnimationDelay() is used for both transitions and animations
</span><del>- list.get().append(cssValuePool().createValue(Animation::initialAnimationDelay(), CSSPrimitiveValue::CSS_S));
</del><ins>+ list.get().append(cssValuePool().createValue(Animation::initialDelay(), CSSPrimitiveValue::CSS_S));
</ins><span class="cx"> }
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="lines">@@ -1167,7 +1167,7 @@
</span><span class="cx"> list.get().append(cssValuePool().createValue(animList->animation(i).duration(), CSSPrimitiveValue::CSS_S));
</span><span class="cx"> } else {
</span><span class="cx"> // Note that initialAnimationDuration() is used for both transitions and animations
</span><del>- list.get().append(cssValuePool().createValue(Animation::initialAnimationDuration(), CSSPrimitiveValue::CSS_S));
</del><ins>+ list.get().append(cssValuePool().createValue(Animation::initialDuration(), CSSPrimitiveValue::CSS_S));
</ins><span class="cx"> }
</span><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="lines">@@ -1216,7 +1216,7 @@
</span><span class="cx"> list.get().append(createTimingFunctionValue(animList->animation(i).timingFunction().get()));
</span><span class="cx"> } else
</span><span class="cx"> // Note that initialAnimationTimingFunction() is used for both transitions and animations
</span><del>- list.get().append(createTimingFunctionValue(Animation::initialAnimationTimingFunction().get()));
</del><ins>+ list.get().append(createTimingFunctionValue(Animation::initialTimingFunction().get()));
</ins><span class="cx"> return list;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2695,7 +2695,7 @@
</span><span class="cx"> list->append(cssValuePool().createValue(iterationCount, CSSPrimitiveValue::CSS_NUMBER));
</span><span class="cx"> }
</span><span class="cx"> } else
</span><del>- list->append(cssValuePool().createValue(Animation::initialAnimationIterationCount(), CSSPrimitiveValue::CSS_NUMBER));
</del><ins>+ list->append(cssValuePool().createValue(Animation::initialIterationCount(), CSSPrimitiveValue::CSS_NUMBER));
</ins><span class="cx"> return list.release();
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyAnimationName:
</span><span class="lines">@@ -2894,9 +2894,9 @@
</span><span class="cx"> RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
</span><span class="cx"> // transition-property default value.
</span><span class="cx"> list->append(cssValuePool().createIdentifierValue(CSSValueAll));
</span><del>- list->append(cssValuePool().createValue(Animation::initialAnimationDuration(), CSSPrimitiveValue::CSS_S));
- list->append(createTimingFunctionValue(Animation::initialAnimationTimingFunction().get()));
- list->append(cssValuePool().createValue(Animation::initialAnimationDelay(), CSSPrimitiveValue::CSS_S));
</del><ins>+ list->append(cssValuePool().createValue(Animation::initialDuration(), CSSPrimitiveValue::CSS_S));
+ list->append(createTimingFunctionValue(Animation::initialTimingFunction().get()));
+ list->append(cssValuePool().createValue(Animation::initialDelay(), CSSPrimitiveValue::CSS_S));
</ins><span class="cx"> return list.release();
</span><span class="cx"> }
</span><span class="cx"> case CSSPropertyPointerEvents:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -72,6 +72,10 @@
</span><span class="cx"> // Should only with used with "VisitedLinkColorSupport". It indicates that for
</span><span class="cx"> // setting the inherited value, it will not fallback to using the parent's
</span><span class="cx"> // "color" property if the inherited color is invalid.
</span><ins>+//
+// * AnimationProperty:
+// Indicates that this CSS property is an animation / transition property.
+// It must have corresponding methods on the Animation class.
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> // high-priority property names have to be listed first, to simplify the check
</span><span class="lines">@@ -112,14 +116,14 @@
</span><span class="cx">
</span><span class="cx"> // The remaining properties are listed in alphabetical order
</span><span class="cx"> animation [LegacyStyleBuilder]
</span><del>-animation-delay [LegacyStyleBuilder]
-animation-direction [LegacyStyleBuilder]
-animation-duration [LegacyStyleBuilder]
-animation-fill-mode [LegacyStyleBuilder]
-animation-iteration-count [LegacyStyleBuilder]
-animation-name [LegacyStyleBuilder]
-animation-play-state [LegacyStyleBuilder]
-animation-timing-function [LegacyStyleBuilder]
</del><ins>+animation-delay [AnimationProperty, TypeName=double, NameForMethods=Delay]
+animation-direction [AnimationProperty, TypeName=Animation::AnimationDirection, NameForMethods=Direction]
+animation-duration [AnimationProperty, TypeName=double, NameForMethods=Duration]
+animation-fill-mode [AnimationProperty, TypeName=unsigned, NameForMethods=FillMode]
+animation-iteration-count [AnimationProperty, TypeName=double, NameForMethods=IterationCount]
+animation-name [AnimationProperty, TypeName=String, NameForMethods=Name]
+animation-play-state [AnimationProperty, TypeName=EAnimPlayState, NameForMethods=PlayState]
+animation-timing-function [AnimationProperty, TypeName=PassRefPtr<TimingFunction>, NameForMethods=TimingFunction]
</ins><span class="cx"> background [LegacyStyleBuilder]
</span><span class="cx"> background-attachment [LegacyStyleBuilder]
</span><span class="cx"> background-blend-mode [LegacyStyleBuilder]
</span><span class="lines">@@ -293,14 +297,14 @@
</span><span class="cx"> alt [LegacyStyleBuilder]
</span><span class="cx"> -webkit-alt = alt
</span><span class="cx"> -webkit-animation [LegacyStyleBuilder]
</span><del>--webkit-animation-delay [LegacyStyleBuilder]
--webkit-animation-direction [LegacyStyleBuilder]
--webkit-animation-duration [LegacyStyleBuilder]
--webkit-animation-fill-mode [LegacyStyleBuilder]
--webkit-animation-iteration-count [LegacyStyleBuilder]
--webkit-animation-name [LegacyStyleBuilder]
--webkit-animation-play-state [LegacyStyleBuilder]
--webkit-animation-timing-function [LegacyStyleBuilder]
</del><ins>+-webkit-animation-delay [AnimationProperty, TypeName=double, NameForMethods=Delay]
+-webkit-animation-direction [AnimationProperty, TypeName=Animation::AnimationDirection, NameForMethods=Direction]
+-webkit-animation-duration [AnimationProperty, TypeName=double, NameForMethods=Duration]
+-webkit-animation-fill-mode [AnimationProperty, TypeName=unsigned, NameForMethods=FillMode]
+-webkit-animation-iteration-count [AnimationProperty, TypeName=double, NameForMethods=IterationCount]
+-webkit-animation-name [AnimationProperty, TypeName=String, NameForMethods=Name]
+-webkit-animation-play-state [AnimationProperty, TypeName=EAnimPlayState, NameForMethods=PlayState]
+-webkit-animation-timing-function [AnimationProperty, TypeName=PassRefPtr<TimingFunction>, NameForMethods=TimingFunction]
</ins><span class="cx"> -webkit-appearance [TypeName=ControlPart]
</span><span class="cx"> -webkit-aspect-ratio [Inherited, Custom=All]
</span><span class="cx"> -webkit-backface-visibility
</span><span class="lines">@@ -536,10 +540,10 @@
</span><span class="cx"> -webkit-transform-origin-z [Converter=ComputedLength<float>]
</span><span class="cx"> -webkit-transform-style [TypeName=ETransformStyle3D, NameForMethods=TransformStyle3D]
</span><span class="cx"> -webkit-transition [LegacyStyleBuilder]
</span><del>--webkit-transition-delay [LegacyStyleBuilder]
--webkit-transition-duration [LegacyStyleBuilder]
--webkit-transition-property [LegacyStyleBuilder]
--webkit-transition-timing-function [LegacyStyleBuilder]
</del><ins>+-webkit-transition-delay [AnimationProperty, TypeName=double, NameForMethods=Delay]
+-webkit-transition-duration [AnimationProperty, TypeName=double, NameForMethods=Duration]
+-webkit-transition-property [AnimationProperty, TypeName=CSSPropertyID, NameForMethods=Property]
+-webkit-transition-timing-function [AnimationProperty, TypeName=PassRefPtr<TimingFunction>, NameForMethods=TimingFunction]
</ins><span class="cx"> -webkit-user-drag
</span><span class="cx"> -webkit-user-modify [Inherited]
</span><span class="cx"> -webkit-user-select [Inherited]
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToStyleMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToStyleMap.cpp (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToStyleMap.cpp        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/css/CSSToStyleMap.cpp        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -325,23 +325,23 @@
</span><span class="cx"> layer->setMaskSourceType(type);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationDelay(Animation* animation, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationDelay(Animation& animation, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- animation->setDelay(Animation::initialAnimationDelay());
</del><ins>+ animation.setDelay(Animation::initialDelay());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!is<CSSPrimitiveValue>(value))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- animation->setDelay(downcast<CSSPrimitiveValue>(value).computeTime<double, CSSPrimitiveValue::Seconds>());
</del><ins>+ animation.setDelay(downcast<CSSPrimitiveValue>(value).computeTime<double, CSSPrimitiveValue::Seconds>());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationDirection(Animation* layer, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationDirection(Animation& layer, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- layer->setDirection(Animation::initialAnimationDirection());
</del><ins>+ layer.setDirection(Animation::initialDirection());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -350,39 +350,39 @@
</span><span class="cx">
</span><span class="cx"> switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
</span><span class="cx"> case CSSValueNormal:
</span><del>- layer->setDirection(Animation::AnimationDirectionNormal);
</del><ins>+ layer.setDirection(Animation::AnimationDirectionNormal);
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueAlternate:
</span><del>- layer->setDirection(Animation::AnimationDirectionAlternate);
</del><ins>+ layer.setDirection(Animation::AnimationDirectionAlternate);
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueReverse:
</span><del>- layer->setDirection(Animation::AnimationDirectionReverse);
</del><ins>+ layer.setDirection(Animation::AnimationDirectionReverse);
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueAlternateReverse:
</span><del>- layer->setDirection(Animation::AnimationDirectionAlternateReverse);
</del><ins>+ layer.setDirection(Animation::AnimationDirectionAlternateReverse);
</ins><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationDuration(Animation* animation, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationDuration(Animation& animation, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- animation->setDuration(Animation::initialAnimationDuration());
</del><ins>+ animation.setDuration(Animation::initialDuration());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!is<CSSPrimitiveValue>(value))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- animation->setDuration(downcast<CSSPrimitiveValue>(value).computeTime<double, CSSPrimitiveValue::Seconds>());
</del><ins>+ animation.setDuration(downcast<CSSPrimitiveValue>(value).computeTime<double, CSSPrimitiveValue::Seconds>());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationFillMode(Animation* layer, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationFillMode(Animation& layer, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- layer->setFillMode(Animation::initialAnimationFillMode());
</del><ins>+ layer.setFillMode(Animation::initialFillMode());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -391,26 +391,26 @@
</span><span class="cx">
</span><span class="cx"> switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
</span><span class="cx"> case CSSValueNone:
</span><del>- layer->setFillMode(AnimationFillModeNone);
</del><ins>+ layer.setFillMode(AnimationFillModeNone);
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueForwards:
</span><del>- layer->setFillMode(AnimationFillModeForwards);
</del><ins>+ layer.setFillMode(AnimationFillModeForwards);
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueBackwards:
</span><del>- layer->setFillMode(AnimationFillModeBackwards);
</del><ins>+ layer.setFillMode(AnimationFillModeBackwards);
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueBoth:
</span><del>- layer->setFillMode(AnimationFillModeBoth);
</del><ins>+ layer.setFillMode(AnimationFillModeBoth);
</ins><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationIterationCount(Animation* animation, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationIterationCount(Animation& animation, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- animation->setIterationCount(Animation::initialAnimationIterationCount());
</del><ins>+ animation.setIterationCount(Animation::initialIterationCount());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -419,15 +419,15 @@
</span><span class="cx">
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx"> if (primitiveValue.getValueID() == CSSValueInfinite)
</span><del>- animation->setIterationCount(Animation::IterationCountInfinite);
</del><ins>+ animation.setIterationCount(Animation::IterationCountInfinite);
</ins><span class="cx"> else
</span><del>- animation->setIterationCount(primitiveValue.getFloatValue());
</del><ins>+ animation.setIterationCount(primitiveValue.getFloatValue());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationName(Animation* layer, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationName(Animation& layer, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- layer->setName(Animation::initialAnimationName());
</del><ins>+ layer.setName(Animation::initialName());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -436,15 +436,15 @@
</span><span class="cx">
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx"> if (primitiveValue.getValueID() == CSSValueNone)
</span><del>- layer->setIsNoneAnimation(true);
</del><ins>+ layer.setIsNoneAnimation(true);
</ins><span class="cx"> else
</span><del>- layer->setName(primitiveValue.getStringValue());
</del><ins>+ layer.setName(primitiveValue.getStringValue());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationPlayState(Animation* layer, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationPlayState(Animation& layer, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- layer->setPlayState(Animation::initialAnimationPlayState());
</del><ins>+ layer.setPlayState(Animation::initialPlayState());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -452,14 +452,14 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> EAnimPlayState playState = (downcast<CSSPrimitiveValue>(value).getValueID() == CSSValuePaused) ? AnimPlayStatePaused : AnimPlayStatePlaying;
</span><del>- layer->setPlayState(playState);
</del><ins>+ layer.setPlayState(playState);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationProperty(Animation* animation, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationProperty(Animation& animation, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- animation->setAnimationMode(Animation::AnimateAll);
- animation->setProperty(CSSPropertyInvalid);
</del><ins>+ animation.setAnimationMode(Animation::AnimateAll);
+ animation.setProperty(CSSPropertyInvalid);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -468,46 +468,46 @@
</span><span class="cx">
</span><span class="cx"> auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
</span><span class="cx"> if (primitiveValue.getValueID() == CSSValueAll) {
</span><del>- animation->setAnimationMode(Animation::AnimateAll);
- animation->setProperty(CSSPropertyInvalid);
</del><ins>+ animation.setAnimationMode(Animation::AnimateAll);
+ animation.setProperty(CSSPropertyInvalid);
</ins><span class="cx"> } else if (primitiveValue.getValueID() == CSSValueNone) {
</span><del>- animation->setAnimationMode(Animation::AnimateNone);
- animation->setProperty(CSSPropertyInvalid);
</del><ins>+ animation.setAnimationMode(Animation::AnimateNone);
+ animation.setProperty(CSSPropertyInvalid);
</ins><span class="cx"> } else {
</span><del>- animation->setAnimationMode(Animation::AnimateSingleProperty);
- animation->setProperty(primitiveValue.getPropertyID());
</del><ins>+ animation.setAnimationMode(Animation::AnimateSingleProperty);
+ animation.setProperty(primitiveValue.getPropertyID());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSToStyleMap::mapAnimationTimingFunction(Animation* animation, CSSValue& value)
</del><ins>+void CSSToStyleMap::mapAnimationTimingFunction(Animation& animation, CSSValue& value)
</ins><span class="cx"> {
</span><span class="cx"> if (value.isInitialValue()) {
</span><del>- animation->setTimingFunction(Animation::initialAnimationTimingFunction());
</del><ins>+ animation.setTimingFunction(Animation::initialTimingFunction());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (is<CSSPrimitiveValue>(value)) {
</span><span class="cx"> switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
</span><span class="cx"> case CSSValueLinear:
</span><del>- animation->setTimingFunction(LinearTimingFunction::create());
</del><ins>+ animation.setTimingFunction(LinearTimingFunction::create());
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueEase:
</span><del>- animation->setTimingFunction(CubicBezierTimingFunction::create());
</del><ins>+ animation.setTimingFunction(CubicBezierTimingFunction::create());
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueEaseIn:
</span><del>- animation->setTimingFunction(CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseIn));
</del><ins>+ animation.setTimingFunction(CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseIn));
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueEaseOut:
</span><del>- animation->setTimingFunction(CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseOut));
</del><ins>+ animation.setTimingFunction(CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseOut));
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueEaseInOut:
</span><del>- animation->setTimingFunction(CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseInOut));
</del><ins>+ animation.setTimingFunction(CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseInOut));
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueStepStart:
</span><del>- animation->setTimingFunction(StepsTimingFunction::create(1, true));
</del><ins>+ animation.setTimingFunction(StepsTimingFunction::create(1, true));
</ins><span class="cx"> break;
</span><span class="cx"> case CSSValueStepEnd:
</span><del>- animation->setTimingFunction(StepsTimingFunction::create(1, false));
</del><ins>+ animation.setTimingFunction(StepsTimingFunction::create(1, false));
</ins><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="lines">@@ -517,10 +517,10 @@
</span><span class="cx">
</span><span class="cx"> if (is<CSSCubicBezierTimingFunctionValue>(value)) {
</span><span class="cx"> auto& cubicTimingFunction = downcast<CSSCubicBezierTimingFunctionValue>(value);
</span><del>- animation->setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction.x1(), cubicTimingFunction.y1(), cubicTimingFunction.x2(), cubicTimingFunction.y2()));
</del><ins>+ animation.setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction.x1(), cubicTimingFunction.y1(), cubicTimingFunction.x2(), cubicTimingFunction.y2()));
</ins><span class="cx"> } else if (is<CSSStepsTimingFunctionValue>(value)) {
</span><span class="cx"> auto& stepsTimingFunction = downcast<CSSStepsTimingFunctionValue>(value);
</span><del>- animation->setTimingFunction(StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepAtStart()));
</del><ins>+ animation.setTimingFunction(StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepAtStart()));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToStyleMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToStyleMap.h (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToStyleMap.h        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/css/CSSToStyleMap.h        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -58,15 +58,15 @@
</span><span class="cx"> void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*);
</span><span class="cx"> void mapFillMaskSourceType(CSSPropertyID, FillLayer*, CSSValue*);
</span><span class="cx">
</span><del>- void mapAnimationDelay(Animation*, CSSValue&);
- void mapAnimationDirection(Animation*, CSSValue&);
- void mapAnimationDuration(Animation*, CSSValue&);
- void mapAnimationFillMode(Animation*, CSSValue&);
- void mapAnimationIterationCount(Animation*, CSSValue&);
- void mapAnimationName(Animation*, CSSValue&);
- void mapAnimationPlayState(Animation*, CSSValue&);
- void mapAnimationProperty(Animation*, CSSValue&);
- void mapAnimationTimingFunction(Animation*, CSSValue&);
</del><ins>+ void mapAnimationDelay(Animation&, CSSValue&);
+ void mapAnimationDirection(Animation&, CSSValue&);
+ void mapAnimationDuration(Animation&, CSSValue&);
+ void mapAnimationFillMode(Animation&, CSSValue&);
+ void mapAnimationIterationCount(Animation&, CSSValue&);
+ void mapAnimationName(Animation&, CSSValue&);
+ void mapAnimationPlayState(Animation&, CSSValue&);
+ void mapAnimationProperty(Animation&, CSSValue&);
+ void mapAnimationTimingFunction(Animation&, CSSValue&);
</ins><span class="cx">
</span><span class="cx"> void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&);
</span><span class="cx"> void mapNinePieceImageSlice(CSSValue&, NinePieceImage&);
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -393,82 +393,6 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-template <typename T,
- T (Animation::*getterFunction)() const,
- void (Animation::*setterFunction)(T),
- bool (Animation::*testFunction)() const,
- void (Animation::*clearFunction)(),
- T (*initialFunction)(),
- void (CSSToStyleMap::*mapFunction)(Animation*, CSSValue&),
- AnimationList* (RenderStyle::*animationGetterFunction)(),
- const AnimationList* (RenderStyle::*immutableAnimationGetterFunction)() const>
-class ApplyPropertyAnimation {
-public:
- static void setValue(Animation& animation, T value) { (animation.*setterFunction)(value); }
- static T value(const Animation& animation) { return (animation.*getterFunction)(); }
- static bool test(const Animation& animation) { return (animation.*testFunction)(); }
- static void clear(Animation& animation) { (animation.*clearFunction)(); }
- static T initial() { return (*initialFunction)(); }
- static void map(StyleResolver* styleResolver, Animation& animation, CSSValue& value) { (styleResolver->styleMap()->*mapFunction)(&animation, value); }
- static AnimationList* accessAnimations(RenderStyle* style) { return (style->*animationGetterFunction)(); }
- static const AnimationList* animations(RenderStyle* style) { return (style->*immutableAnimationGetterFunction)(); }
-
- static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- AnimationList* list = accessAnimations(styleResolver->style());
- const AnimationList* parentList = animations(styleResolver->parentStyle());
- size_t i = 0, parentSize = parentList ? parentList->size() : 0;
- for ( ; i < parentSize && test(parentList->animation(i)); ++i) {
- if (list->size() <= i)
- list->append(Animation::create());
- setValue(list->animation(i), value(parentList->animation(i)));
- list->animation(i).setAnimationMode(parentList->animation(i).animationMode());
- }
-
- /* Reset any remaining animations to not have the property set. */
- for ( ; i < list->size(); ++i)
- clear(list->animation(i));
- }
-
- static void applyInitialValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
- {
- AnimationList* list = accessAnimations(styleResolver->style());
- if (list->isEmpty())
- list->append(Animation::create());
- setValue(list->animation(0), initial());
- if (propertyID == CSSPropertyWebkitTransitionProperty)
- list->animation(0).setAnimationMode(Animation::AnimateAll);
- for (size_t i = 1; i < list->size(); ++i)
- clear(list->animation(i));
- }
-
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- AnimationList* list = accessAnimations(styleResolver->style());
- size_t childIndex = 0;
- if (is<CSSValueList>(*value)) {
- /* Walk each value and put it into an animation, creating new animations as needed. */
- for (auto& currentValue : downcast<CSSValueList>(*value)) {
- if (childIndex <= list->size())
- list->append(Animation::create());
- map(styleResolver, list->animation(childIndex), currentValue);
- ++childIndex;
- }
- } else {
- if (list->isEmpty())
- list->append(Animation::create());
- map(styleResolver, list->animation(childIndex), *value);
- childIndex = 1;
- }
- for ( ; childIndex < list->size(); ++childIndex) {
- /* Reset all remaining animations to not have the property set. */
- clear(list->animation(childIndex));
- }
- }
-
- static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
-};
-
</del><span class="cx"> const DeprecatedStyleBuilder& DeprecatedStyleBuilder::sharedStyleBuilder()
</span><span class="cx"> {
</span><span class="cx"> static NeverDestroyed<DeprecatedStyleBuilder> styleBuilderInstance;
</span><span class="lines">@@ -496,23 +420,6 @@
</span><span class="cx"> setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
</span><span class="cx">
</span><del>- setPropertyHandler(CSSPropertyAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSToStyleMap::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSToStyleMap::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSToStyleMap::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSToStyleMap::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
-
- setPropertyHandler(CSSPropertyWebkitAnimationDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationDirection, ApplyPropertyAnimation<Animation::AnimationDirection, &Animation::direction, &Animation::setDirection, &Animation::isDirectionSet, &Animation::clearDirection, &Animation::initialAnimationDirection, &CSSToStyleMap::mapAnimationDirection, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationFillMode, ApplyPropertyAnimation<unsigned, &Animation::fillMode, &Animation::setFillMode, &Animation::isFillModeSet, &Animation::clearFillMode, &Animation::initialAnimationFillMode, &CSSToStyleMap::mapAnimationFillMode, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationIterationCount, ApplyPropertyAnimation<double, &Animation::iterationCount, &Animation::setIterationCount, &Animation::isIterationCountSet, &Animation::clearIterationCount, &Animation::initialAnimationIterationCount, &CSSToStyleMap::mapAnimationIterationCount, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationName, ApplyPropertyAnimation<const String&, &Animation::name, &Animation::setName, &Animation::isNameSet, &Animation::clearName, &Animation::initialAnimationName, &CSSToStyleMap::mapAnimationName, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationPlayState, ApplyPropertyAnimation<EAnimPlayState, &Animation::playState, &Animation::setPlayState, &Animation::isPlayStateSet, &Animation::clearPlayState, &Animation::initialAnimationPlayState, &CSSToStyleMap::mapAnimationPlayState, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
- setPropertyHandler(CSSPropertyWebkitAnimationTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessAnimations, &RenderStyle::animations>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitBackgroundClip, CSSPropertyBackgroundClip);
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
</span><span class="lines">@@ -529,10 +436,6 @@
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitMaskRepeatY, ApplyPropertyFillLayer<EFillRepeat, CSSPropertyWebkitMaskRepeatY, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isRepeatYSet, &FillLayer::repeatY, &FillLayer::setRepeatY, &FillLayer::clearRepeatY, &FillLayer::initialFillRepeatY, &CSSToStyleMap::mapFillRepeatY>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitMaskSize, ApplyPropertyFillLayer<FillSize, CSSPropertyWebkitMaskSize, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isSizeSet, &FillLayer::size, &FillLayer::setSize, &FillLayer::clearSize, &FillLayer::initialFillSize, &CSSToStyleMap::mapFillSize>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitMaskSourceType, ApplyPropertyFillLayer<EMaskSourceType, CSSPropertyWebkitMaskSourceType, MaskFillLayer, &RenderStyle::accessMaskLayers, &RenderStyle::maskLayers, &FillLayer::isMaskSourceTypeSet, &FillLayer::maskSourceType, &FillLayer::setMaskSourceType, &FillLayer::clearMaskSourceType, &FillLayer::initialMaskSourceType, &CSSToStyleMap::mapFillMaskSourceType>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSToStyleMap::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
- setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssmakeproppl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/makeprop.pl (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeprop.pl        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/css/makeprop.pl        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -43,7 +43,8 @@
</span><span class="cx"> my %nameIsInherited;
</span><span class="cx"> my %propertiesWithStyleBuilderOptions;
</span><span class="cx"> my %styleBuilderOptions = (
</span><del>- AutoFunctions => 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
</del><ins>+ AnimationProperty => 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
+ AutoFunctions => 1,
</ins><span class="cx"> Converter => 1,
</span><span class="cx"> Custom => 1,
</span><span class="cx"> Getter => 1,
</span><span class="lines">@@ -372,6 +373,40 @@
</span><span class="cx"> return $renderStyle . "->setVisitedLink" . getNameForMethods($name);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub getAnimationClearMethod {
+ my $name = shift;
+
+ return "clear" . getNameForMethods($name);
+}
+
+sub getEnsureAnimationsOrTransitionsMethod {
+ my $name = shift;
+
+ return "ensureAnimations" if $name =~ /animation-/;
+ return "ensureTransitions" if $name =~ /transition-/;
+ die "Unrecognized animation property name.";
+}
+
+sub getAnimationsOrTransitionsMethod {
+ my $name = shift;
+
+ return "animations" if $name =~ /animation-/;
+ return "transitions" if $name =~ /transition-/;
+ die "Unrecognized animation property name.";
+}
+
+sub getAnimationTestMethod {
+ my $name = shift;
+
+ return "is" . getNameForMethods($name) . "Set";
+}
+
+sub getAnimationMapfunction {
+ my $name = shift;
+
+ return "mapAnimation" . getNameForMethods($name);
+}
+
</ins><span class="cx"> foreach my $name (@names) {
</span><span class="cx"> # Skip properties still using the legacy style builder.
</span><span class="cx"> next unless exists($propertiesWithStyleBuilderOptions{$name});
</span><span class="lines">@@ -450,6 +485,79 @@
</span><span class="cx"> return $code;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub generateAnimationPropertyInitialValueSetter {
+ my $name = shift;
+ my $indent = shift;
+
+ my $setterContent = "";
+ $setterContent .= $indent . "AnimationList& list = styleResolver.style()->" . getEnsureAnimationsOrTransitionsMethod($name) . "();\n";
+ $setterContent .= $indent . "if (list.isEmpty())\n";
+ $setterContent .= $indent . " list.append(Animation::create());\n";
+ my $setter = $propertiesWithStyleBuilderOptions{$name}{"Setter"};
+ my $initial = $propertiesWithStyleBuilderOptions{$name}{"Initial"};
+ $setterContent .= $indent . "list.animation(0)." . $setter . "(Animation::" . $initial . "());\n";
+ if ($name eq "-webkit-transition-property") {
+ $setterContent .= $indent . "list.animation(0).setAnimationMode(Animation::AnimateAll);\n";
+ }
+ $setterContent .= $indent . "for (size_t i = 1; i < list.size(); ++i)\n";
+ $setterContent .= $indent . " list.animation(i)." . getAnimationClearMethod($name) . "();\n";
+
+ return $setterContent;
+}
+
+sub generateAnimationPropertyInheritValueSetter {
+ my $name = shift;
+ my $indent = shift;
+
+ my $setterContent = "";
+ $setterContent .= $indent . "AnimationList& list = styleResolver.style()->" . getEnsureAnimationsOrTransitionsMethod($name) . "();\n";
+ $setterContent .= $indent . "const AnimationList* parentList = styleResolver.parentStyle()->" . getAnimationsOrTransitionsMethod($name) . "();\n";
+ $setterContent .= $indent . "size_t i = 0, parentSize = parentList ? parentList->size() : 0;\n";
+ $setterContent .= $indent . "for ( ; i < parentSize && parentList->animation(i)." . getAnimationTestMethod($name) . "(); ++i) {\n";
+ $setterContent .= $indent . " if (list.size() <= i)\n";
+ $setterContent .= $indent . " list.append(Animation::create());\n";
+ my $getter = $propertiesWithStyleBuilderOptions{$name}{"Getter"};
+ my $setter = $propertiesWithStyleBuilderOptions{$name}{"Setter"};
+ $setterContent .= $indent . " list.animation(i)." . $setter . "(parentList->animation(i)." . $getter . "());\n";
+ $setterContent .= $indent . " list.animation(i).setAnimationMode(parentList->animation(i).animationMode());\n";
+ $setterContent .= $indent . "}\n";
+ $setterContent .= "\n";
+ $setterContent .= $indent . "/* Reset any remaining animations to not have the property set. */\n";
+ $setterContent .= $indent . "for ( ; i < list.size(); ++i)\n";
+ $setterContent .= $indent . " list.animation(i)." . getAnimationClearMethod($name) . "();\n";
+
+ return $setterContent;
+}
+
+sub generateAnimationPropertyValueSetter {
+ my $name = shift;
+ my $indent = shift;
+
+ my $setterContent = "";
+ $setterContent .= $indent . "AnimationList& list = styleResolver.style()->" . getEnsureAnimationsOrTransitionsMethod($name) . "();\n";
+ $setterContent .= $indent . "size_t childIndex = 0;\n";
+ $setterContent .= $indent . "if (is<CSSValueList>(value)) {\n";
+ $setterContent .= $indent . " /* Walk each value and put it into an animation, creating new animations as needed. */\n";
+ $setterContent .= $indent . " for (auto& currentValue : downcast<CSSValueList>(value)) {\n";
+ $setterContent .= $indent . " if (childIndex <= list.size())\n";
+ $setterContent .= $indent . " list.append(Animation::create());\n";
+ $setterContent .= $indent . " styleResolver.styleMap()->" . getAnimationMapfunction($name) . "(list.animation(childIndex), currentValue);\n";
+ $setterContent .= $indent . " ++childIndex;\n";
+ $setterContent .= $indent . " }\n";
+ $setterContent .= $indent . "} else {\n";
+ $setterContent .= $indent . " if (list.isEmpty())\n";
+ $setterContent .= $indent . " list.append(Animation::create());\n";
+ $setterContent .= $indent . " styleResolver.styleMap()->" . getAnimationMapfunction($name) . "(list.animation(childIndex), value);\n";
+ $setterContent .= $indent . " childIndex = 1;\n";
+ $setterContent .= $indent . "}\n";
+ $setterContent .= $indent . "for ( ; childIndex < list.size(); ++childIndex) {\n";
+ $setterContent .= $indent . " /* Reset all remaining animations to not have the property set. */\n";
+ $setterContent .= $indent . " list.animation(childIndex)." . getAnimationClearMethod($name) . "();\n";
+ $setterContent .= $indent . "}\n";
+
+ return $setterContent;
+}
+
</ins><span class="cx"> sub generateInitialValueSetter {
</span><span class="cx"> my $name = shift;
</span><span class="cx"> my $indent = shift;
</span><span class="lines">@@ -463,6 +571,8 @@
</span><span class="cx"> } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"VisitedLinkColorSupport"}) {
</span><span class="cx"> my $initialColor = "RenderStyle::" . $propertiesWithStyleBuilderOptions{$name}{"Initial"} . "()";
</span><span class="cx"> $setterContent .= generateColorValueSetter($name, $initialColor, $indent . " ");
</span><ins>+ } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"AnimationProperty"}) {
+ $setterContent .= generateAnimationPropertyInitialValueSetter($name, $indent . " ");
</ins><span class="cx"> } else {
</span><span class="cx"> my $setValue = $style . "->" . $propertiesWithStyleBuilderOptions{$name}{"Setter"};
</span><span class="cx"> $setterContent .= $indent . " " . $setValue . "(RenderStyle::" . $propertiesWithStyleBuilderOptions{$name}{"Initial"} . "());\n";
</span><span class="lines">@@ -496,6 +606,9 @@
</span><span class="cx"> }
</span><span class="cx"> $setterContent .= generateColorValueSetter($name, "color", $indent . " ");
</span><span class="cx"> $didCallSetValue = 1;
</span><ins>+ } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"AnimationProperty"}) {
+ $setterContent .= generateAnimationPropertyInheritValueSetter($name, $indent . " ");
+ $didCallSetValue = 1;
</ins><span class="cx"> }
</span><span class="cx"> if (!$didCallSetValue) {
</span><span class="cx"> my $inheritedValue = $parentStyle . "->" . $propertiesWithStyleBuilderOptions{$name}{"Getter"} . "()";
</span><span class="lines">@@ -535,6 +648,9 @@
</span><span class="cx"> }
</span><span class="cx"> $setterContent .= generateColorValueSetter($name, "primitiveValue", $indent . " ", VALUE_IS_PRIMITIVE);
</span><span class="cx"> $didCallSetValue = 1;
</span><ins>+ } elsif (exists $propertiesWithStyleBuilderOptions{$name}{"AnimationProperty"}) {
+ $setterContent .= generateAnimationPropertyValueSetter($name, $indent . " ");
+ $didCallSetValue = 1;
</ins><span class="cx"> }
</span><span class="cx"> if (!$didCallSetValue) {
</span><span class="cx"> my $setValue = $style . "->" . $propertiesWithStyleBuilderOptions{$name}{"Setter"};
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformanimationAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/animation/Animation.cpp (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/animation/Animation.cpp        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/platform/animation/Animation.cpp        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -25,16 +25,16 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> Animation::Animation()
</span><del>- : m_name(initialAnimationName())
</del><ins>+ : m_name(initialName())
</ins><span class="cx"> , m_property(CSSPropertyInvalid)
</span><span class="cx"> , m_mode(AnimateAll)
</span><del>- , m_iterationCount(initialAnimationIterationCount())
- , m_delay(initialAnimationDelay())
- , m_duration(initialAnimationDuration())
- , m_timingFunction(initialAnimationTimingFunction())
- , m_direction(initialAnimationDirection())
- , m_fillMode(initialAnimationFillMode())
- , m_playState(initialAnimationPlayState())
</del><ins>+ , m_iterationCount(initialIterationCount())
+ , m_delay(initialDelay())
+ , m_duration(initialDuration())
+ , m_timingFunction(initialTimingFunction())
+ , m_direction(initialDirection())
+ , m_fillMode(initialFillMode())
+ , m_playState(initialPlayState())
</ins><span class="cx"> , m_delaySet(false)
</span><span class="cx"> , m_directionSet(false)
</span><span class="cx"> , m_durationSet(false)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> return !matchPlayStates || (m_playState == o->m_playState && m_playStateSet == o->m_playStateSet);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const String& Animation::initialAnimationName()
</del><ins>+const String& Animation::initialName()
</ins><span class="cx"> {
</span><span class="cx"> DEPRECATED_DEFINE_STATIC_LOCAL(String, initialValue, (ASCIILiteral("none")));
</span><span class="cx"> return initialValue;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformanimationAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/animation/Animation.h (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/animation/Animation.h        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/platform/animation/Animation.h        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -175,15 +175,15 @@
</span><span class="cx"> bool m_isNone : 1;
</span><span class="cx">
</span><span class="cx"> public:
</span><del>- static double initialAnimationDelay() { return 0; }
- static AnimationDirection initialAnimationDirection() { return AnimationDirectionNormal; }
- static double initialAnimationDuration() { return 0; }
- static unsigned initialAnimationFillMode() { return AnimationFillModeNone; }
- static double initialAnimationIterationCount() { return 1.0; }
- static const String& initialAnimationName();
- static EAnimPlayState initialAnimationPlayState() { return AnimPlayStatePlaying; }
- static CSSPropertyID initialAnimationProperty() { return CSSPropertyInvalid; }
- static const PassRefPtr<TimingFunction> initialAnimationTimingFunction() { return CubicBezierTimingFunction::create(); }
</del><ins>+ static double initialDelay() { return 0; }
+ static AnimationDirection initialDirection() { return AnimationDirectionNormal; }
+ static double initialDuration() { return 0; }
+ static unsigned initialFillMode() { return AnimationFillModeNone; }
+ static double initialIterationCount() { return 1.0; }
+ static const String& initialName();
+ static EAnimPlayState initialPlayState() { return AnimPlayStatePlaying; }
+ static CSSPropertyID initialProperty() { return CSSPropertyInvalid; }
+ static const PassRefPtr<TimingFunction> initialTimingFunction() { return CubicBezierTimingFunction::create(); }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -1313,18 +1313,18 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-AnimationList* RenderStyle::accessAnimations()
</del><ins>+AnimationList& RenderStyle::ensureAnimations()
</ins><span class="cx"> {
</span><span class="cx"> if (!rareNonInheritedData.access()->m_animations)
</span><span class="cx"> rareNonInheritedData.access()->m_animations = std::make_unique<AnimationList>();
</span><del>- return rareNonInheritedData->m_animations.get();
</del><ins>+ return *rareNonInheritedData->m_animations;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-AnimationList* RenderStyle::accessTransitions()
</del><ins>+AnimationList& RenderStyle::ensureTransitions()
</ins><span class="cx"> {
</span><span class="cx"> if (!rareNonInheritedData.access()->m_transitions)
</span><span class="cx"> rareNonInheritedData.access()->m_transitions = std::make_unique<AnimationList>();
</span><del>- return rareNonInheritedData->m_transitions.get();
</del><ins>+ return *rareNonInheritedData->m_transitions;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const Animation* RenderStyle::transitionForProperty(CSSPropertyID property) const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (177820 => 177821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-12-30 02:59:25 UTC (rev 177820)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-12-30 04:39:59 UTC (rev 177821)
</span><span class="lines">@@ -1050,8 +1050,8 @@
</span><span class="cx"> const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); }
</span><span class="cx"> const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
</span><span class="cx">
</span><del>- AnimationList* accessAnimations();
- AnimationList* accessTransitions();
</del><ins>+ AnimationList& ensureAnimations();
+ AnimationList& ensureTransitions();
</ins><span class="cx">
</span><span class="cx"> bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; }
</span><span class="cx"> bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; }
</span></span></pre>
</div>
</div>
</body>
</html>