From: Jakub Pawlowicz Date: Wed, 23 Jul 2014 22:38:28 +0000 (+0100) Subject: Removes `fourBySpacesOrFunctions` thanks to new Splitter helper. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8b0f861d84b2d0e1256404ef7f52c1b9efe46f9f;p=clean-css.git Removes `fourBySpacesOrFunctions` thanks to new Splitter helper. --- diff --git a/lib/properties/processable.js b/lib/properties/processable.js index 53786659..d5c68edd 100644 --- a/lib/properties/processable.js +++ b/lib/properties/processable.js @@ -136,41 +136,6 @@ module.exports = (function () { breakUp.fourBySpaces = breakUp.takeCareOfFourValues(function (val) { return new Splitter(' ').split(val).filter(function (v) { return v; }); }); - // Use this for non-length values that can also contain functions - breakUp.fourBySpacesOrFunctions = breakUp.takeCareOfFourValues(function (val) { - var result = []; - var curr = ''; - var parenthesisLevel = 0; - var valLength = val.length; - - for (var i = 0; i < valLength; i++) { - var c = val[i]; - curr += c; - - if (c === '(') { - parenthesisLevel++; - } else if (c === ')') { - parenthesisLevel--; - if (parenthesisLevel === 0) { - result.push(curr.trim()); - curr = ''; - } - } else if (c === ' ' && parenthesisLevel === 0) { - curr = curr.trim(); - if (curr !== '') { - result.push(curr); - curr = ''; - } - } - } - - if (curr) { - result.push(curr.trim()); - curr = ''; - } - - return result; - }); // Breaks up a background property value breakUp.commaSeparatedMulitpleValues = function (splitfunc) { return function (token) { @@ -787,7 +752,7 @@ module.exports = (function () { 'border-bottom-color', 'border-left-color' ], { - breakUp: breakUp.fourBySpacesOrFunctions, + breakUp: breakUp.fourBySpaces, canOverride: canOverride.color, defaultValue: 'currentColor', shortestValue: 'red'