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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 if (stack.isEmpty()) | 312 if (stack.isEmpty()) |
313 return 0; | 313 return 0; |
314 | 314 |
315 for (size_t i = 0; i < stack.size(); ++i) { | 315 for (size_t i = 0; i < stack.size(); ++i) { |
316 if (const StyleRuleKeyframes* keyframesRule = stack.at(i)->keyframeStyle
sForAnimation(animationName)) | 316 if (const StyleRuleKeyframes* keyframesRule = stack.at(i)->keyframeStyle
sForAnimation(animationName)) |
317 return keyframesRule; | 317 return keyframesRule; |
318 } | 318 } |
319 return 0; | 319 return 0; |
320 } | 320 } |
321 | 321 |
322 PassOwnPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(Element* element,
const Element& parentElement, const RenderStyle& style, RenderStyle* parentStyle
, StyleResolver* resolver) | 322 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(Elemen
t* element, const Element& parentElement, const RenderStyle& style, RenderStyle*
parentStyle, StyleResolver* resolver) |
323 { | 323 { |
324 OwnPtr<CSSAnimationUpdate> update = adoptPtr(new CSSAnimationUpdate()); | 324 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAn
imationUpdate()); |
325 calculateAnimationUpdate(update.get(), element, parentElement, style, parent
Style, resolver); | 325 calculateAnimationUpdate(update.get(), element, parentElement, style, parent
Style, resolver); |
326 calculateAnimationActiveInterpolations(update.get(), element); | 326 calculateAnimationActiveInterpolations(update.get(), element); |
327 calculateTransitionUpdate(update.get(), element, style); | 327 calculateTransitionUpdate(update.get(), element, style); |
328 calculateTransitionActiveInterpolations(update.get(), element); | 328 calculateTransitionActiveInterpolations(update.get(), element); |
329 return update->isEmpty() ? nullptr : update.release(); | 329 return update->isEmpty() ? nullptr : update.release(); |
330 } | 330 } |
331 | 331 |
332 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, Element
* element, const Element& parentElement, const RenderStyle& style, RenderStyle*
parentStyle, StyleResolver* resolver) | 332 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, Element
* element, const Element& parentElement, const RenderStyle& style, RenderStyle*
parentStyle, StyleResolver* resolver) |
333 { | 333 { |
334 const ActiveAnimations* activeAnimations = element ? element->activeAnimatio
ns() : 0; | 334 const ActiveAnimations* activeAnimations = element ? element->activeAnimatio
ns() : 0; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 404 } |
405 } | 405 } |
406 | 406 |
407 void CSSAnimations::maybeApplyPendingUpdate(Element* element) | 407 void CSSAnimations::maybeApplyPendingUpdate(Element* element) |
408 { | 408 { |
409 if (!m_pendingUpdate) { | 409 if (!m_pendingUpdate) { |
410 m_previousActiveInterpolationsForAnimations.clear(); | 410 m_previousActiveInterpolationsForAnimations.clear(); |
411 return; | 411 return; |
412 } | 412 } |
413 | 413 |
414 OwnPtr<CSSAnimationUpdate> update = m_pendingUpdate.release(); | 414 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = m_pendingUpdate.release(); |
415 | 415 |
416 m_previousActiveInterpolationsForAnimations.swap(update->activeInterpolation
sForAnimations()); | 416 m_previousActiveInterpolationsForAnimations.swap(update->activeInterpolation
sForAnimations()); |
417 | 417 |
418 // FIXME: cancelling, pausing, unpausing animations all query compositingSta
te, which is not necessarily up to date here | 418 // FIXME: cancelling, pausing, unpausing animations all query compositingSta
te, which is not necessarily up to date here |
419 // since we call this from recalc style. | 419 // since we call this from recalc style. |
420 // https://code.google.com/p/chromium/issues/detail?id=339847 | 420 // https://code.google.com/p/chromium/issues/detail?id=339847 |
421 DisableCompositingQueryAsserts disabler; | 421 DisableCompositingQueryAsserts disabler; |
422 | 422 |
423 for (Vector<AtomicString>::const_iterator iter = update->cancelledAnimationN
ames().begin(); iter != update->cancelledAnimationNames().end(); ++iter) { | 423 for (Vector<AtomicString>::const_iterator iter = update->cancelledAnimationN
ames().begin(); iter != update->cancelledAnimationNames().end(); ++iter) { |
424 const HashSet<RefPtr<AnimationPlayer> >& players = m_animations.take(*it
er); | 424 const HashSet<RefPtr<AnimationPlayer> >& players = m_animations.take(*it
er); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 for (int i = firstCSSProperty; i < lastCSSProperty; ++i) { | 888 for (int i = firstCSSProperty; i < lastCSSProperty; ++i) { |
889 CSSPropertyID id = convertToCSSPropertyID(i); | 889 CSSPropertyID id = convertToCSSPropertyID(i); |
890 if (isAnimatableProperty(id)) | 890 if (isAnimatableProperty(id)) |
891 properties.append(id); | 891 properties.append(id); |
892 } | 892 } |
893 propertyShorthand = StylePropertyShorthand(CSSPropertyInvalid, propertie
s.begin(), properties.size()); | 893 propertyShorthand = StylePropertyShorthand(CSSPropertyInvalid, propertie
s.begin(), properties.size()); |
894 } | 894 } |
895 return propertyShorthand; | 895 return propertyShorthand; |
896 } | 896 } |
897 | 897 |
| 898 void CSSAnimations::trace(Visitor* visitor) |
| 899 { |
| 900 visitor->trace(m_transitions); |
| 901 visitor->trace(m_pendingUpdate); |
| 902 visitor->trace(m_previousActiveInterpolationsForAnimations); |
| 903 } |
| 904 |
| 905 void CSSAnimationUpdate::trace(Visitor* visitor) |
| 906 { |
| 907 visitor->trace(m_newTransitions); |
| 908 visitor->trace(m_activeInterpolationsForAnimations); |
| 909 visitor->trace(m_activeInterpolationsForTransitions); |
| 910 } |
| 911 |
898 } // namespace WebCore | 912 } // namespace WebCore |
OLD | NEW |