Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated tests

  • Loading branch information...
commit c04311f88057be620bf69660d0ea88631fffcbd4 1 parent 58529a0
@niklasvh authored
Showing with 185 additions and 16 deletions.
  1. +173 −4 tests/background.html
  2. +7 −11 tests/origin.html
  3. +5 −1 tests/test.js
View
177 tests/background.html
@@ -10,7 +10,12 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="test.js"></script>
<style>
-
+ html {
+ background-color: red;
+ }
+ body {
+ background-color: lime;
+ }
.small div{
width:100px;
height:100px;
@@ -49,6 +54,156 @@
.linearGradient2 {
background: -webkit-gradient(linear, 0% 0, 0% 100%, from(rgb(252, 252, 252)), to(rgb(232, 232, 232)));
}
+
+ .linearGradient3 {
+ /* FF 3.6+ */
+ background: -moz-linear-gradient(left, #ff0000, #ffff00, #00ff00);
+ /* Chrome,Safari4+ */
+ background: -webkit-gradient(linear, left top, right top, color-stop(#ff0000), color-stop(#ffff00), color-stop(#00ff00));
+ /* Chrome 10+, Safari 5.1+ */
+ background: -webkit-linear-gradient(left, #ff0000, #ffff00, #00ff00);
+ /* Opera 11.10+ */
+ background: -o-linear-gradient(left, #ff0000, #ffff00, #00ff00);
+ /* IE 10+ */
+ background: -ms-linear-gradient(left, #ff0000, #ffff00, #00ff00);
+ /* W3C */
+ background: linear-gradient(left, #ff0000, #ffff00, #00ff00);
+ }
+
+ .linearGradient4 {
+ /* FF 3.6+ */
+ background: -moz-linear-gradient(left, #cedbe9 0%, #aac5de 17%, #6199c7 50%, #3a84c3 51%, #419ad6 59%, #4bb8f0 71%, #3a8bc2 84%, #26558b 100%);
+ /* Chrome, Safari 4+ */
+ background: -webkit-gradient(linear, left top, right top, color-stop(0%, #cedbe9), color-stop(17%, #aac5de), color-stop(50%, #6199c7), color-stop(51%, #3a84c3), color-stop(59%, #419ad6), color-stop(71%, #4bb8f0), color-stop(84%, #3a8bc2), color-stop(100%, #26558b));
+ /* Chrome 10+, Safari 5.1+ */
+ background: -webkit-linear-gradient(left, #cedbe9 0%, #aac5de 17%, #6199c7 50%, #3a84c3 51%, #419ad6 59%, #4bb8f0 71%, #3a8bc2 84%, #26558b 100%);
+ /* Opera 11.10+ */
+ background: -o-linear-gradient(left, #cedbe9 0%, #aac5de 17%, #6199c7 50%, #3a84c3 51%, #419ad6 59%, #4bb8f0 71%, #3a8bc2 84%, #26558b 100%);
+ /* IE10+ */
+ background: -ms-linear-gradient(left, #cedbe9 0%, #aac5de 17%, #6199c7 50%, #3a84c3 51%, #419ad6 59%, #4bb8f0 71%, #3a8bc2 84%, #26558b 100%);
+ /* W3C */
+ background: linear-gradient(left, #cedbe9 0%, #aac5de 17%, #6199c7 50%, #3a84c3 51%, #419ad6 59%, #4bb8f0 71%, #3a8bc2 84%, #26558b 100%);
+ }
+
+ .linearGradient5 {
+ /* FF 3.6+ */
+ background: -moz-linear-gradient(top, #f0b7a1 0%, #8c3310 50%, #752201 51%, #bf6e4e 100%);
+ /* Chrome, Safari 4+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f0b7a1), color-stop(50%, #8c3310), color-stop(51%, #752201), color-stop(100%, #bf6e4e));
+ /* Chrome 10+, Safari 5.1+ */
+ background: -webkit-linear-gradient(top, #f0b7a1 0%, #8c3310 50%, #752201 51%, #bf6e4e 100%);
+ /* Opera 11.10+ */
+ background: -o-linear-gradient(top, #f0b7a1 0%, #8c3310 50%, #752201 51%, #bf6e4e 100%);
+ /* IE 10+ */
+ background: -ms-linear-gradient(top, #f0b7a1 0%, #8c3310 50%, #752201 51%, #bf6e4e 100%);
+ /* W3C */
+ background: linear-gradient(top, #f0b7a1 0%, #8c3310 50%, #752201 51%, #bf6e4e 100%);
+ }
+
+ .radialGradient {
+ /* FF 3.6+ */
+ background: -moz-radial-gradient(center, ellipse cover, #959595 0%, #0d0d0d 48%, #2f7bd8 50%, #0a0a0a 64%, #4e4e4e 80%, #383838 87%, #1b1b1b 100%);
+ /* Chrome, Safari 4+ */
+ background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,#959595), color-stop(48%,#0d0d0d), color-stop(50%,#2f7bd8), color-stop(64%,#0a0a0a), color-stop(80%,#4e4e4e), color-stop(87%,#383838), color-stop(100%,#1b1b1b));
+ /* Chrome 10+, Safari 5.1+ */
+ background: -webkit-radial-gradient(center, ellipse cover, #959595 0%, #0d0d0d 48%,#2f7bd8 50%,#0a0a0a 64%,#4e4e4e 80%,#383838 87%,#1b1b1b 100%);
+ /* Opera 12+ */
+ background: -o-radial-gradient(center, ellipse cover, #959595 0%, #0d0d0d 48%,#2f7bd8 50%,#0a0a0a 64%,#4e4e4e 80%,#383838 87%,#1b1b1b 100%);
+ /* IE 10+ */
+ background: -ms-radial-gradient(center, ellipse cover, #959595 0%,#0d0d0d 48%,#2f7bd8 50%,#0a0a0a 64%,#4e4e4e 80%,#383838 87%,#1b1b1b 100%);
+ /* W3C */
+ background: radial-gradient(center, ellipse cover, #959595 0%,#0d0d0d 48%,#2f7bd8 50%,#0a0a0a 64%,#4e4e4e 80%,#383838 87%,#1b1b1b 100%);
+ }
+
+ .radialGradient2 {
+ /* thx to https://twitter.com/#!/markjmclaren/status/13067366701 */
+
+ background-color: #FFF;
+
+ background-image:
+ -webkit-gradient(radial, 45 45, 10, 52 50, 30, from(#A7D30C), to(rgba(1,159,98,0)), color-stop(90%, #019F62)),
+ -webkit-gradient(radial, 105 105, 20, 112 120, 50, from(#ff5f98), to(rgba(255,1,136,0)), color-stop(75%, #ff0188)),
+ -webkit-gradient(radial, 95 15, 15, 102 20, 40, from(#00c9ff), to(rgba(0,201,255,0)), color-stop(80%, #00b5e2)),
+ -webkit-gradient(radial, 0 150, 50, 0 140, 90, from(#f4f201), to(rgba(228, 199,0,0)), color-stop(80%, #e4c700));
+
+ background-image:
+ -moz-radial-gradient(42px 42px, circle farthest-corner, #A7D30C 0%, #A7D30C 3%, rgba(1,159,98,0) 11%),
+ -moz-radial-gradient(45px 45px, circle farthest-corner, #019F62 0%, #019F62 13%, rgba(255,255,255,0) 16%, rgba(255,255,255,0) 100%),
+
+ -moz-radial-gradient(102px 102px, circle farthest-corner, #ff5f98 0%, #ff5f98 15%, rgba(255,1,136,0) 27%),
+ -moz-radial-gradient(105px 105px, circle farthest-corner, #FF0188 0%, #FF0188 28%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 100%),
+
+ -moz-radial-gradient(92px 12px, circle farthest-corner, #00c9ff 0%, #00c9ff 10%, rgba(0,181,226,0) 26%),
+ -moz-radial-gradient(95px 15px, circle farthest-corner, #00b5e2 0%, #00b5e2 28%, rgba(255,255,255,0) 31%, rgba(255,255,255,0) 100%),
+
+ -moz-radial-gradient(0px 150px, circle farthest-corner, #f4f201 0%, #f4f201 25%, rgba(228,199,0,0) 45%),
+ -moz-radial-gradient(0px 150px, circle farthest-corner, #e4c700 0%, #e4c700 47%, rgba(255,255,255,0) 50%, rgba(255,255,255,0) 100%);
+ }
+
+ .radialGradient3 {
+ background: -moz-radial-gradient(75% 19%, ellipse closest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(75% 19%, ellipse closest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(75% 19%, ellipse closest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(75% 19%, ellipse closest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(75% 19%, ellipse closest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ }
+
+ .radialGradient4 {
+ background: -moz-radial-gradient(75% 19%, ellipse closest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(75% 19%, ellipse closest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(75% 19%, ellipse closest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(75% 19%, ellipse closest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(75% 19%, ellipse closest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ }
+ .radialGradient5 {
+ background: -moz-radial-gradient(75% 19%, ellipse farthest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(75% 19%, ellipse farthest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(75% 19%, ellipse farthest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(75% 19%, ellipse farthest-side, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(75% 19%, ellipse farthest-side, #ababab, #0000ff 33%,#991f1f 100%)
+ }
+ .radialGradient6 {
+ background: -moz-radial-gradient(75% 19%, ellipse farthest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(75% 19%, ellipse farthest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(75% 19%, ellipse farthest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(75% 19%, ellipse farthest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(75% 19%, ellipse farthest-corner, #ababab, #0000ff 33%,#991f1f 100%);
+ }
+ .radialGradient7 {
+ background: -moz-radial-gradient(75% 19%, circle contain, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(75% 19%, circle contain, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(75% 19%, circle contain, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(75% 19%, circle contain, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(75% 19%, circle contain, #ababab, #0000ff 33%,#991f1f 100%);
+ }
+ .radialGradient8 {
+ background: -moz-radial-gradient(75% 19%, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(75% 19%, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(75% 19%, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(75% 19%, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(75% 19%, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ }
+ .radialGradient9 {
+ background: -moz-radial-gradient(right 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(right 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(right 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(right 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(right 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ }
+ .radialGradient10 {
+ background: -moz-radial-gradient(left 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(left 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(left 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(left 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(left 19%, ellipse cover, #ababab, #0000ff 33%,#991f1f 100%);
+ }
+ .radialGradient11 {
+ background: -moz-radial-gradient(left top, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -webkit-radial-gradient(left top, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -o-radial-gradient(left top, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: -ms-radial-gradient(left top, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ background: radial-gradient(left top, circle cover, #ababab, #0000ff 33%,#991f1f 100%);
+ }
</style>
</head>
@@ -56,9 +211,23 @@
<div class="medium">
<div class="linearGradient">&nbsp;</div>
<div class="linearGradient2">&nbsp;</div>
+ <div class="linearGradient3">&nbsp;</div>
+ <div class="linearGradient4">&nbsp;</div>
+ <div class="linearGradient5">&nbsp;</div>
+ </div>
+ <div class="medium">
+ <div class="radialGradient">&nbsp;</div>
+ <div class="radialGradient2">&nbsp;</div>
+ <div class="radialGradient3">&nbsp;</div>
+ <div class="radialGradient4">&nbsp;</div>
+ <div class="radialGradient5">&nbsp;</div>
+ <div class="radialGradient6">&nbsp;</div>
+ <div class="radialGradient7">&nbsp;</div>
+ <div class="radialGradient8">&nbsp;</div>
+ <div class="radialGradient9">&nbsp;</div>
+ <div class="radialGradient10">&nbsp;</div>
+ <div class="radialGradient11">&nbsp;</div>
</div>
-
-
<div class="medium">
<div style="background:url(image.jpg);"></div>
@@ -106,4 +275,4 @@
</div>
</body>
-</html>
+</html>
View
18 tests/origin.html
@@ -1,22 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
-
- <script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
- <script type="text/javascript" src="../js/html2canvas.js"></script>
- <script type="text/javascript" src="../js/jquery.plugin.html2canvas.js"></script>
+ <script type="text/javascript" src="test.js"></script>
<script type="text/javascript">
- $(document).ready(function() {
- $('#bar').html2canvas();
- // var ss = $('ul').offset();
- // alert(ss.left);
- });
+ function setUp(){
+ h2cSelector = '#bar';
+ }
+
</script>
<title>
- display/box/float/clear test
+ display/box/float/clear test
</title>
<style type="text/css">
- /* last modified: 1 Dec 98 */
+ /* last modified: 1 Dec 98 */
html {
font: 10px/1 Verdana, sans-serif;
View
6 tests/test.js
@@ -5,6 +5,7 @@
Released under MIT License
*/
+var h2cSelector, h2cOptions;
(function(document, window) {
var scrStart = '<script type="text/javascript" src="', scrEnd = '"></script>';
document.write(scrStart + '../js/jquery-1.7.1.js' + scrEnd);
@@ -13,11 +14,14 @@
document.write(scrStart + '../js/' + html2canvas[i] + '.js' + scrEnd);
}
window.onload = function() {
+
+ h2cSelector = [document.body];
+
if (window.setUp) {
window.setUp();
}
setTimeout(function() {
- $(document.body).html2canvas({
+ $(h2cSelector).html2canvas({
flashcanvas: "../external/flashcanvas.min.js",
logging: true,
profile: true,
Please sign in to comment.
Something went wrong with that request. Please try again.