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

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

Issue 1153413007: Resolve style in element.animate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add DOCTYPE Created 5 years, 6 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 | Annotate | Revision Log
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
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<EffectModel> EffectInput::convert(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState) 192 PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const Vector<Dictionary>& keyframeDictionaryVector, ExceptionState& exceptionState)
193 { 193 {
194 // FIXME: Remove the dependency on element.
195 if (!element) 194 if (!element)
196 return nullptr; 195 return nullptr;
197 196
197 // TODO(alancutter): Remove this once composited animations no longer depend on AnimatableValues.
198 if (!element->inActiveDocument())
199 return nullptr;
200 element->document().updateLayoutTreeForNodeIfNeeded(element);
201
198 StyleSheetContents* styleSheetContents = element->document().elementSheet(). contents(); 202 StyleSheetContents* styleSheetContents = element->document().elementSheet(). contents();
199 StringKeyframeVector keyframes; 203 StringKeyframeVector keyframes;
200 double lastOffset = 0; 204 double lastOffset = 0;
201 205
202 for (const auto& keyframeDictionary : keyframeDictionaryVector) { 206 for (const auto& keyframeDictionary : keyframeDictionaryVector) {
203 RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create(); 207 RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create();
204 208
205 ScriptValue scriptValue; 209 ScriptValue scriptValue;
206 bool frameHasOffset = DictionaryHelper::get(keyframeDictionary, "offset" , scriptValue) && !scriptValue.isNull(); 210 bool frameHasOffset = DictionaryHelper::get(keyframeDictionary, "offset" , scriptValue) && !scriptValue.isNull();
207 211
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const EffectModelOrDictionarySequence& effectInput, ExceptionState& exceptionState) 290 PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const EffectModelOrDictionarySequence& effectInput, ExceptionState& exceptionState)
287 { 291 {
288 if (effectInput.isEffectModel()) 292 if (effectInput.isEffectModel())
289 return effectInput.getAsEffectModel(); 293 return effectInput.getAsEffectModel();
290 if (effectInput.isDictionarySequence()) 294 if (effectInput.isDictionarySequence())
291 return convert(element, effectInput.getAsDictionarySequence(), exception State); 295 return convert(element, effectInput.getAsDictionarySequence(), exception State);
292 return nullptr; 296 return nullptr;
293 } 297 }
294 298
295 } // namespace blink 299 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/animations/composited-animation-style-update-expected.html ('k') | Source/core/animation/EffectInputTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698