(str, compare)
| 235 | } |
| 236 | |
| 237 | function parseTransform(str, compare) { |
| 238 | var result, list = [false, str]; |
| 239 | do { |
| 240 | // pull out the next "component" of the transform (ex. "translate(10px, 20px)") |
| 241 | result = s.TRANSFORM_RE.exec(str); |
| 242 | if (!result) { break; } |
| 243 | if (result[3] === "*") { |
| 244 | // reuse previous value: |
| 245 | list.push(compare[list.length]); |
| 246 | continue; |
| 247 | } |
| 248 | var component = [result[1]], compareComp = compare && compare[list.length]; |
| 249 | |
| 250 | // check that the operation type matches (ex. "translate" vs "rotate"): |
| 251 | if (compare && (!compareComp || component[0] !== compareComp[0])) { console.log("transforms don't match: ",component[0],compareComp[0]); compare=null; } // component doesn't match |
| 252 | |
| 253 | parseMulti(result[2], compareComp, component); |
| 254 | |
| 255 | list.push(component); |
| 256 | } while(true); |
| 257 | |
| 258 | list[0] = !!compare; |
| 259 | return list; |
| 260 | } |
| 261 | |
| 262 | // this was separated so that it can be used for other multi element styles in the future |
| 263 | // ex. transform-origin, border, etc. |
no test coverage detected