| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 auto iter = supportedAttributes.find(attributeName); | 183 auto iter = supportedAttributes.find(attributeName); |
| 184 if (iter == supportedAttributes.end() || !svgElement->propertyFromAttribute(
*iter->value)) | 184 if (iter == supportedAttributes.end() || !svgElement->propertyFromAttribute(
*iter->value)) |
| 185 return nullptr; | 185 return nullptr; |
| 186 | 186 |
| 187 return iter->value; | 187 return iter->value; |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace | 190 } // namespace |
| 191 | 191 |
| 192 PassRefPtrWillBeRawPtr<AnimationEffect> EffectInput::convert(Element* element, c
onst Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionStat
e) | 192 PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const
Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState) |
| 193 { | 193 { |
| 194 // FIXME: Remove the dependency on element. | 194 // FIXME: Remove the dependency on element. |
| 195 if (!element) | 195 if (!element) |
| 196 return nullptr; | 196 return nullptr; |
| 197 | 197 |
| 198 StyleSheetContents* styleSheetContents = element->document().elementSheet().
contents(); | 198 StyleSheetContents* styleSheetContents = element->document().elementSheet().
contents(); |
| 199 StringKeyframeVector keyframes; | 199 StringKeyframeVector keyframes; |
| 200 double lastOffset = 0; | 200 double lastOffset = 0; |
| 201 | 201 |
| 202 for (const auto& keyframeDictionary : keyframeDictionaryVector) { | 202 for (const auto& keyframeDictionary : keyframeDictionaryVector) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 226 | 226 |
| 227 lastOffset = offset; | 227 lastOffset = offset; |
| 228 | 228 |
| 229 keyframe->setOffset(offset); | 229 keyframe->setOffset(offset); |
| 230 } | 230 } |
| 231 keyframes.append(keyframe); | 231 keyframes.append(keyframe); |
| 232 | 232 |
| 233 String compositeString; | 233 String compositeString; |
| 234 DictionaryHelper::get(keyframeDictionary, "composite", compositeString); | 234 DictionaryHelper::get(keyframeDictionary, "composite", compositeString); |
| 235 if (compositeString == "add") | 235 if (compositeString == "add") |
| 236 keyframe->setComposite(AnimationEffect::CompositeAdd); | 236 keyframe->setComposite(EffectModel::CompositeAdd); |
| 237 | 237 |
| 238 String timingFunctionString; | 238 String timingFunctionString; |
| 239 if (DictionaryHelper::get(keyframeDictionary, "easing", timingFunctionSt
ring)) { | 239 if (DictionaryHelper::get(keyframeDictionary, "easing", timingFunctionSt
ring)) { |
| 240 if (RefPtr<TimingFunction> timingFunction = AnimationInputHelpers::p
arseTimingFunction(timingFunctionString)) | 240 if (RefPtr<TimingFunction> timingFunction = AnimationInputHelpers::p
arseTimingFunction(timingFunctionString)) |
| 241 keyframe->setEasing(timingFunction); | 241 keyframe->setEasing(timingFunction); |
| 242 } | 242 } |
| 243 | 243 |
| 244 Vector<String> keyframeProperties; | 244 Vector<String> keyframeProperties; |
| 245 keyframeDictionary.getPropertyNames(keyframeProperties); | 245 keyframeDictionary.getPropertyNames(keyframeProperties); |
| 246 for (const auto& property : keyframeProperties) { | 246 for (const auto& property : keyframeProperties) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 276 } | 276 } |
| 277 if (!keyframeEffectModel->isReplaceOnly()) { | 277 if (!keyframeEffectModel->isReplaceOnly()) { |
| 278 exceptionState.throwDOMException(NotSupportedError, "Additive animations
are not supported."); | 278 exceptionState.throwDOMException(NotSupportedError, "Additive animations
are not supported."); |
| 279 return nullptr; | 279 return nullptr; |
| 280 } | 280 } |
| 281 keyframeEffectModel->forceConversionsToAnimatableValues(*element, element->c
omputedStyle()); | 281 keyframeEffectModel->forceConversionsToAnimatableValues(*element, element->c
omputedStyle()); |
| 282 | 282 |
| 283 return keyframeEffectModel; | 283 return keyframeEffectModel; |
| 284 } | 284 } |
| 285 | 285 |
| 286 PassRefPtrWillBeRawPtr<AnimationEffect> EffectInput::convert(Element* element, c
onst AnimationEffectOrDictionarySequence& effectInput, ExceptionState& exception
State) | 286 PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const
EffectModelOrDictionarySequence& effectInput, ExceptionState& exceptionState) |
| 287 { | 287 { |
| 288 if (effectInput.isAnimationEffect()) | 288 if (effectInput.isEffectModel()) |
| 289 return effectInput.getAsAnimationEffect(); | 289 return effectInput.getAsEffectModel(); |
| 290 if (effectInput.isDictionarySequence()) | 290 if (effectInput.isDictionarySequence()) |
| 291 return convert(element, effectInput.getAsDictionarySequence(), exception
State); | 291 return convert(element, effectInput.getAsDictionarySequence(), exception
State); |
| 292 return nullptr; | 292 return nullptr; |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace blink | 295 } // namespace blink |
| OLD | NEW |