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

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

Issue 203413008: Revert of Web Animations API: Load resources referenced in element.animate() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return element->renderer(); 48 return element->renderer();
49 } 49 }
50 50
51 PassRefPtrWillBeRawPtr<AnimationEffect> EffectInput::convert(Element* element, c onst Vector<Dictionary>& keyframeDictionaryVector, bool unsafe) 51 PassRefPtrWillBeRawPtr<AnimationEffect> EffectInput::convert(Element* element, c onst Vector<Dictionary>& keyframeDictionaryVector, bool unsafe)
52 { 52 {
53 // FIXME: This test will not be neccessary once resolution of keyframe value s occurs at 53 // FIXME: This test will not be neccessary once resolution of keyframe value s occurs at
54 // animation application time. 54 // animation application time.
55 if (!unsafe && !checkDocumentAndRenderer(element)) 55 if (!unsafe && !checkDocumentAndRenderer(element))
56 return nullptr; 56 return nullptr;
57 57
58 StyleSheetContents* styleSheetContents = element->document().elementSheet(). contents();
59
60 // FIXME: Move this code into KeyframeEffectModel, it will be used by the ID L constructor for that class. 58 // FIXME: Move this code into KeyframeEffectModel, it will be used by the ID L constructor for that class.
61 KeyframeEffectModel::KeyframeVector keyframes; 59 KeyframeEffectModel::KeyframeVector keyframes;
62 Vector<RefPtr<MutableStylePropertySet> > propertySetVector; 60 Vector<RefPtr<MutableStylePropertySet> > propertySetVector;
63 61
64 for (size_t i = 0; i < keyframeDictionaryVector.size(); ++i) { 62 for (size_t i = 0; i < keyframeDictionaryVector.size(); ++i) {
65 RefPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::c reate(); 63 RefPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::c reate();
66 propertySetVector.append(propertySet); 64 propertySetVector.append(propertySet);
67 65
68 RefPtrWillBeRawPtr<Keyframe> keyframe = Keyframe::create(); 66 RefPtrWillBeRawPtr<Keyframe> keyframe = Keyframe::create();
69 keyframes.append(keyframe); 67 keyframes.append(keyframe);
(...skipping 24 matching lines...) Expand all
94 // FIXME: There is no way to store invalid properties or invalid val ues 92 // FIXME: There is no way to store invalid properties or invalid val ues
95 // in a Keyframe object, so for now I just skip over them. Eventuall y we 93 // in a Keyframe object, so for now I just skip over them. Eventuall y we
96 // will need to support getFrames(), which should return exactly the 94 // will need to support getFrames(), which should return exactly the
97 // keyframes that were input through the API. We will add a layer to wrap 95 // keyframes that were input through the API. We will add a layer to wrap
98 // KeyframeEffectModel, store input keyframes and implement getFrame s. 96 // KeyframeEffectModel, store input keyframes and implement getFrame s.
99 if (id == CSSPropertyInvalid || !CSSAnimations::isAnimatableProperty (id)) 97 if (id == CSSPropertyInvalid || !CSSAnimations::isAnimatableProperty (id))
100 continue; 98 continue;
101 99
102 String value; 100 String value;
103 keyframeDictionaryVector[i].get(property, value); 101 keyframeDictionaryVector[i].get(property, value);
104 propertySet->setProperty(id, value, false, styleSheetContents); 102 propertySet->setProperty(id, value);
105 } 103 }
106 } 104 }
107 105
108 // FIXME: Replace this with code that just parses, when that code is availab le. 106 // FIXME: Replace this with code that just parses, when that code is availab le.
109 return StyleResolver::createKeyframeEffectModel(*element, propertySetVector, keyframes); 107 return StyleResolver::createKeyframeEffectModel(*element, propertySetVector, keyframes);
110 } 108 }
111 109
112 } // namespace WebCore 110 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/AnimatableValueTestHelper.cpp ('k') | Source/core/animation/css/CSSAnimatableValueFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698