mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fully remove regex; simplify whitespace check
jshint complained about case statements w/o break (boo)
This commit is contained in:
parent
b81d7473e3
commit
7f1cbc70a8
13
src/Core.js
13
src/Core.js
@ -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];
|
||||
if(mode === 0 && whitespace.indexOf( c ) > -1){
|
||||
continue;
|
||||
}
|
||||
switch(c) {
|
||||
case ' ':
|
||||
case '\t':
|
||||
case '\n':
|
||||
case '\r':
|
||||
if(mode == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
case '(':
|
||||
if(mode === 0) {
|
||||
mode = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user