Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: Source/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 25456002: Web Animations CSS: Support animation of fill and stroke (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/css/resolver/AnimatedStyleBuilder.h" 32 #include "core/css/resolver/AnimatedStyleBuilder.h"
33 33
34 #include "core/animation/AnimatableColor.h" 34 #include "core/animation/AnimatableColor.h"
35 #include "core/animation/AnimatableImage.h" 35 #include "core/animation/AnimatableImage.h"
36 #include "core/animation/AnimatableLengthBox.h" 36 #include "core/animation/AnimatableLengthBox.h"
37 #include "core/animation/AnimatableLengthSize.h" 37 #include "core/animation/AnimatableLengthSize.h"
38 #include "core/animation/AnimatableNumber.h" 38 #include "core/animation/AnimatableNumber.h"
39 #include "core/animation/AnimatableSVGPaint.h"
39 #include "core/animation/AnimatableTransform.h" 40 #include "core/animation/AnimatableTransform.h"
40 #include "core/animation/AnimatableUnknown.h" 41 #include "core/animation/AnimatableUnknown.h"
41 #include "core/animation/AnimatableValue.h" 42 #include "core/animation/AnimatableValue.h"
42 #include "core/animation/AnimatableVisibility.h" 43 #include "core/animation/AnimatableVisibility.h"
43 #include "core/animation/css/CSSAnimations.h" 44 #include "core/animation/css/CSSAnimations.h"
44 #include "core/css/CSSPrimitiveValueMappings.h" 45 #include "core/css/CSSPrimitiveValueMappings.h"
45 #include "core/css/resolver/StyleBuilder.h" 46 #include "core/css/resolver/StyleBuilder.h"
46 #include "core/css/resolver/StyleResolverState.h" 47 #include "core/css/resolver/StyleResolverState.h"
47 #include "core/rendering/style/RenderStyle.h" 48 #include "core/rendering/style/RenderStyle.h"
48 #include "wtf/MathExtras.h" 49 #include "wtf/MathExtras.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 case CSSPropertyBottom: 157 case CSSPropertyBottom:
157 style->setBottom(animatableValueToLength(value, state)); 158 style->setBottom(animatableValueToLength(value, state));
158 return; 159 return;
159 case CSSPropertyClip: 160 case CSSPropertyClip:
160 style->setClip(animatableValueToLengthBox(value, state)); 161 style->setClip(animatableValueToLengthBox(value, state));
161 return; 162 return;
162 case CSSPropertyColor: 163 case CSSPropertyColor:
163 style->setColor(toAnimatableColor(value)->color()); 164 style->setColor(toAnimatableColor(value)->color());
164 style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor()) ; 165 style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor()) ;
165 return; 166 return;
167 case CSSPropertyFill:
168 {
169 const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
170 style->accessSVGStyle()->setFillPaint(svgPaint->paintType(), svgPain t->color(), svgPaint->uri());
171 }
172 return;
166 case CSSPropertyHeight: 173 case CSSPropertyHeight:
167 style->setHeight(animatableValueToLength(value, state)); 174 style->setHeight(animatableValueToLength(value, state));
168 return; 175 return;
169 case CSSPropertyLeft: 176 case CSSPropertyLeft:
170 style->setLeft(animatableValueToLength(value, state)); 177 style->setLeft(animatableValueToLength(value, state));
171 return; 178 return;
172 case CSSPropertyListStyleImage: 179 case CSSPropertyListStyleImage:
173 style->setListStyleImage(toAnimatableImage(value)->toStyleImage()); 180 style->setListStyleImage(toAnimatableImage(value)->toStyleImage());
174 return; 181 return;
175 case CSSPropertyMarginBottom: 182 case CSSPropertyMarginBottom:
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return; 224 return;
218 case CSSPropertyPaddingRight: 225 case CSSPropertyPaddingRight:
219 style->setPaddingRight(animatableValueToLength(value, state)); 226 style->setPaddingRight(animatableValueToLength(value, state));
220 return; 227 return;
221 case CSSPropertyPaddingTop: 228 case CSSPropertyPaddingTop:
222 style->setPaddingTop(animatableValueToLength(value, state)); 229 style->setPaddingTop(animatableValueToLength(value, state));
223 return; 230 return;
224 case CSSPropertyRight: 231 case CSSPropertyRight:
225 style->setRight(animatableValueToLength(value, state)); 232 style->setRight(animatableValueToLength(value, state));
226 return; 233 return;
234 case CSSPropertyStroke:
235 {
236 const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
237 style->accessSVGStyle()->setStrokePaint(svgPaint->paintType(), svgPa int->color(), svgPaint->uri());
238 }
239 return;
227 case CSSPropertyTextDecorationColor: 240 case CSSPropertyTextDecorationColor:
228 style->setTextDecorationColor(toAnimatableColor(value)->color()); 241 style->setTextDecorationColor(toAnimatableColor(value)->color());
229 style->setVisitedLinkTextDecorationColor(toAnimatableColor(value)->visit edLinkColor()); 242 style->setVisitedLinkTextDecorationColor(toAnimatableColor(value)->visit edLinkColor());
230 return; 243 return;
231 case CSSPropertyTextIndent: 244 case CSSPropertyTextIndent:
232 style->setTextIndent(animatableValueToLength(value, state)); 245 style->setTextIndent(animatableValueToLength(value, state));
233 return; 246 return;
234 case CSSPropertyTop: 247 case CSSPropertyTop:
235 style->setTop(animatableValueToLength(value, state)); 248 style->setTop(animatableValueToLength(value, state));
236 return; 249 return;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 case CSSPropertyZIndex: 308 case CSSPropertyZIndex:
296 style->setZIndex(animatableValueRoundClampTo<int>(value)); 309 style->setZIndex(animatableValueRoundClampTo<int>(value));
297 return; 310 return;
298 default: 311 default:
299 RELEASE_ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(propert y), "Web Animations not yet implemented: Unable to apply AnimatableValue to Rend erStyle: %s", getPropertyNameString(property).utf8().data()); 312 RELEASE_ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(propert y), "Web Animations not yet implemented: Unable to apply AnimatableValue to Rend erStyle: %s", getPropertyNameString(property).utf8().data());
300 ASSERT_NOT_REACHED(); 313 ASSERT_NOT_REACHED();
301 } 314 }
302 } 315 }
303 316
304 } // namespace WebCore 317 } // namespace WebCore
OLDNEW
« Source/core/animation/AnimatableSVGPaint.cpp ('K') | « Source/core/core.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698