fully remove regex; simplify whitespace check

jshint complained about case statements w/o break (boo)
This commit is contained in:
Andy Edinborough 2012-12-28 16:26:39 -06:00
parent b81d7473e3
commit 7f1cbc70a8

View File

@ -32,7 +32,7 @@ _html2canvas.Util.backgroundImage = function (src) {
};
_html2canvas.Util.parseBackgroundImage = function (value) {
var rxBackgroundImage = /([a-z\-]+)\((("[^"]+)|([^)]+))\)/i,
var whitespace = ' \r\n\t',
method, definition, prefix, prefix_i, block, results = [],
c, mode = 0, numParen = 0;
@ -62,15 +62,10 @@ _html2canvas.Util.parseBackgroundImage = function (value) {
appendResult();
for(var i = 0, ii = value.length; i<ii; i++) {
c = value[i];
switch(c) {
case ' ':
case '\t':
case '\n':
case '\r':
if(mode == 0){
if(mode === 0 && whitespace.indexOf( c ) > -1){
continue;
}
switch(c) {
case '(':
if(mode === 0) {
mode = 1;