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

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

Issue 212393002: Web Animations API: Ensure timing is updated if a RAF callback makes a player outdated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove assert. 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
« no previous file with comments | « Source/core/animation/DocumentAnimations.h ('k') | Source/core/page/PageAnimator.cpp » ('j') | 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 } // namespace 55 } // namespace
56 56
57 void DocumentAnimations::updateAnimationTimingForAnimationFrame(Document& docume nt, double monotonicAnimationStartTime) 57 void DocumentAnimations::updateAnimationTimingForAnimationFrame(Document& docume nt, double monotonicAnimationStartTime)
58 { 58 {
59 document.animationClock().updateTime(monotonicAnimationStartTime); 59 document.animationClock().updateTime(monotonicAnimationStartTime);
60 updateAnimationTiming(document); 60 updateAnimationTiming(document);
61 } 61 }
62 62
63 void DocumentAnimations::updateOutdatedAnimationPlayersAfterFrameCallbacks(Docum ent& document)
64 {
65 if (document.timeline().hasOutdatedAnimationPlayer()) {
66 updateAnimationTiming(document);
67 }
68 }
69
63 void DocumentAnimations::updateAnimationTimingForGetComputedStyle(Node& node, CS SPropertyID property) 70 void DocumentAnimations::updateAnimationTimingForGetComputedStyle(Node& node, CS SPropertyID property)
64 { 71 {
65 if (!node.isElementNode()) 72 if (!node.isElementNode())
66 return; 73 return;
67 const Element& element = toElement(node); 74 const Element& element = toElement(node);
68 if (element.document().timeline().hasOutdatedAnimationPlayer()) { 75 if (element.document().timeline().hasOutdatedAnimationPlayer()) {
69 updateAnimationTiming(element.document()); 76 updateAnimationTiming(element.document());
70 return; 77 return;
71 } 78 }
72 if (const ActiveAnimations* activeAnimations = element.activeAnimations()) { 79 if (const ActiveAnimations* activeAnimations = element.activeAnimations()) {
73 if (activeAnimations->hasActiveAnimationsOnCompositor(property)) 80 if (activeAnimations->hasActiveAnimationsOnCompositor(property))
74 updateAnimationTiming(element.document()); 81 updateAnimationTiming(element.document());
75 } 82 }
76 } 83 }
77 84
78 void DocumentAnimations::startPendingAnimations(Document& document) 85 void DocumentAnimations::startPendingAnimations(Document& document)
79 { 86 {
80 ASSERT(document.lifecycle().state() == DocumentLifecycle::CompositingClean); 87 ASSERT(document.lifecycle().state() == DocumentLifecycle::CompositingClean);
81 if (document.cssPendingAnimations().startPendingAnimations()) { 88 if (document.cssPendingAnimations().startPendingAnimations()) {
82 ASSERT(document.view()); 89 ASSERT(document.view());
83 document.view()->scheduleAnimation(); 90 document.view()->scheduleAnimation();
84 } 91 }
85 92
86 document.animationClock().unfreeze(); 93 document.animationClock().unfreeze();
87 } 94 }
88 95
89 } // namespace WebCore 96 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/DocumentAnimations.h ('k') | Source/core/page/PageAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698