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

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: Address review feedback 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
« no previous file with comments | « Source/core/core.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20 matching lines...) Expand all
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/AnimatableClipPathOperation.h" 34 #include "core/animation/AnimatableClipPathOperation.h"
35 #include "core/animation/AnimatableColor.h" 35 #include "core/animation/AnimatableColor.h"
36 #include "core/animation/AnimatableDouble.h" 36 #include "core/animation/AnimatableDouble.h"
37 #include "core/animation/AnimatableImage.h" 37 #include "core/animation/AnimatableImage.h"
38 #include "core/animation/AnimatableLength.h" 38 #include "core/animation/AnimatableLength.h"
39 #include "core/animation/AnimatableLengthBox.h" 39 #include "core/animation/AnimatableLengthBox.h"
40 #include "core/animation/AnimatableLengthSize.h" 40 #include "core/animation/AnimatableLengthSize.h"
41 #include "core/animation/AnimatableSVGPaint.h"
41 #include "core/animation/AnimatableShapeValue.h" 42 #include "core/animation/AnimatableShapeValue.h"
42 #include "core/animation/AnimatableTransform.h" 43 #include "core/animation/AnimatableTransform.h"
43 #include "core/animation/AnimatableUnknown.h" 44 #include "core/animation/AnimatableUnknown.h"
44 #include "core/animation/AnimatableValue.h" 45 #include "core/animation/AnimatableValue.h"
45 #include "core/animation/AnimatableVisibility.h" 46 #include "core/animation/AnimatableVisibility.h"
46 #include "core/animation/css/CSSAnimations.h" 47 #include "core/animation/css/CSSAnimations.h"
47 #include "core/css/CSSPrimitiveValueMappings.h" 48 #include "core/css/CSSPrimitiveValueMappings.h"
48 #include "core/css/resolver/StyleBuilder.h" 49 #include "core/css/resolver/StyleBuilder.h"
49 #include "core/css/resolver/StyleResolverState.h" 50 #include "core/css/resolver/StyleResolverState.h"
50 #include "core/rendering/style/RenderStyle.h" 51 #include "core/rendering/style/RenderStyle.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 case CSSPropertyClip: 163 case CSSPropertyClip:
163 style->setClip(animatableValueToLengthBox(value, state)); 164 style->setClip(animatableValueToLengthBox(value, state));
164 return; 165 return;
165 case CSSPropertyColor: 166 case CSSPropertyColor:
166 style->setColor(toAnimatableColor(value)->color()); 167 style->setColor(toAnimatableColor(value)->color());
167 style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor()) ; 168 style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor()) ;
168 return; 169 return;
169 case CSSPropertyFillOpacity: 170 case CSSPropertyFillOpacity:
170 style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble (), 0, 1)); 171 style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble (), 0, 1));
171 return; 172 return;
173 case CSSPropertyFill:
174 {
175 const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
176 style->accessSVGStyle()->setFillPaint(svgPaint->paintType(), svgPain t->color(), svgPaint->uri());
177 }
178 return;
172 case CSSPropertyHeight: 179 case CSSPropertyHeight:
173 style->setHeight(animatableValueToLength(value, state)); 180 style->setHeight(animatableValueToLength(value, state));
174 return; 181 return;
175 case CSSPropertyLeft: 182 case CSSPropertyLeft:
176 style->setLeft(animatableValueToLength(value, state)); 183 style->setLeft(animatableValueToLength(value, state));
177 return; 184 return;
178 case CSSPropertyListStyleImage: 185 case CSSPropertyListStyleImage:
179 style->setListStyleImage(toAnimatableImage(value)->toStyleImage()); 186 style->setListStyleImage(toAnimatableImage(value)->toStyleImage());
180 return; 187 return;
181 case CSSPropertyLetterSpacing: 188 case CSSPropertyLetterSpacing:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return; 236 return;
230 case CSSPropertyPaddingTop: 237 case CSSPropertyPaddingTop:
231 style->setPaddingTop(animatableValueToLength(value, state)); 238 style->setPaddingTop(animatableValueToLength(value, state));
232 return; 239 return;
233 case CSSPropertyRight: 240 case CSSPropertyRight:
234 style->setRight(animatableValueToLength(value, state)); 241 style->setRight(animatableValueToLength(value, state));
235 return; 242 return;
236 case CSSPropertyStrokeOpacity: 243 case CSSPropertyStrokeOpacity:
237 style->setStrokeOpacity(clampTo<float>(toAnimatableDouble(value)->toDoub le(), 0, 1)); 244 style->setStrokeOpacity(clampTo<float>(toAnimatableDouble(value)->toDoub le(), 0, 1));
238 return; 245 return;
246 case CSSPropertyStroke:
247 {
248 const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value);
249 style->accessSVGStyle()->setStrokePaint(svgPaint->paintType(), svgPa int->color(), svgPaint->uri());
250 }
251 return;
239 case CSSPropertyTextDecorationColor: 252 case CSSPropertyTextDecorationColor:
240 style->setTextDecorationColor(toAnimatableColor(value)->color()); 253 style->setTextDecorationColor(toAnimatableColor(value)->color());
241 style->setVisitedLinkTextDecorationColor(toAnimatableColor(value)->visit edLinkColor()); 254 style->setVisitedLinkTextDecorationColor(toAnimatableColor(value)->visit edLinkColor());
242 return; 255 return;
243 case CSSPropertyTextIndent: 256 case CSSPropertyTextIndent:
244 style->setTextIndent(animatableValueToLength(value, state)); 257 style->setTextIndent(animatableValueToLength(value, state));
245 return; 258 return;
246 case CSSPropertyTop: 259 case CSSPropertyTop:
247 style->setTop(animatableValueToLength(value, state)); 260 style->setTop(animatableValueToLength(value, state));
248 return; 261 return;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 case CSSPropertyZIndex: 329 case CSSPropertyZIndex:
317 style->setZIndex(animatableValueRoundClampTo<int>(value)); 330 style->setZIndex(animatableValueRoundClampTo<int>(value));
318 return; 331 return;
319 default: 332 default:
320 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()); 333 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());
321 ASSERT_NOT_REACHED(); 334 ASSERT_NOT_REACHED();
322 } 335 }
323 } 336 }
324 337
325 } // namespace WebCore 338 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698