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

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

Issue 454423003: Add animatable flag to CSSProperties.in (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/css/CSSPropertyMetadata.h ('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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "core/animation/animatable/AnimatableRepeatable.h" 45 #include "core/animation/animatable/AnimatableRepeatable.h"
46 #include "core/animation/animatable/AnimatableSVGLength.h" 46 #include "core/animation/animatable/AnimatableSVGLength.h"
47 #include "core/animation/animatable/AnimatableSVGPaint.h" 47 #include "core/animation/animatable/AnimatableSVGPaint.h"
48 #include "core/animation/animatable/AnimatableShadow.h" 48 #include "core/animation/animatable/AnimatableShadow.h"
49 #include "core/animation/animatable/AnimatableShapeValue.h" 49 #include "core/animation/animatable/AnimatableShapeValue.h"
50 #include "core/animation/animatable/AnimatableStrokeDasharrayList.h" 50 #include "core/animation/animatable/AnimatableStrokeDasharrayList.h"
51 #include "core/animation/animatable/AnimatableTransform.h" 51 #include "core/animation/animatable/AnimatableTransform.h"
52 #include "core/animation/animatable/AnimatableUnknown.h" 52 #include "core/animation/animatable/AnimatableUnknown.h"
53 #include "core/animation/animatable/AnimatableValue.h" 53 #include "core/animation/animatable/AnimatableValue.h"
54 #include "core/animation/animatable/AnimatableVisibility.h" 54 #include "core/animation/animatable/AnimatableVisibility.h"
55 #include "core/animation/css/CSSAnimations.h"
56 #include "core/css/CSSPrimitiveValueMappings.h" 55 #include "core/css/CSSPrimitiveValueMappings.h"
56 #include "core/css/CSSPropertyMetadata.h"
57 #include "core/css/resolver/StyleBuilder.h" 57 #include "core/css/resolver/StyleBuilder.h"
58 #include "core/css/resolver/StyleResolverState.h" 58 #include "core/css/resolver/StyleResolverState.h"
59 #include "core/rendering/style/RenderStyle.h" 59 #include "core/rendering/style/RenderStyle.h"
60 #include "wtf/MathExtras.h" 60 #include "wtf/MathExtras.h"
61 #include "wtf/TypeTraits.h" 61 #include "wtf/TypeTraits.h"
62 62
63 namespace blink { 63 namespace blink {
64 64
65 namespace { 65 namespace {
66 66
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 index = clampTo<int>(index, 0, WTF_ARRAY_LENGTH(weights) - 1); 247 index = clampTo<int>(index, 0, WTF_ARRAY_LENGTH(weights) - 1);
248 248
249 return weights[index]; 249 return weights[index];
250 } 250 }
251 251
252 } // namespace 252 } // namespace
253 253
254 // FIXME: Generate this function. 254 // FIXME: Generate this function.
255 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt ate& state, const AnimatableValue* value) 255 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt ate& state, const AnimatableValue* value)
256 { 256 {
257 ASSERT(CSSAnimations::isAnimatableProperty(property)); 257 ASSERT(CSSPropertyMetadata::isAnimatableProperty(property));
258 if (value->isUnknown()) { 258 if (value->isUnknown()) {
259 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)- >toCSSValue().get()); 259 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)- >toCSSValue().get());
260 return; 260 return;
261 } 261 }
262 RenderStyle* style = state.style(); 262 RenderStyle* style = state.style();
263 switch (property) { 263 switch (property) {
264 case CSSPropertyBackgroundColor: 264 case CSSPropertyBackgroundColor:
265 style->setBackgroundColor(toAnimatableColor(value)->color()); 265 style->setBackgroundColor(toAnimatableColor(value)->color());
266 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi nkColor()); 266 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi nkColor());
267 return; 267 return;
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 return; 613 return;
614 case CSSPropertyZoom: 614 case CSSPropertyZoom:
615 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std ::numeric_limits<float>::denorm_min())); 615 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std ::numeric_limits<float>::denorm_min()));
616 return; 616 return;
617 default: 617 default:
618 ASSERT_NOT_REACHED(); 618 ASSERT_NOT_REACHED();
619 } 619 }
620 } 620 }
621 621
622 } // namespace blink 622 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSPropertyMetadata.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698