2011-07-17 01:12:35 +04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Image tests</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
|
<link href="#" type="text/css" rel="stylesheet">
|
|
|
|
|
2011-12-11 21:12:20 +04:00
|
|
|
<script type="text/javascript" src="test.js"></script>
|
2011-07-17 01:12:35 +04:00
|
|
|
<script type="text/javascript">
|
2011-12-11 21:12:20 +04:00
|
|
|
function setUp() {
|
2012-02-26 02:19:16 +04:00
|
|
|
if ($('#testcanvas')[0].getContext) {
|
|
|
|
var ctx = $('#testcanvas')[0].getContext('2d');
|
2011-11-26 22:38:55 +04:00
|
|
|
|
2012-02-26 02:19:16 +04:00
|
|
|
ctx.fillStyle = "rgb(200,0,0)";
|
|
|
|
ctx.fillRect (10, 10, 55, 50);
|
2011-11-26 22:38:55 +04:00
|
|
|
|
2012-02-26 02:19:16 +04:00
|
|
|
ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
|
|
|
|
ctx.fillRect (30, 30, 55, 50);
|
|
|
|
} else {
|
|
|
|
$('#testcanvas').remove();
|
|
|
|
}
|
2011-12-11 21:12:20 +04:00
|
|
|
};
|
2011-07-17 01:12:35 +04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
.small{
|
|
|
|
font-size:14px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.medium{
|
|
|
|
font-size:18px;
|
|
|
|
}
|
|
|
|
.large{
|
|
|
|
font-size:24px;
|
|
|
|
}
|
|
|
|
div{
|
|
|
|
float:left;
|
|
|
|
}
|
|
|
|
h2 {
|
|
|
|
clear:both;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
2011-11-26 22:38:55 +04:00
|
|
|
|
2011-07-17 01:12:35 +04:00
|
|
|
<img src="image.jpg" />
|
2011-11-26 22:38:55 +04:00
|
|
|
<img src="image.jpg" style="width:50px;height:400px;" />
|
|
|
|
<img src="image.jpg" style="width:500px;" />
|
|
|
|
<img src="image.jpg" style="width:500px;height:40px;" />
|
|
|
|
|
|
|
|
|
|
|
|
<img src="image.jpg" style="padding:20px;border:5px solid black;" />
|
|
|
|
|
|
|
|
<img src="image.jpg" style="padding-bottom:20px;border-top:5px solid black;clear:both;" />
|
|
|
|
|
|
|
|
|
|
|
|
<img src="image.jpg" style="padding-top:20px;border-top:5px solid black;clear:both;width:50px;" />
|
|
|
|
<img src="image.jpg" style="padding-top:20px;border-top:5px solid black;clear:both;width:50px;height:25px;" />
|
|
|
|
|
|
|
|
<img src="image.jpg" style="width:0px;height:0px;border:1px solid black" />
|
|
|
|
<img src="image.jpg" style="width:0px;height:0px;" />
|
2012-03-02 00:31:51 +04:00
|
|
|
|
2011-11-26 22:38:55 +04:00
|
|
|
<canvas id="testcanvas" style="width:100px;height:100px;"></canvas>
|
2012-02-26 02:19:16 +04:00
|
|
|
<br />
|
|
|
|
Image without src attribute, should not crash:
|
2011-12-22 02:00:44 +04:00
|
|
|
<img style="width:50px;height:50px;border:1px solid red;display:block;" />
|
2011-11-26 22:38:55 +04:00
|
|
|
|
2012-03-02 00:31:51 +04:00
|
|
|
SVG taints image:<br /> <!-- http://fi.wikipedia.org/wiki/Tiedosto:Svg.svg -->
|
|
|
|
<img src="image.svg" />
|
2011-07-17 01:12:35 +04:00
|
|
|
</body>
|
|
|
|
</html>
|