2008-12-03 Simon Fraser <simon.fraser@apple.com>

        Reviewed by Dave Hyatt

        Clean up and unify transition and animation test cases that destroy
        the renderer in the 'ended' event callback, either through setting display:none,
        or removing the element.

        * animations/animation-end-event-destroy-renderer-expected.txt: Added.
        * animations/animation-end-event-destroy-renderer.html: Added.
        * animations/transform-animation-event-destroy-element-expected.txt: Removed.
        * animations/transform-animation-event-destroy-element.html: Removed.
        * transitions/transform-transition-event-destroy-element-expected.txt: Removed.
        * transitions/transform-transition-event-destroy-element.html: Removed.
        * transitions/transition-end-event-destroy-renderer-expected.txt: Added.
        * transitions/transition-end-event-destroy-renderer.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3b4741c9
2008-12-03 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dave Hyatt
Clean up and unify transition and animation test cases that destroy
the renderer in the 'ended' event callback, either through setting display:none,
or removing the element.
* animations/animation-end-event-destroy-renderer-expected.txt: Added.
* animations/animation-end-event-destroy-renderer.html: Added.
* animations/transform-animation-event-destroy-element-expected.txt: Removed.
* animations/transform-animation-event-destroy-element.html: Removed.
* transitions/transform-transition-event-destroy-element-expected.txt: Removed.
* transitions/transform-transition-event-destroy-element.html: Removed.
* transitions/transition-end-event-destroy-renderer-expected.txt: Added.
* transitions/transition-end-event-destroy-renderer.html: Added.
2008-12-03 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin Adler.
......
Tests element removal and hiding within the webkitAnimationEnd event handler. Should not crash.
Did not crash, so PASSED
<html>
<head>
<title>Destroy Renderer in Animation End Event</title>
<title>Destroy and Hide Element in Animation End Event</title>
<style type="text/css" media="screen">
#box1 {
position: relative;
left: 0;
.box {
height: 100px;
width: 100px;
margin: 10px;
background-color: blue;
-webkit-animation-name: move;
-webkit-animation-duration: 0.2s;
}
......@@ -24,31 +21,49 @@
layoutTestController.waitUntilDone();
}
function transitionEnded()
var numDone = 0;
function animationEnded()
{
var box = document.getElementById('box1');
box.parentNode.removeChild(box);
if (window.layoutTestController)
layoutTestController.notifyDone();
++numDone;
if (numDone == 2) {
if (window.GCController)
GCController.collect();
document.getElementById('results').innerHTML = 'Did not crash, so PASSED';
if (window.layoutTestController)
layoutTestController.notifyDone();
}
}
function startTransition()
function startTest()
{
var box = document.getElementById('box1');
box.addEventListener("webkitAnimationEnd", transitionEnded, false);
box.style.webkitAnimationName = 'move';
var box1 = document.getElementById('box1');
box1.addEventListener('webkitAnimationEnd', function() {
box1.parentNode.removeChild(box1);
animationEnded();
}, false);
box1.style.webkitAnimationName = 'move';
var box2 = document.getElementById('box2');
box2.addEventListener('webkitAnimationEnd', function() {
box2.style.display = 'none';
animationEnded();
}, false);
box2.style.webkitAnimationName = 'move';
}
window.addEventListener('load', startTransition, false);
window.addEventListener('load', startTest, false);
</script>
</head>
<body>
<p>Test sets display:none on the element within the webkitAnimationEnd event handler. Should not crash.</p>
<p>Tests element removal and hiding within the webkitAnimationEnd event handler. Should not crash.</p>
<div id="container">
<div id="box1" class="box"></div>
<div id="box2" class="box"></div>
</div>
<div id="results"></div>
</body>
</html>
Test sets display:none on the element within the webkitAnimationEnd event handler. Should not crash.
Test sets display:none on the element within the webkitTransitionEnd event handler. Should not crash.
Tests element removal and hiding in webkitTransitionEnd event handler. Should not crash.
Did not crash, so PASSED
<html>
<head>
<title>Destroy Element in Transition End Event</title>
<title>Destroy and Hide Element in Transition End Event</title>
<style type="text/css" media="screen">
#box1 {
position: relative;
left: 0;
.box {
height: 100px;
width: 100px;
margin: 10px;
......@@ -19,31 +17,49 @@
layoutTestController.waitUntilDone();
}
var numDone = 0;
function transitionEnded()
{
var box = document.getElementById('box1');
box.parentNode.removeChild(box);
if (window.layoutTestController)
layoutTestController.notifyDone();
++numDone;
if (numDone == 2) {
if (window.GCController)
GCController.collect();
document.getElementById('results').innerHTML = 'Did not crash, so PASSED';
if (window.layoutTestController)
layoutTestController.notifyDone();
}
}
function startTransition()
function startTest()
{
var box = document.getElementById('box1');
box.addEventListener("webkitTransitionEnd", transitionEnded, false);
box.style.webkitTransform = 'translate(100px, 0)';
var box1 = document.getElementById('box1');
box1.addEventListener('webkitTransitionEnd', function() {
box1.parentNode.removeChild(box1);
transitionEnded();
}, false);
box1.style.webkitTransform = 'translate(100px, 0)';
var box2 = document.getElementById('box2');
box2.addEventListener('webkitTransitionEnd', function() {
box2.style.display = 'none';
transitionEnded();
}, false);
box2.style.webkitTransform = 'translate(100px, 0)';
}
window.addEventListener('load', startTransition, false);
window.addEventListener('load', startTest, false);
</script>
</head>
<body>
<p>Test sets display:none on the element within the webkitTransitionEnd event handler. Should not crash.</p>
<p>Tests element removal and hiding in webkitTransitionEnd event handler. Should not crash.</p>
<div id="container">
<div id="box1" class="box"></div>
<div id="box2" class="box"></div>
</div>
<div id="results"></div>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment