bug fixes

This commit is contained in:
Niklas von Hertzen 2012-03-03 21:03:59 +02:00
parent 4579fb25c6
commit 3d7a6374ad
6 changed files with 78 additions and 71 deletions

View File

@ -213,6 +213,7 @@ _html2canvas.Util.Children = function(el) {
var children;
try {
children = $(el).contents();
// children = (el.nodeName && el.nodeName.toUpperCase() === "IFRAME") ? el.contentDocument || el.contentWindow.document : Array.prototype.push.call([], el.childNodes );
} catch (ex) {
h2clog("html2canvas.Util.Children failed with exception: " + ex.message);
children = [];

View File

@ -213,12 +213,13 @@ _html2canvas.Preload = function( options ) {
// TODO Opera has no load/error event for SVG images
// Opera ninja onload's cached images
/*
window.setTimeout(function(){
if ( img.width !== 0 && imageObj.succeeded === undefined ) {
img.onload();
}
}, 100); // needs a reflow for base64 encoded images? interestingly timeout of 0 doesn't work but 1 does.
*/
}

View File

@ -59,7 +59,7 @@ _html2canvas.Renderer = function(parseQueue, options){
sortZ(parseQueue.zIndex);
if ( typeof options.renderer._create !== "function" ) {
throw Error("Invalid renderer defined");
throw new Error("Invalid renderer defined");
}
return options.renderer._create( parseQueue, options, document, queue, _html2canvas );

View File

@ -219,7 +219,7 @@ html2canvas.Renderer.Canvas = function( options ) {
return canvas;
}
}
};
return methods;

View File

@ -3,7 +3,10 @@
<head>
<script type="text/javascript" src="test.js"></script>
<script type="text/javascript">
function setUp(){
h2cSelector = '#bar';
}
</script>
<title>
display/box/float/clear test

View File

@ -14,10 +14,12 @@ var h2cSelector, h2cOptions;
document.write(scrStart + '../src/' + html2canvas[i] + '.js' + scrEnd);
}
window.onload = function() {
h2cSelector = [document.body];
if (window.setUp) {
window.setUp();
}
h2cSelector = [document.body];
setTimeout(function() {
$(h2cSelector).html2canvas($.extend({