mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Cargoify servo
This commit is contained in:
parent
db2f642c32
commit
c6ab60dbfc
1761 changed files with 8423 additions and 2294 deletions
38
tests/html/longcat.html
Normal file
38
tests/html/longcat.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
p { margin: 0px; fonts-size: 0px }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p><img src="longcattop.png"/></p>
|
||||
<p><img src="longcatmid.png"/></p>
|
||||
<p><img src="longcatbot.png"/></p>
|
||||
<script>
|
||||
var longcats = window.document.getElementsByTagName("img");
|
||||
var longcat_top = longcats[0];
|
||||
var longcat_mid = longcats[1];
|
||||
var longcat_bot = longcats[2];
|
||||
|
||||
function wait_for_img_load(f) {
|
||||
if (longcat_top.width != 0 && longcat_mid.width != 0 && longcat_bot.width != 0) {
|
||||
f();
|
||||
} else {
|
||||
window.setTimeout(function() { wait_for_img_load(f) }, 1);
|
||||
}
|
||||
}
|
||||
|
||||
wait_for_img_load(function() {
|
||||
var count = 0;
|
||||
function elongate() {
|
||||
var height = Math.round((Math.cos(count + Math.PI) + 1) * 100 + 20);
|
||||
count += 0.2;
|
||||
longcat_mid.height = height;
|
||||
longcat_mid.width = 600;
|
||||
window.setTimeout(function() { elongate() }, 50);
|
||||
}
|
||||
elongate();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue