Permalink
Browse files

Removes `fourBySpacesOrFunctions` thanks to new Splitter helper.

  • Loading branch information...
1 parent de9d38f commit 8b0f861d84b2d0e1256404ef7f52c1b9efe46f9f @jakubpawlowicz committed Jul 23, 2014
Showing with 1 addition and 36 deletions.
  1. +1 −36 lib/properties/processable.js
View
37 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'

0 comments on commit 8b0f861

Please sign in to comment.