haikuwebkit/LayoutTests/animations/body-removal-crash.html

53 lines
1.2 KiB
HTML
Raw Permalink Normal View History

2011-03-21 Dean Jackson <dino@apple.com> Reviewed by Chris Marrin and Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=56325 ASSERTION FAILED: paused() in AnimationBase::updateStateMachine() AnimationBase had a custom linked-list/self-pointer for keeping track of animations that needed to be notified of style updates and start progress. This caused problems when AnimationBase was destroyed, since the pointer wasn't managed in any way. I replaced these pointers with HashSets and moved the code that removes animations from the sets into AnimationControllerPrivate, where it belongs. CompositeAnimation is also more careful to tell AnimationControllerPrivate when it no longer needs to keep track of waiting animations. This should stop the style updates being called on non-active animations (which was the cause of the state machine error here) and should also stop a few of the related flakey test failures and occasional crashes. Test: animations/body-removal-crash.html * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::AnimationBase): (WebCore::AnimationBase::updateStateMachine): * page/animation/AnimationBase.h: (WebCore::AnimationBase::~AnimationBase): - Remove the linked-list * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::AnimationControllerPrivate): (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStyle): (WebCore::AnimationControllerPrivate::removeFromAnimationsWaitingForStyle): (WebCore::AnimationControllerPrivate::styleAvailable): (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): (WebCore::AnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): (WebCore::AnimationControllerPrivate::startTimeResponse): (WebCore::AnimationControllerPrivate::animationWillBeRemoved): - New method to remove animations from the waiting lists * page/animation/AnimationControllerPrivate.h: - use a HashSet rather than an AnimationBase* pointer. * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::~CompositeAnimation): (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): - remove the animations and transitions from the lists when we know they are no longer active (rather than waiting for the AnimationBase to do it when destructing) 2011-03-21 Dean Jackson <dino@apple.com> Reviewed by Chris Marrin and Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=56325 ASSERTION FAILED: paused() in AnimationBase::updateStateMachine() Add a test that triggers the assertion by removing the <body> element and re-inserting it. While not directly related to this bug, the transform-origin-vs-functions test would occasionally fail because it depended on the order of events being fired. The update to the way animations are keeping their state triggered this more often. Now the output is sorted before finishing the test. * animations/3d/transform-origin-vs-functions.html: * animations/body-removal-crash.html: Added. * platform/mac/animations/body-removal-crash-expected.checksum: Added. * platform/mac/animations/body-removal-crash-expected.png: Added. * platform/mac/animations/body-removal-crash-expected.txt: Added. Canonical link: https://commits.webkit.org/71453@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-21 22:05:11 +00:00
<html>
<head id="b">
<style id="a" type="text/css" media="screen">
#box {
-webkit-animation-duration: 2s;
-webkit-animation-timing-function: linear;
-webkit-animation-name: anim;
background-color: blue;
width: 100px;
height: 100px;
}
@-webkit-keyframes anim {
from { -webkit-transform: rotate(0) scale(1,1); }
to { -webkit-transform: rotate(360deg) scale(2,4); }
}
</style>
</head>
<body>
<div id="box">
</div>
<p>This should not crash</p>
</body>
</html>
<script>
var element;
function crash() {
// trigger style processing
document.alinkColor = "aaa";
// now remove the body and insert it in a different location
element = document.body;
element.parentNode.removeChild(element);
document.getElementById("a").parentNode.insertBefore(element, document.getElementById("a").nextSibling);
setTimeout(cleanup, 0);
}
function cleanup() {
document.getElementById("b").parentNode.insertBefore(element, document.getElementById("b").nextSibling);
Use testRunner instead of layoutTestController in animations tests https://bugs.webkit.org/show_bug.cgi?id=88757 Reviewed by Tony Chang. * animations/3d/change-transform-in-end-event.html: * animations/3d/replace-filling-transform.html: * animations/3d/state-at-end-event-transform.html: * animations/3d/transform-origin-vs-functions.html: * animations/animation-add-events-in-handler.html: * animations/animation-border-overflow.html: * animations/animation-controller-drt-api.html: * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-fill-mode.html: * animations/animation-drt-api-multiple-keyframes.html: * animations/animation-drt-api.html: * animations/animation-end-event-destroy-renderer.html: * animations/animation-end-event-short-iterations.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-iteration-event-destroy-renderer.html: * animations/animation-matrix-negative-scale-unmatrix.html: * animations/animation-on-inline-crash.html: * animations/animation-shorthand-overriding.html: * animations/animation-shorthand-removed.html: * animations/animation-shorthand.html: * animations/animation-start-event-destroy-renderer.html: * animations/animation-welcome-safari.html: * animations/body-removal-crash.html: * animations/change-keyframes-name.html: * animations/change-transform-style-during-animation.html: * animations/combo-transform-translate+scale.html: * animations/empty-keyframes.html: * animations/fill-mode-forwards.html: * animations/fill-mode-iteration-count-non-integer.html: * animations/fill-mode-missing-from-to-keyframes.html: * animations/fill-mode-multiple-keyframes.html: * animations/fill-mode-removed.html: * animations/fill-mode-reverse.html: * animations/fill-mode-transform.html: * animations/fill-mode.html: * animations/fill-unset-properties.html: * animations/font-size-using-ems.html-disabled: * animations/import-crash.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-iteration-count-non-integer.html: * animations/longhand-timing-function.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/pause-crash.html: * animations/resources/animation-test-helpers.js: (checkExpectedValue): (endTest): * animations/state-at-end-event.html: * animations/suspend-resume-animation-events.html: * animations/suspend-transform-animation.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: Canonical link: https://commits.webkit.org/106621@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-11 17:22:07 +00:00
if (window.testRunner)
testRunner.notifyDone();
2011-03-21 Dean Jackson <dino@apple.com> Reviewed by Chris Marrin and Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=56325 ASSERTION FAILED: paused() in AnimationBase::updateStateMachine() AnimationBase had a custom linked-list/self-pointer for keeping track of animations that needed to be notified of style updates and start progress. This caused problems when AnimationBase was destroyed, since the pointer wasn't managed in any way. I replaced these pointers with HashSets and moved the code that removes animations from the sets into AnimationControllerPrivate, where it belongs. CompositeAnimation is also more careful to tell AnimationControllerPrivate when it no longer needs to keep track of waiting animations. This should stop the style updates being called on non-active animations (which was the cause of the state machine error here) and should also stop a few of the related flakey test failures and occasional crashes. Test: animations/body-removal-crash.html * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::AnimationBase): (WebCore::AnimationBase::updateStateMachine): * page/animation/AnimationBase.h: (WebCore::AnimationBase::~AnimationBase): - Remove the linked-list * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::AnimationControllerPrivate): (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStyle): (WebCore::AnimationControllerPrivate::removeFromAnimationsWaitingForStyle): (WebCore::AnimationControllerPrivate::styleAvailable): (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): (WebCore::AnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): (WebCore::AnimationControllerPrivate::startTimeResponse): (WebCore::AnimationControllerPrivate::animationWillBeRemoved): - New method to remove animations from the waiting lists * page/animation/AnimationControllerPrivate.h: - use a HashSet rather than an AnimationBase* pointer. * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::~CompositeAnimation): (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): - remove the animations and transitions from the lists when we know they are no longer active (rather than waiting for the AnimationBase to do it when destructing) 2011-03-21 Dean Jackson <dino@apple.com> Reviewed by Chris Marrin and Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=56325 ASSERTION FAILED: paused() in AnimationBase::updateStateMachine() Add a test that triggers the assertion by removing the <body> element and re-inserting it. While not directly related to this bug, the transform-origin-vs-functions test would occasionally fail because it depended on the order of events being fired. The update to the way animations are keeping their state triggered this more often. Now the output is sorted before finishing the test. * animations/3d/transform-origin-vs-functions.html: * animations/body-removal-crash.html: Added. * platform/mac/animations/body-removal-crash-expected.checksum: Added. * platform/mac/animations/body-removal-crash-expected.png: Added. * platform/mac/animations/body-removal-crash-expected.txt: Added. Canonical link: https://commits.webkit.org/71453@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-21 22:05:11 +00:00
}
Use testRunner instead of layoutTestController in animations tests https://bugs.webkit.org/show_bug.cgi?id=88757 Reviewed by Tony Chang. * animations/3d/change-transform-in-end-event.html: * animations/3d/replace-filling-transform.html: * animations/3d/state-at-end-event-transform.html: * animations/3d/transform-origin-vs-functions.html: * animations/animation-add-events-in-handler.html: * animations/animation-border-overflow.html: * animations/animation-controller-drt-api.html: * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-fill-mode.html: * animations/animation-drt-api-multiple-keyframes.html: * animations/animation-drt-api.html: * animations/animation-end-event-destroy-renderer.html: * animations/animation-end-event-short-iterations.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-iteration-event-destroy-renderer.html: * animations/animation-matrix-negative-scale-unmatrix.html: * animations/animation-on-inline-crash.html: * animations/animation-shorthand-overriding.html: * animations/animation-shorthand-removed.html: * animations/animation-shorthand.html: * animations/animation-start-event-destroy-renderer.html: * animations/animation-welcome-safari.html: * animations/body-removal-crash.html: * animations/change-keyframes-name.html: * animations/change-transform-style-during-animation.html: * animations/combo-transform-translate+scale.html: * animations/empty-keyframes.html: * animations/fill-mode-forwards.html: * animations/fill-mode-iteration-count-non-integer.html: * animations/fill-mode-missing-from-to-keyframes.html: * animations/fill-mode-multiple-keyframes.html: * animations/fill-mode-removed.html: * animations/fill-mode-reverse.html: * animations/fill-mode-transform.html: * animations/fill-mode.html: * animations/fill-unset-properties.html: * animations/font-size-using-ems.html-disabled: * animations/import-crash.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-iteration-count-non-integer.html: * animations/longhand-timing-function.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/pause-crash.html: * animations/resources/animation-test-helpers.js: (checkExpectedValue): (endTest): * animations/state-at-end-event.html: * animations/suspend-resume-animation-events.html: * animations/suspend-transform-animation.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: Canonical link: https://commits.webkit.org/106621@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-11 17:22:07 +00:00
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
2011-03-21 Dean Jackson <dino@apple.com> Reviewed by Chris Marrin and Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=56325 ASSERTION FAILED: paused() in AnimationBase::updateStateMachine() AnimationBase had a custom linked-list/self-pointer for keeping track of animations that needed to be notified of style updates and start progress. This caused problems when AnimationBase was destroyed, since the pointer wasn't managed in any way. I replaced these pointers with HashSets and moved the code that removes animations from the sets into AnimationControllerPrivate, where it belongs. CompositeAnimation is also more careful to tell AnimationControllerPrivate when it no longer needs to keep track of waiting animations. This should stop the style updates being called on non-active animations (which was the cause of the state machine error here) and should also stop a few of the related flakey test failures and occasional crashes. Test: animations/body-removal-crash.html * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::AnimationBase): (WebCore::AnimationBase::updateStateMachine): * page/animation/AnimationBase.h: (WebCore::AnimationBase::~AnimationBase): - Remove the linked-list * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::AnimationControllerPrivate): (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStyle): (WebCore::AnimationControllerPrivate::removeFromAnimationsWaitingForStyle): (WebCore::AnimationControllerPrivate::styleAvailable): (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): (WebCore::AnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): (WebCore::AnimationControllerPrivate::startTimeResponse): (WebCore::AnimationControllerPrivate::animationWillBeRemoved): - New method to remove animations from the waiting lists * page/animation/AnimationControllerPrivate.h: - use a HashSet rather than an AnimationBase* pointer. * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::~CompositeAnimation): (WebCore::CompositeAnimation::clearRenderer): (WebCore::CompositeAnimation::updateTransitions): (WebCore::CompositeAnimation::updateKeyframeAnimations): - remove the animations and transitions from the lists when we know they are no longer active (rather than waiting for the AnimationBase to do it when destructing) 2011-03-21 Dean Jackson <dino@apple.com> Reviewed by Chris Marrin and Simon Fraser. https://bugs.webkit.org/show_bug.cgi?id=56325 ASSERTION FAILED: paused() in AnimationBase::updateStateMachine() Add a test that triggers the assertion by removing the <body> element and re-inserting it. While not directly related to this bug, the transform-origin-vs-functions test would occasionally fail because it depended on the order of events being fired. The update to the way animations are keeping their state triggered this more often. Now the output is sorted before finishing the test. * animations/3d/transform-origin-vs-functions.html: * animations/body-removal-crash.html: Added. * platform/mac/animations/body-removal-crash-expected.checksum: Added. * platform/mac/animations/body-removal-crash-expected.png: Added. * platform/mac/animations/body-removal-crash-expected.txt: Added. Canonical link: https://commits.webkit.org/71453@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-03-21 22:05:11 +00:00
}
crash();
</script>