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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void dispatchAnimationEventsAsync(Document& document) | 64 void dispatchAnimationEventsAsync(Document& document) |
65 { | 65 { |
66 document.timeline()->dispatchEventsAsync(); | 66 document.timeline()->dispatchEventsAsync(); |
67 document.transitionTimeline()->dispatchEventsAsync(); | 67 document.transitionTimeline()->dispatchEventsAsync(); |
68 } | 68 } |
69 | 69 |
70 } // namespace | 70 } // namespace |
71 | 71 |
72 void DocumentAnimations::serviceOnAnimationFrame(Document& document, double mono
tonicAnimationStartTime) | 72 void DocumentAnimations::serviceOnAnimationFrame(Document& document, double mono
tonicAnimationStartTime) |
73 { | 73 { |
74 if (!RuntimeEnabledFeatures::webAnimationsEnabled()) | 74 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) |
75 return; | 75 return; |
76 | 76 |
77 updateAnimationTiming(document, monotonicAnimationStartTime); | 77 updateAnimationTiming(document, monotonicAnimationStartTime); |
78 dispatchAnimationEvents(document); | 78 dispatchAnimationEvents(document); |
79 } | 79 } |
80 | 80 |
81 void DocumentAnimations::serviceBeforeGetComputedStyle(Node& node, CSSPropertyID
property) | 81 void DocumentAnimations::serviceBeforeGetComputedStyle(Node& node, CSSPropertyID
property) |
82 { | 82 { |
83 if (!RuntimeEnabledFeatures::webAnimationsEnabled()) | 83 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) |
84 return; | 84 return; |
85 | 85 |
86 if (node.isElementNode()) { | 86 if (node.isElementNode()) { |
87 const Element& element = toElement(node); | 87 const Element& element = toElement(node); |
88 if (const ActiveAnimations* activeAnimations = element.activeAnimations(
)) { | 88 if (const ActiveAnimations* activeAnimations = element.activeAnimations(
)) { |
89 if (activeAnimations->hasActiveAnimationsOnCompositor(property)) | 89 if (activeAnimations->hasActiveAnimationsOnCompositor(property)) |
90 updateAnimationTiming(element.document(), monotonicallyIncreasin
gTime()); | 90 updateAnimationTiming(element.document(), monotonicallyIncreasin
gTime()); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 } | 94 } |
95 | 95 |
96 void DocumentAnimations::serviceAfterStyleRecalc(Document& document) | 96 void DocumentAnimations::serviceAfterStyleRecalc(Document& document) |
97 { | 97 { |
98 if (!RuntimeEnabledFeatures::webAnimationsEnabled()) | 98 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) |
99 return; | 99 return; |
100 | 100 |
101 if (document.cssPendingAnimations().startPendingAnimations() && document.vie
w()) | 101 if (document.cssPendingAnimations().startPendingAnimations() && document.vie
w()) |
102 document.view()->scheduleAnimation(); | 102 document.view()->scheduleAnimation(); |
103 | 103 |
104 document.animationClock().unfreeze(); | 104 document.animationClock().unfreeze(); |
105 dispatchAnimationEventsAsync(document); | 105 dispatchAnimationEventsAsync(document); |
106 } | 106 } |
107 | 107 |
108 } // namespace WebCore | 108 } // namespace WebCore |
OLD | NEW |