diff --git a/src/Generate.js b/src/Generate.js index 7ead2e3..804c44a 100644 --- a/src/Generate.js +++ b/src/Generate.js @@ -58,9 +58,9 @@ _html2canvas.Generate.Gradient = function(src, bounds) { getColors( tmp[1].substr( position.length + 2 ) ); position = position.split(' '); - for (p = 0; p < position.length; p+=1) { + for ( p = 0, len = position.length; p < len; p+=1 ) { - switch(position[p]) { + switch( position[ p ] ) { case 'top': p3 = bounds.height; break; diff --git a/src/Parse.js b/src/Parse.js index 114afff..da0e4b5 100644 --- a/src/Parse.js +++ b/src/Parse.js @@ -225,6 +225,7 @@ _html2canvas.Parse = function ( images, options ) { text, metrics, renderList, + listLen, bold = getCSS(el, "fontWeight"), font_style = getCSS(el, "fontStyle"), font_variant = getCSS(el, "fontVariant"), @@ -298,7 +299,7 @@ _html2canvas.Parse = function ( images, options ) { oldTextNode = textNode; - for (c=0; c < renderList.length; c+=1) { + for ( c=0, listLen = renderList.length; c < listLen; c+=1 ) { textValue = null;