| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 58 // FIXME: Move this code into KeyframeEffectModel, it will be used by the ID
L constructor for that class. | 60 // FIXME: Move this code into KeyframeEffectModel, it will be used by the ID
L constructor for that class. |
| 59 KeyframeEffectModel::KeyframeVector keyframes; | 61 KeyframeEffectModel::KeyframeVector keyframes; |
| 60 Vector<RefPtr<MutableStylePropertySet> > propertySetVector; | 62 Vector<RefPtr<MutableStylePropertySet> > propertySetVector; |
| 61 | 63 |
| 62 for (size_t i = 0; i < keyframeDictionaryVector.size(); ++i) { | 64 for (size_t i = 0; i < keyframeDictionaryVector.size(); ++i) { |
| 63 RefPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::c
reate(); | 65 RefPtr<MutableStylePropertySet> propertySet = MutableStylePropertySet::c
reate(); |
| 64 propertySetVector.append(propertySet); | 66 propertySetVector.append(propertySet); |
| 65 | 67 |
| 66 RefPtrWillBeRawPtr<Keyframe> keyframe = Keyframe::create(); | 68 RefPtrWillBeRawPtr<Keyframe> keyframe = Keyframe::create(); |
| 67 keyframes.append(keyframe); | 69 keyframes.append(keyframe); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 92 // FIXME: There is no way to store invalid properties or invalid val
ues | 94 // FIXME: There is no way to store invalid properties or invalid val
ues |
| 93 // in a Keyframe object, so for now I just skip over them. Eventuall
y we | 95 // in a Keyframe object, so for now I just skip over them. Eventuall
y we |
| 94 // will need to support getFrames(), which should return exactly the | 96 // will need to support getFrames(), which should return exactly the |
| 95 // keyframes that were input through the API. We will add a layer to
wrap | 97 // keyframes that were input through the API. We will add a layer to
wrap |
| 96 // KeyframeEffectModel, store input keyframes and implement getFrame
s. | 98 // KeyframeEffectModel, store input keyframes and implement getFrame
s. |
| 97 if (id == CSSPropertyInvalid || !CSSAnimations::isAnimatableProperty
(id)) | 99 if (id == CSSPropertyInvalid || !CSSAnimations::isAnimatableProperty
(id)) |
| 98 continue; | 100 continue; |
| 99 | 101 |
| 100 String value; | 102 String value; |
| 101 keyframeDictionaryVector[i].get(property, value); | 103 keyframeDictionaryVector[i].get(property, value); |
| 102 propertySet->setProperty(id, value); | 104 propertySet->setProperty(id, value, false, styleSheetContents); |
| 103 } | 105 } |
| 104 } | 106 } |
| 105 | 107 |
| 106 // FIXME: Replace this with code that just parses, when that code is availab
le. | 108 // FIXME: Replace this with code that just parses, when that code is availab
le. |
| 107 return StyleResolver::createKeyframeEffectModel(*element, propertySetVector,
keyframes); | 109 return StyleResolver::createKeyframeEffectModel(*element, propertySetVector,
keyframes); |
| 108 } | 110 } |
| 109 | 111 |
| 110 } // namespace WebCore | 112 } // namespace WebCore |
| OLD | NEW |