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

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

Issue 46043014: Web Animations CSS: Unfreeze AnimationClock if sampling timelines does not trigger style recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reinstate assert Created 7 years, 1 month 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 28 matching lines...) Expand all
39 , m_startTime(0) 39 , m_startTime(0)
40 , m_player(0) 40 , m_player(0)
41 , m_specified(timing) 41 , m_specified(timing)
42 , m_eventDelegate(eventDelegate) 42 , m_eventDelegate(eventDelegate)
43 , m_calculated() 43 , m_calculated()
44 , m_isFirstSample(true) 44 , m_isFirstSample(true)
45 { 45 {
46 timing.assertValid(); 46 timing.assertValid();
47 } 47 }
48 48
49 void TimedItem::updateInheritedTime(double inheritedTime) const 49 bool TimedItem::updateInheritedTime(double inheritedTime) const
50 { 50 {
51 const double localTime = inheritedTime - m_startTime; 51 const double localTime = inheritedTime - m_startTime;
52 const double iterationDuration = m_specified.hasIterationDuration 52 const double iterationDuration = m_specified.hasIterationDuration
53 ? m_specified.iterationDuration 53 ? m_specified.iterationDuration
54 : intrinsicIterationDuration(); 54 : intrinsicIterationDuration();
55 55
56 const double repeatedDuration = iterationDuration * m_specified.iterationCou nt; 56 const double repeatedDuration = iterationDuration * m_specified.iterationCou nt;
57 const double activeDuration = m_specified.playbackRate 57 const double activeDuration = m_specified.playbackRate
58 ? repeatedDuration / abs(m_specified.playbackRate) 58 ? repeatedDuration / abs(m_specified.playbackRate)
59 : std::numeric_limits<double>::infinity(); 59 : std::numeric_limits<double>::infinity();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 m_calculated.isInPlay = phase() == PhaseActive && (!m_parent || m_parent->is InPlay()); 99 m_calculated.isInPlay = phase() == PhaseActive && (!m_parent || m_parent->is InPlay());
100 m_calculated.isCurrent = phase() == PhaseBefore || isInPlay() || (m_parent & & m_parent->isCurrent()); 100 m_calculated.isCurrent = phase() == PhaseBefore || isInPlay() || (m_parent & & m_parent->isCurrent());
101 101
102 // This logic is specific to CSS animation events and assumes that all 102 // This logic is specific to CSS animation events and assumes that all
103 // animations start after the DocumentTimeline has started. 103 // animations start after the DocumentTimeline has started.
104 if (m_eventDelegate && (m_isFirstSample || previousPhase != phase() || (phas e() == PhaseActive && previousIteration != currentIteration))) 104 if (m_eventDelegate && (m_isFirstSample || previousPhase != phase() || (phas e() == PhaseActive && previousIteration != currentIteration)))
105 m_eventDelegate->onEventCondition(this, m_isFirstSample, previousPhase, previousIteration); 105 m_eventDelegate->onEventCondition(this, m_isFirstSample, previousPhase, previousIteration);
106 m_isFirstSample = false; 106 m_isFirstSample = false;
107 107
108 // FIXME: This probably shouldn't be recursive. 108 // FIXME: This probably shouldn't be recursive.
109 updateChildrenAndEffects(); 109 bool didTriggerStyleRecalc = updateChildrenAndEffects();
110 110
111 m_calculated.timeToEffectChange = calculateTimeToEffectChange(localTime, m_s tartTime + m_specified.startDelay, m_calculated.phase); 111 m_calculated.timeToEffectChange = calculateTimeToEffectChange(localTime, m_s tartTime + m_specified.startDelay, m_calculated.phase);
112 return didTriggerStyleRecalc;
112 } 113 }
113 114
114 } // namespace WebCore 115 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698