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

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

Issue 190763007: [WIP] Web Animations API: Constructing an Animation from partial keyframes throws a JS exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replace manual checks with check for dependsOnUnderlyingValue 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
« no previous file with comments | « Source/core/animation/EffectInput.h ('k') | Source/core/animation/ElementAnimation.h » ('j') | 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 30 matching lines...) Expand all
41 namespace WebCore { 41 namespace WebCore {
42 42
43 static bool checkDocumentAndRenderer(Element* element) 43 static bool checkDocumentAndRenderer(Element* element)
44 { 44 {
45 if (!element->inActiveDocument()) 45 if (!element->inActiveDocument())
46 return false; 46 return false;
47 element->document().updateStyleIfNeeded(); 47 element->document().updateStyleIfNeeded();
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, ExceptionState& exceptionSta te, 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 // 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.
59 KeyframeEffectModel::KeyframeVector keyframes; 59 KeyframeEffectModel::KeyframeVector keyframes;
60 Vector<RefPtr<MutableStylePropertySet> > propertySetVector; 60 Vector<RefPtr<MutableStylePropertySet> > propertySetVector;
61 61
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (id == CSSPropertyInvalid || !CSSAnimations::isAnimatableProperty (id)) 97 if (id == CSSPropertyInvalid || !CSSAnimations::isAnimatableProperty (id))
98 continue; 98 continue;
99 99
100 String value; 100 String value;
101 keyframeDictionaryVector[i].get(property, value); 101 keyframeDictionaryVector[i].get(property, value);
102 propertySet->setProperty(id, value); 102 propertySet->setProperty(id, value);
103 } 103 }
104 } 104 }
105 105
106 // 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.
107 return StyleResolver::createKeyframeEffectModel(*element, propertySetVector, keyframes); 107 RefPtrWillBeRawPtr<KeyframeEffectModel> keyframeEffectModel = StyleResolver: :createKeyframeEffectModel(*element, propertySetVector, keyframes);
108 if (!keyframeEffectModel->isReplaceOnly())
109 exceptionState.throwDOMException(NotSupportedError, "Partial keyframes a re not supported.");
110
111 return keyframeEffectModel;
108 } 112 }
109 113
110 } // namespace WebCore 114 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/EffectInput.h ('k') | Source/core/animation/ElementAnimation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698