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

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, 8 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 if (!update->activeInterpolationsForAnimations().isEmpty() && !activeInterpo lationsForTransitions.isEmpty()) { 639 if (!update->activeInterpolationsForAnimations().isEmpty() && !activeInterpo lationsForTransitions.isEmpty()) {
640 for (WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >::const_iterator iter = update->activeInterpolationsForAnimations().begin(); it er != update->activeInterpolationsForAnimations().end(); ++iter) 640 for (WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >::const_iterator iter = update->activeInterpolationsForAnimations().begin(); it er != update->activeInterpolationsForAnimations().end(); ++iter)
641 activeInterpolationsForTransitions.remove(iter->key); 641 activeInterpolationsForTransitions.remove(iter->key);
642 } 642 }
643 update->adoptActiveInterpolationsForTransitions(activeInterpolationsForTrans itions); 643 update->adoptActiveInterpolationsForTransitions(activeInterpolationsForTrans itions);
644 } 644 }
645 645
646 void CSSAnimations::AnimationEventDelegate::maybeDispatch(Document::ListenerType listenerType, const AtomicString& eventName, double elapsedTime) 646 void CSSAnimations::AnimationEventDelegate::maybeDispatch(Document::ListenerType listenerType, const AtomicString& eventName, double elapsedTime)
647 { 647 {
648 if (m_target->document().hasListenerType(listenerType)) { 648 if (m_target->document().hasListenerType(listenerType)) {
649 RefPtr<WebKitAnimationEvent> event = WebKitAnimationEvent::create(eventN ame, m_name, elapsedTime); 649 RefPtrWillBeRawPtr<WebKitAnimationEvent> event = WebKitAnimationEvent::c reate(eventName, m_name, elapsedTime);
650 event->setTarget(m_target); 650 event->setTarget(m_target);
651 m_target->document().enqueueAnimationFrameEvent(event); 651 m_target->document().enqueueAnimationFrameEvent(event);
652 } 652 }
653 } 653 }
654 654
655 void CSSAnimations::AnimationEventDelegate::onEventCondition(const TimedItem* ti medItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIter ation) 655 void CSSAnimations::AnimationEventDelegate::onEventCondition(const TimedItem* ti medItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIter ation)
656 { 656 {
657 const TimedItem::Phase currentPhase = timedItem->phase(); 657 const TimedItem::Phase currentPhase = timedItem->phase();
658 const double currentIteration = timedItem->currentIteration(); 658 const double currentIteration = timedItem->currentIteration();
659 659
(...skipping 23 matching lines...) Expand all
683 683
684 void CSSAnimations::TransitionEventDelegate::onEventCondition(const TimedItem* t imedItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIte ration) 684 void CSSAnimations::TransitionEventDelegate::onEventCondition(const TimedItem* t imedItem, bool isFirstSample, TimedItem::Phase previousPhase, double previousIte ration)
685 { 685 {
686 const TimedItem::Phase currentPhase = timedItem->phase(); 686 const TimedItem::Phase currentPhase = timedItem->phase();
687 if (currentPhase == TimedItem::PhaseAfter && (isFirstSample || previousPhase != currentPhase) && m_target->document().hasListenerType(Document::TRANSITIONEN D_LISTENER)) { 687 if (currentPhase == TimedItem::PhaseAfter && (isFirstSample || previousPhase != currentPhase) && m_target->document().hasListenerType(Document::TRANSITIONEN D_LISTENER)) {
688 String propertyName = getPropertyNameString(m_property); 688 String propertyName = getPropertyNameString(m_property);
689 const Timing& timing = timedItem->specifiedTiming(); 689 const Timing& timing = timedItem->specifiedTiming();
690 double elapsedTime = timing.iterationDuration; 690 double elapsedTime = timing.iterationDuration;
691 const AtomicString& eventType = EventTypeNames::transitionend; 691 const AtomicString& eventType = EventTypeNames::transitionend;
692 String pseudoElement = PseudoElement::pseudoElementNameForEvents(m_targe t->pseudoId()); 692 String pseudoElement = PseudoElement::pseudoElementNameForEvents(m_targe t->pseudoId());
693 RefPtr<TransitionEvent> event = TransitionEvent::create(eventType, prope rtyName, elapsedTime, pseudoElement); 693 RefPtrWillBeRawPtr<TransitionEvent> event = TransitionEvent::create(even tType, propertyName, elapsedTime, pseudoElement);
694 event->setTarget(m_target); 694 event->setTarget(m_target);
695 m_target->document().enqueueAnimationFrameEvent(event); 695 m_target->document().enqueueAnimationFrameEvent(event);
696 } 696 }
697 } 697 }
698 698
699 bool CSSAnimations::isAnimatableProperty(CSSPropertyID property) 699 bool CSSAnimations::isAnimatableProperty(CSSPropertyID property)
700 { 700 {
701 switch (property) { 701 switch (property) {
702 case CSSPropertyBackgroundColor: 702 case CSSPropertyBackgroundColor:
703 case CSSPropertyBackgroundImage: 703 case CSSPropertyBackgroundImage:
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 } 841 }
842 842
843 void CSSAnimationUpdate::trace(Visitor* visitor) 843 void CSSAnimationUpdate::trace(Visitor* visitor)
844 { 844 {
845 visitor->trace(m_newTransitions); 845 visitor->trace(m_newTransitions);
846 visitor->trace(m_activeInterpolationsForAnimations); 846 visitor->trace(m_activeInterpolationsForAnimations);
847 visitor->trace(m_activeInterpolationsForTransitions); 847 visitor->trace(m_activeInterpolationsForTransitions);
848 } 848 }
849 849
850 } // namespace WebCore 850 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698