Changeset 244031 in webkit
- Timestamp:
- Apr 8, 2019, 11:49:04 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/legacy-animation-engine/animations/resume-after-page-cache.html (modified) (1 diff)
-
LayoutTests/webanimations/js-wrapper-kept-alive-expected.txt (added)
-
LayoutTests/webanimations/js-wrapper-kept-alive.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/animation/WebAnimation.cpp (modified) (1 diff)
-
Source/WebCore/animation/WebAnimation.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244029 r244031 1 2019-04-08 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event 4 https://bugs.webkit.org/show_bug.cgi?id=196118 5 <rdar://problem/46614137> 6 7 Reviewed by Chris Dumez. 8 9 Add a test that starts a short animation, sets a custom property on it, registers a "finish" event listener on it and deletes 10 the sole reference to it in the JS world before triggering garbage collection. Prior to this fix, this test would time out 11 because the JS wrapper would be garbage-collected prior to the animation completing and thus the event listener would not 12 be called. To complete successfully, this test checks that it receives the event and its target is the same animation object 13 that was originally created by checking the custom property is still set. 14 15 We also make sure that a test, which was found to have regressed with a previous version of this patch, uses the animation 16 engine that it is expected to be testing. 17 18 * legacy-animation-engine/animations/resume-after-page-cache.html: 19 * webanimations/js-wrapper-kept-alive-expected.txt: Added. 20 * webanimations/js-wrapper-kept-alive.html: Added. 21 1 22 2019-04-08 Eric Liang <ericliang@apple.com> 2 23 -
trunk/LayoutTests/legacy-animation-engine/animations/resume-after-page-cache.html
r243917 r244031 1 <!-- webkit-test-runner [ experimental:WebAnimationsCSSIntegrationEnabled=false ] --> 1 2 <style> 2 3 @-webkit-keyframes bounce { -
trunk/Source/WebCore/ChangeLog
r244029 r244031 1 2019-04-08 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event 4 https://bugs.webkit.org/show_bug.cgi?id=196118 5 <rdar://problem/46614137> 6 7 Reviewed by Chris Dumez. 8 9 Test: webanimations/js-wrapper-kept-alive.html 10 11 We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline. 12 We also need to ensure that the new implementation of hasPendingActivity() does not interfere with the ability of pages to enter the page 13 cache when running animations. 14 15 * animation/WebAnimation.cpp: 16 (WebCore::WebAnimation::canSuspendForDocumentSuspension const): 17 (WebCore::WebAnimation::stop): 18 (WebCore::WebAnimation::hasPendingActivity const): 19 * animation/WebAnimation.h: 20 1 21 2019-04-08 Eric Liang <ericliang@apple.com> 2 22 -
trunk/Source/WebCore/animation/WebAnimation.cpp
r243917 r244031 1158 1158 bool WebAnimation::canSuspendForDocumentSuspension() const 1159 1159 { 1160 return !hasPendingActivity(); 1160 // Use the base class's implementation of hasPendingActivity() since we wouldn't want the custom implementation 1161 // in this class designed to keep JS wrappers alive to interfere with the ability for a page using animations 1162 // to enter the page cache. 1163 return !ActiveDOMObject::hasPendingActivity(); 1161 1164 } 1162 1165 1163 1166 void WebAnimation::stop() 1164 1167 { 1168 ActiveDOMObject::stop(); 1165 1169 m_isStopped = true; 1166 1170 removeAllEventListeners(); 1171 } 1172 1173 bool WebAnimation::hasPendingActivity() const 1174 { 1175 // Keep the JS wrapper alive if the animation is considered relevant or could become relevant again by virtue of having a timeline. 1176 return m_timeline || m_isRelevant || ActiveDOMObject::hasPendingActivity(); 1167 1177 } 1168 1178 -
trunk/Source/WebCore/animation/WebAnimation.h
r243917 r244031 119 119 virtual void remove(); 120 120 121 bool hasPendingActivity() const final; 122 121 123 using RefCounted::ref; 122 124 using RefCounted::deref;
Note:
See TracChangeset
for help on using the changeset viewer.