OLD | NEW |
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "core/style/ComputedStyle.h" | 60 #include "core/style/ComputedStyle.h" |
61 #include "wtf/MathExtras.h" | 61 #include "wtf/MathExtras.h" |
62 | 62 |
63 #include <type_traits> | 63 #include <type_traits> |
64 | 64 |
65 namespace blink { | 65 namespace blink { |
66 | 66 |
67 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, | 67 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, |
68 ComputedStyle& style, | 68 ComputedStyle& style, |
69 const AnimatableValue* value) { | 69 const AnimatableValue* value) { |
70 ASSERT(CSSPropertyMetadata::isInterpolableProperty(property)); | 70 DCHECK(CSSPropertyMetadata::isInterpolableProperty(property)); |
71 switch (property) { | 71 switch (property) { |
72 case CSSPropertyOpacity: | 72 case CSSPropertyOpacity: |
73 // Avoiding a value of 1 forces a layer to be created. | 73 // Avoiding a value of 1 forces a layer to be created. |
74 style.setOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, | 74 style.setOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, |
75 nextafterf(1, 0))); | 75 nextafterf(1, 0))); |
76 return; | 76 return; |
77 case CSSPropertyTransform: { | 77 case CSSPropertyTransform: { |
78 const TransformOperations& operations = | 78 const TransformOperations& operations = |
79 toAnimatableTransform(value)->transformOperations(); | 79 toAnimatableTransform(value)->transformOperations(); |
80 // FIXME: This normalization (handling of 'none') should be performed at | 80 // FIXME: This normalization (handling of 'none') should be performed at |
(...skipping 12 matching lines...) Expand all Loading... |
93 case CSSPropertyFilter: | 93 case CSSPropertyFilter: |
94 style.setFilter(toAnimatableFilterOperations(value)->operations()); | 94 style.setFilter(toAnimatableFilterOperations(value)->operations()); |
95 return; | 95 return; |
96 | 96 |
97 default: | 97 default: |
98 NOTREACHED(); | 98 NOTREACHED(); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 } // namespace blink | 102 } // namespace blink |
OLD | NEW |