}
}
- // ... then `type`...
+ // ... then `position`
for (index = 0, total = values.length; index < total; index++) {
- if (validator.isListStyleTypeKeyword(values[index][1])) {
- type.value = [values[index]];
+ if (validator.isListStylePositionKeyword(values[index][1])) {
+ position.value = [values[index]];
values.splice(index, 1);
break;
}
}
- // ... and what's left is a `position`
- if (values.length > 0 && validator.isListStylePositionKeyword(values[0][1]))
- position.value = [values[0]];
+ // ... and what's left is a `type`
+ if (values.length > 0 && (validator.isListStyleTypeKeyword(values[0][1]) || validator.isIdentifier(values[0][1]))) {
+ type.value = [values[0]];
+ }
return components;
}
isFunction: isFunction,
isGlobal: isKeyword('^'),
isHslColor: isHslColor,
- isImage: isImage,
isIdentifier: isIdentifier,
+ isImage: isImage,
isKeyword: isKeyword,
isLineHeightKeyword: isKeyword('line-height'),
isListStylePositionKeyword: isKeyword('list-style-position'),
assert.equal(components[2].name, 'list-style-image');
assert.deepEqual(components[2].value, [['property-value', 'url(image.png)']]);
}
+ },
+ 'non-standard type': {
+ 'topic': function () {
+ return _breakUp([
+ [
+ 'property',
+ ['property-name', 'list-style'],
+ ['property-value', 'test']
+ ]
+ ]);
+ },
+ 'has 3 components': function (components) {
+ assert.lengthOf(components, 3);
+ },
+ 'has list-style-type': function (components) {
+ assert.equal(components[0].name, 'list-style-type');
+ assert.deepEqual(components[0].value, [['property-value', 'test']]);
+ },
+ 'has list-style-position': function (components) {
+ assert.equal(components[1].name, 'list-style-position');
+ assert.deepEqual(components[1].value, [['property-value', 'outside']]);
+ },
+ 'has list-style-image': function (components) {
+ assert.equal(components[2].name, 'list-style-image');
+ assert.deepEqual(components[2].value, [['property-value', 'none']]);
+ }
}
},
'multiple values 123': {