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

Side by Side Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 216523002: Oilpan: Replace most of RefPtrs for Event objects with oilpan's transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 if (!update->activeInterpolationsForAnimations().isEmpty() && !activeInterpo lationsForTransitions.isEmpty()) { 612 if (!update->activeInterpolationsForAnimations().isEmpty() && !activeInterpo lationsForTransitions.isEmpty()) {
613 for (WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >::const_iterator iter = update->activeInterpolationsForAnimations().begin(); it er != update->activeInterpolationsForAnimations().end(); ++iter) 613 for (WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >::const_iterator iter = update->activeInterpolationsForAnimations().begin(); it er != update->activeInterpolationsForAnimations().end(); ++iter)
614 activeInterpolationsForTransitions.remove(iter->key); 614 activeInterpolationsForTransitions.remove(iter->key);
615 } 615 }
616 update->adoptActiveInterpolationsForTransitions(activeInterpolationsForTrans itions); 616 update->adoptActiveInterpolationsForTransitions(activeInterpolationsForTrans itions);
617 } 617 }
618 618
619 void CSSAnimations::AnimationEventDelegate::maybeDispatch(Document::ListenerType listenerType, const AtomicString& eventName, double elapsedTime) 619 void CSSAnimations::AnimationEventDelegate::maybeDispatch(Document::ListenerType listenerType, const AtomicString& eventName, double elapsedTime)
620 { 620 {
621 if (m_target->document().hasListenerType(listenerType)) { 621 if (m_target->document().hasListenerType(listenerType)) {
622 RefPtr<WebKitAnimationEvent> event = WebKitAnimationEvent::create(eventN ame, m_name, elapsedTime); 622 RefPtrWillBeRawPtr<WebKitAnimationEvent> event = WebKitAnimationEvent::c reate(eventName, m_name, elapsedTime);
623 event->setTarget(m_target); 623 event->setTarget(m_target);
624 m_target->document().enqueueAnimationFrameEvent(event); 624 m_target->document().enqueueAnimationFrameEvent(event);
625 } 625 }
626 } 626 }
627 627
628 void CSSAnimations::AnimationEventDelegate::onEventCondition(const TimedItem* ti medItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIter ation) 628 void CSSAnimations::AnimationEventDelegate::onEventCondition(const TimedItem* ti medItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIter ation)
629 { 629 {
630 const TimedItem::Phase currentPhase = timedItem->phase(); 630 const TimedItem::Phase currentPhase = timedItem->phase();
631 const double currentIteration = timedItem->currentIteration(); 631 const double currentIteration = timedItem->currentIteration();
632 632
(...skipping 23 matching lines...) Expand all
656 656
657 void CSSAnimations::TransitionEventDelegate::onEventCondition(const TimedItem* t imedItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIte ration) 657 void CSSAnimations::TransitionEventDelegate::onEventCondition(const TimedItem* t imedItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIte ration)
658 { 658 {
659 const TimedItem::Phase currentPhase = timedItem->phase(); 659 const TimedItem::Phase currentPhase = timedItem->phase();
660 if (currentPhase == TimedItem::PhaseAfter && (isFirstSample || previousPhase != currentPhase) && m_target->document().hasListenerType(Document::TRANSITIONEN D_LISTENER)) { 660 if (currentPhase == TimedItem::PhaseAfter && (isFirstSample || previousPhase != currentPhase) && m_target->document().hasListenerType(Document::TRANSITIONEN D_LISTENER)) {
661 String propertyName = getPropertyNameString(m_property); 661 String propertyName = getPropertyNameString(m_property);
662 const Timing& timing = timedItem->specifiedTiming(); 662 const Timing& timing = timedItem->specifiedTiming();
663 double elapsedTime = timing.iterationDuration; 663 double elapsedTime = timing.iterationDuration;
664 const AtomicString& eventType = EventTypeNames::transitionend; 664 const AtomicString& eventType = EventTypeNames::transitionend;
665 String pseudoElement = PseudoElement::pseudoElementNameForEvents(m_targe t->pseudoId()); 665 String pseudoElement = PseudoElement::pseudoElementNameForEvents(m_targe t->pseudoId());
666 RefPtr<TransitionEvent> event = TransitionEvent::create(eventType, prope rtyName, elapsedTime, pseudoElement); 666 RefPtrWillBeRawPtr<TransitionEvent> event = TransitionEvent::create(even tType, propertyName, elapsedTime, pseudoElement);
667 event->setTarget(m_target); 667 event->setTarget(m_target);
668 m_target->document().enqueueAnimationFrameEvent(event); 668 m_target->document().enqueueAnimationFrameEvent(event);
669 } 669 }
670 } 670 }
671 671
672 672
673 bool CSSAnimations::isAnimatableProperty(CSSPropertyID property) 673 bool CSSAnimations::isAnimatableProperty(CSSPropertyID property)
674 { 674 {
675 switch (property) { 675 switch (property) {
676 case CSSPropertyBackgroundColor: 676 case CSSPropertyBackgroundColor:
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 } 811 }
812 812
813 void CSSAnimationUpdate::trace(Visitor* visitor) 813 void CSSAnimationUpdate::trace(Visitor* visitor)
814 { 814 {
815 visitor->trace(m_newTransitions); 815 visitor->trace(m_newTransitions);
816 visitor->trace(m_activeInterpolationsForAnimations); 816 visitor->trace(m_activeInterpolationsForAnimations);
817 visitor->trace(m_activeInterpolationsForTransitions); 817 visitor->trace(m_activeInterpolationsForTransitions);
818 } 818 }
819 819
820 } // namespace WebCore 820 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698