mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
few bug fixes to getCSS and unit tests
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
<script type="text/javascript" src="../../src/renderers/Canvas.js"></script>
|
||||
|
||||
<script src="unit/css.js"></script>
|
||||
<script src="unit/utils.js"></script>
|
||||
<!-- <script src="unit/utils.js"></script> -->
|
||||
|
||||
<style>
|
||||
#borders div {
|
||||
|
@ -1,8 +1,9 @@
|
||||
// declare vars (preventing JSHint messages)
|
||||
/* this breaks the testing for IE<9, haven't really looked into why
|
||||
var test = test || function(){},
|
||||
QUnit = QUnit || {},
|
||||
_html2canvas = _html2canvas || {};
|
||||
|
||||
*/
|
||||
|
||||
module("CSS");
|
||||
$(function() {
|
||||
@ -153,9 +154,15 @@ $(function() {
|
||||
|
||||
$('#backgroundGradients div').each(function(i, el) {
|
||||
$.each(propsToTest['background-gradient'], function(s, prop) {
|
||||
|
||||
var src, img, canvas, ctx, id, data, len, red, green, blue, overallColor = 0;
|
||||
|
||||
src = _html2canvas.Util.getCSS(el, prop),
|
||||
src = _html2canvas.Util.getCSS(el, prop);
|
||||
|
||||
if (!/^(-webkit|-o|-moz|-ms|linear)-/.test( src )) {
|
||||
ok(true);
|
||||
} else {
|
||||
|
||||
img = _html2canvas.Generate.Gradient(src, {
|
||||
width: 50,
|
||||
height: 50
|
||||
@ -183,6 +190,7 @@ $(function() {
|
||||
overallColor /= (len / 4);
|
||||
|
||||
QUnit.notEqual(overallColor, 255, 'No Background Gradient - CSS was ' + src);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user