| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 if (DictionaryHelper::get(keyframeDictionary, "easing", | 218 if (DictionaryHelper::get(keyframeDictionary, "easing", |
| 219 timingFunctionString)) { | 219 timingFunctionString)) { |
| 220 RefPtr<TimingFunction> timingFunction = | 220 RefPtr<TimingFunction> timingFunction = |
| 221 AnimationInputHelpers::parseTimingFunction( | 221 AnimationInputHelpers::parseTimingFunction( |
| 222 timingFunctionString, &element.document(), exceptionState); | 222 timingFunctionString, &element.document(), exceptionState); |
| 223 if (!timingFunction) | 223 if (!timingFunction) |
| 224 return nullptr; | 224 return nullptr; |
| 225 keyframe->setEasing(timingFunction); | 225 keyframe->setEasing(timingFunction); |
| 226 } | 226 } |
| 227 | 227 |
| 228 Vector<String> keyframeProperties; | 228 const Vector<String>& keyframeProperties = |
| 229 keyframeDictionary.getPropertyNames(keyframeProperties); | 229 keyframeDictionary.getPropertyNames(exceptionState); |
| 230 if (exceptionState.hadException()) |
| 231 return nullptr; |
| 230 for (const auto& property : keyframeProperties) { | 232 for (const auto& property : keyframeProperties) { |
| 231 if (property == "offset" || property == "composite" || | 233 if (property == "offset" || property == "composite" || |
| 232 property == "easing") { | 234 property == "easing") { |
| 233 continue; | 235 continue; |
| 234 } | 236 } |
| 235 | 237 |
| 236 Vector<String> values; | 238 Vector<String> values; |
| 237 if (DictionaryHelper::get(keyframeDictionary, property, values)) { | 239 if (DictionaryHelper::get(keyframeDictionary, property, values)) { |
| 238 exceptionState.throwTypeError( | 240 exceptionState.throwTypeError( |
| 239 "Lists of values not permitted in array-form list of keyframes"); | 241 "Lists of values not permitted in array-form list of keyframes"); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 Nullable<double> offset; | 318 Nullable<double> offset; |
| 317 if (DictionaryHelper::get(keyframeDictionary, "offset", offset) && | 319 if (DictionaryHelper::get(keyframeDictionary, "offset", offset) && |
| 318 !offset.isNull()) { | 320 !offset.isNull()) { |
| 319 if (!checkOffset(offset.get(), 0.0, exceptionState)) | 321 if (!checkOffset(offset.get(), 0.0, exceptionState)) |
| 320 return nullptr; | 322 return nullptr; |
| 321 } | 323 } |
| 322 | 324 |
| 323 String compositeString; | 325 String compositeString; |
| 324 DictionaryHelper::get(keyframeDictionary, "composite", compositeString); | 326 DictionaryHelper::get(keyframeDictionary, "composite", compositeString); |
| 325 | 327 |
| 326 Vector<String> keyframeProperties; | 328 const Vector<String>& keyframeProperties = |
| 327 keyframeDictionary.getPropertyNames(keyframeProperties); | 329 keyframeDictionary.getPropertyNames(exceptionState); |
| 330 if (exceptionState.hadException()) |
| 331 return nullptr; |
| 328 for (const auto& property : keyframeProperties) { | 332 for (const auto& property : keyframeProperties) { |
| 329 if (property == "offset" || property == "composite" || | 333 if (property == "offset" || property == "composite" || |
| 330 property == "easing") { | 334 property == "easing") { |
| 331 continue; | 335 continue; |
| 332 } | 336 } |
| 333 | 337 |
| 334 Vector<String> values; | 338 Vector<String> values; |
| 335 if (!getPropertyIndexedKeyframeValues(keyframeDictionary, property, | 339 if (!getPropertyIndexedKeyframeValues(keyframeDictionary, property, |
| 336 executionContext, exceptionState, | 340 executionContext, exceptionState, |
| 337 values)) | 341 values)) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 361 } | 365 } |
| 362 | 366 |
| 363 std::sort(keyframes.begin(), keyframes.end(), compareKeyframes); | 367 std::sort(keyframes.begin(), keyframes.end(), compareKeyframes); |
| 364 | 368 |
| 365 DCHECK(!exceptionState.hadException()); | 369 DCHECK(!exceptionState.hadException()); |
| 366 | 370 |
| 367 return createEffectModelFromKeyframes(element, keyframes, exceptionState); | 371 return createEffectModelFromKeyframes(element, keyframes, exceptionState); |
| 368 } | 372 } |
| 369 | 373 |
| 370 } // namespace blink | 374 } // namespace blink |
| OLD | NEW |