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

Side by Side Diff: Source/core/animation/EffectInput.cpp

Issue 661453004: Add getPropertyNames to v8 Dictionaries and make use of in Keyframes processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/bindings/core/v8/Dictionary.cpp ('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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (compositeString == "add") 88 if (compositeString == "add")
89 keyframe->setComposite(AnimationEffect::CompositeAdd); 89 keyframe->setComposite(AnimationEffect::CompositeAdd);
90 90
91 String timingFunctionString; 91 String timingFunctionString;
92 if (DictionaryHelper::get(keyframeDictionaryVector[i], "easing", timingF unctionString)) { 92 if (DictionaryHelper::get(keyframeDictionaryVector[i], "easing", timingF unctionString)) {
93 if (RefPtr<TimingFunction> timingFunction = AnimationInputHelpers::p arseTimingFunction(timingFunctionString)) 93 if (RefPtr<TimingFunction> timingFunction = AnimationInputHelpers::p arseTimingFunction(timingFunctionString))
94 keyframe->setEasing(timingFunction); 94 keyframe->setEasing(timingFunction);
95 } 95 }
96 96
97 Vector<String> keyframeProperties; 97 Vector<String> keyframeProperties;
98 keyframeDictionaryVector[i].getOwnPropertyNames(keyframeProperties); 98 keyframeDictionaryVector[i].getPropertyNames(keyframeProperties);
99 for (size_t j = 0; j < keyframeProperties.size(); ++j) { 99 for (size_t j = 0; j < keyframeProperties.size(); ++j) {
100 String property = keyframeProperties[j]; 100 String property = keyframeProperties[j];
101 CSSPropertyID id = AnimationInputHelpers::keyframeAttributeToCSSProp ertyID(property); 101 CSSPropertyID id = AnimationInputHelpers::keyframeAttributeToCSSProp ertyID(property);
102 if (id == CSSPropertyInvalid) 102 if (id == CSSPropertyInvalid)
103 continue; 103 continue;
104 String value; 104 String value;
105 DictionaryHelper::get(keyframeDictionaryVector[i], property, value); 105 DictionaryHelper::get(keyframeDictionaryVector[i], property, value);
106 keyframe->setPropertyValue(id, value, styleSheetContents); 106 keyframe->setPropertyValue(id, value, styleSheetContents);
107 } 107 }
108 } 108 }
109 109
110 RefPtrWillBeRawPtr<StringKeyframeEffectModel> keyframeEffectModel = StringKe yframeEffectModel::create(keyframes); 110 RefPtrWillBeRawPtr<StringKeyframeEffectModel> keyframeEffectModel = StringKe yframeEffectModel::create(keyframes);
111 if (!keyframeEffectModel->isReplaceOnly()) { 111 if (!keyframeEffectModel->isReplaceOnly()) {
112 exceptionState.throwDOMException(NotSupportedError, "Partial keyframes a re not supported."); 112 exceptionState.throwDOMException(NotSupportedError, "Partial keyframes a re not supported.");
113 return nullptr; 113 return nullptr;
114 } 114 }
115 keyframeEffectModel->forceConversionsToAnimatableValues(element); 115 keyframeEffectModel->forceConversionsToAnimatableValues(element);
116 116
117 return keyframeEffectModel; 117 return keyframeEffectModel;
118 } 118 }
119 119
120 } // namespace blink 120 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/Dictionary.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698