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

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

Issue 1967463002: Fix assertion failure when exception is thrown during keyframe iteration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review changes Created 4 years, 7 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 | « third_party/WebKit/LayoutTests/animations/keyframe-iteration-exception-crash.html ('k') | no next file » | 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 bool exhaustDictionaryIterator(DictionaryIterator& iterator, ExecutionContext* e xecutionContext, ExceptionState& exceptionState, Vector<Dictionary>& result) 132 bool exhaustDictionaryIterator(DictionaryIterator& iterator, ExecutionContext* e xecutionContext, ExceptionState& exceptionState, Vector<Dictionary>& result)
133 { 133 {
134 while (iterator.next(executionContext, exceptionState)) { 134 while (iterator.next(executionContext, exceptionState)) {
135 Dictionary dictionary; 135 Dictionary dictionary;
136 if (!iterator.valueAsDictionary(dictionary, exceptionState)) { 136 if (!iterator.valueAsDictionary(dictionary, exceptionState)) {
137 exceptionState.throwTypeError("Keyframes must be objects."); 137 exceptionState.throwTypeError("Keyframes must be objects.");
138 return false; 138 return false;
139 } 139 }
140 result.append(dictionary); 140 result.append(dictionary);
141 } 141 }
142 return true; 142 return !exceptionState.hadException();
143 } 143 }
144 144
145 } // namespace 145 } // namespace
146 146
147 // Spec: http://w3c.github.io/web-animations/#processing-a-frames-argument 147 // Spec: http://w3c.github.io/web-animations/#processing-a-frames-argument
148 EffectModel* EffectInput::convert(Element* element, const EffectModelOrDictionar ySequenceOrDictionary& effectInput, ExecutionContext* executionContext, Exceptio nState& exceptionState) 148 EffectModel* EffectInput::convert(Element* element, const EffectModelOrDictionar ySequenceOrDictionary& effectInput, ExecutionContext* executionContext, Exceptio nState& exceptionState)
149 { 149 {
150 if (effectInput.isEffectModel()) 150 if (effectInput.isEffectModel())
151 return effectInput.getAsEffectModel(); 151 return effectInput.getAsEffectModel();
152 152
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 } 294 }
295 295
296 std::sort(keyframes.begin(), keyframes.end(), compareKeyframes); 296 std::sort(keyframes.begin(), keyframes.end(), compareKeyframes);
297 297
298 ASSERT(!exceptionState.hadException()); 298 ASSERT(!exceptionState.hadException());
299 299
300 return createEffectModelFromKeyframes(element, keyframes, encounteredComposi tableProperty, exceptionState); 300 return createEffectModelFromKeyframes(element, keyframes, encounteredComposi tableProperty, exceptionState);
301 } 301 }
302 302
303 } // namespace blink 303 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/keyframe-iteration-exception-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698