2008-09-29 Chris Marrin <cmarrin@apple.com>

        Reviewed by Darin Adler

        Testcase for crash when parsing keyframes from an @imported
        CSS file
        https://bugs.webkit.org/show_bug.cgi?id=20855

         * animations/import-crash-expected.txt: Added.
         * animations/import-crash.html: Added.
         * animations/import-expected.txt: Added.
         * animations/import.html: Added.
         * animations/resources/keyframes.css: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9a3e3c8a
2008-09-29 Chris Marrin <cmarrin@apple.com>
Reviewed by Darin Adler
Testcase for crash when parsing keyframes from an @imported
CSS file
https://bugs.webkit.org/show_bug.cgi?id=20855
* animations/import-crash-expected.txt: Added.
* animations/import-crash.html: Added.
* animations/import-expected.txt: Added.
* animations/import.html: Added.
* animations/resources/keyframes.css: Added.
2008-09-26 Julien Chaffraix <jchaffraix@webkit.org>
Reviewed by Eric Seidel.
......
This test simply loads a sheet using @import that contains keyframes, to see if https://bugs.webkit.org/show_bug.cgi?id=20855 is fixed.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test that @import rule importing keyframes does not crash</title>
<style type="text/css"> @import "resources/keyframes.css"; </style>
<style type="text/css" media="screen">
#box {
position: absolute;
left: 0;
top: 100px;
height: 100px;
width: 100px;
background-color: blue;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
-webkit-animation-name: "anim";
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
</head>
<body>
This test simply loads a sheet using @import that contains keyframes, to see if https://bugs.webkit.org/show_bug.cgi?id=20855
is fixed.
</body>
</html>
This test performs an animation of the left property. It should stop for 100ms at 100px and 200px We test for those values 50ms after it has stopped at each position. The keyframes are imported so this tests whether they come in correctly.
PASS
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test of @import rule for importing keyframes</title>
<style type="text/css"> @import "resources/keyframes.css"; </style>
<style type="text/css" media="screen">
#box {
position: absolute;
left: 0;
top: 100px;
height: 100px;
width: 100px;
background-color: blue;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
-webkit-animation-name: "anim";
}
</style>
<script type="text/javascript" charset="utf-8">
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
result = "PASS";
const defaultTolerance = 0.2;
function isEqual(actual, desired, tolerance)
{
if (tolerance == undefined || tolerance == 0)
tolerance = defaultTolerance;
var diff = Math.abs(actual - desired);
return diff < tolerance;
}
function snapshot(which)
{
if (result != "PASS")
return;
var left = parseInt(window.getComputedStyle(document.getElementById('box')).left);
var expected = which ? 200 : 100;
if (!isEqual(left, expected))
result = "FAIL(was:"+left+", expected:"+expected+")";
}
function start()
{
setTimeout("snapshot(0)", 300);
setTimeout("snapshot(1)", 700);
window.setTimeout(function() {
document.getElementById('result').innerHTML = result;
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 800);
}
document.addEventListener('webkitAnimationStart', start, false);
</script>
</head>
<body>
This test performs an animation of the left property. It should stop for 100ms at 100px and 200px
We test for those values 50ms after it has stopped at each position. The keyframes are imported
so this tests whether they come in correctly.
<div id="box">
</div>
<div id="result">
</div>
</body>
</html>
@-webkit-keyframes "anim" {
from { left: 50px; }
20% { left: 100px; }
40% { left: 100px; }
60% { left: 200px; }
80% { left: 200px; }
to { left: 300px; }
}
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