Chromium Code Reviews| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 | 182 |
| 183 auto iter = supportedAttributes.find(attributeName); | 183 auto iter = supportedAttributes.find(attributeName); |
| 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, b ool unsafe) |
| 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 (!unsafe) { | |
| 199 if (!element->inActiveDocument()) | |
|
esprehn
2015/06/04 06:18:09
This unsafe thing just for unit tests seems bad, t
| |
| 200 return nullptr; | |
| 201 element->document().updateLayoutTreeForNodeIfNeeded(element); | |
| 202 } | |
| 203 | |
| 198 StyleSheetContents* styleSheetContents = element->document().elementSheet(). contents(); | 204 StyleSheetContents* styleSheetContents = element->document().elementSheet(). contents(); |
| 199 StringKeyframeVector keyframes; | 205 StringKeyframeVector keyframes; |
| 200 double lastOffset = 0; | 206 double lastOffset = 0; |
| 201 | 207 |
| 202 for (const auto& keyframeDictionary : keyframeDictionaryVector) { | 208 for (const auto& keyframeDictionary : keyframeDictionaryVector) { |
| 203 RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create(); | 209 RefPtrWillBeRawPtr<StringKeyframe> keyframe = StringKeyframe::create(); |
| 204 | 210 |
| 205 ScriptValue scriptValue; | 211 ScriptValue scriptValue; |
| 206 bool frameHasOffset = DictionaryHelper::get(keyframeDictionary, "offset" , scriptValue) && !scriptValue.isNull(); | 212 bool frameHasOffset = DictionaryHelper::get(keyframeDictionary, "offset" , scriptValue) && !scriptValue.isNull(); |
| 207 | 213 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const EffectModelOrDictionarySequence& effectInput, ExceptionState& exceptionState) | 292 PassRefPtrWillBeRawPtr<EffectModel> EffectInput::convert(Element* element, const EffectModelOrDictionarySequence& effectInput, ExceptionState& exceptionState) |
| 287 { | 293 { |
| 288 if (effectInput.isEffectModel()) | 294 if (effectInput.isEffectModel()) |
| 289 return effectInput.getAsEffectModel(); | 295 return effectInput.getAsEffectModel(); |
| 290 if (effectInput.isDictionarySequence()) | 296 if (effectInput.isDictionarySequence()) |
| 291 return convert(element, effectInput.getAsDictionarySequence(), exception State); | 297 return convert(element, effectInput.getAsDictionarySequence(), exception State); |
| 292 return nullptr; | 298 return nullptr; |
| 293 } | 299 } |
| 294 | 300 |
| 295 } // namespace blink | 301 } // namespace blink |
| OLD | NEW |