'a:nth-of-type(1){color:red}b{color:red}',
'a:nth-of-type(1),b{color:red}'
],
+ 'rules with well-supported pseudo classes should be merged #3': [
+ 'a:first-of-type{color:red}b{color:red}',
+ 'a:first-of-type,b{color:red}'
+ ],
+ 'rules with well-supported pseudo classes should be merged #4': [
+ 'a:first-child{color:red}b{color:red}',
+ 'a:first-child,b{color:red}'
+ ],
'rules with prefixed pseudo classes should not be merged #1': [
'a:-moz-full-screen{color:red}b{color:red}',
'a:-moz-full-screen{color:red}b{color:red}'
'rules with not-so-well-supported pseudo classes should not be merged #3': [
'a:right{color:red}b{color:red}',
'a:right{color:red}b{color:red}'
+ ],
+ 'rules with not-so-well-supported pseudo classes should not be merged #4': [
+ 'a:first{color:red}b{color:red}',
+ 'a:first{color:red}b{color:red}'
]
}),
'complex granular properties': cssContext({
assert.isTrue(options.properties.merging);
assert.isTrue(options.units.rem);
assert.isTrue(options.colors.opacity);
- assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\((ltr|rtl)\)|:first|:fullscreen|:left|:read-only|:read-write|:right)/);
+ assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\([a-z-]*\)|:first(?![a-z-])|:fullscreen|:left|:read-only|:read-write|:right)/);
}
},
'not given': {
assert.isTrue(options.properties.merging);
assert.isFalse(options.units.rem);
assert.isTrue(options.colors.opacity);
- assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\((ltr|rtl)\)|:first|:fullscreen|:left|:read-only|:read-write|:right)/);
+ assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\([a-z-]*\)|:first(?![a-z-])|:fullscreen|:left|:read-only|:read-write|:right)/);
}
}
})
assert.isTrue(options.properties.merging);
assert.isTrue(options.units.rem);
assert.isTrue(options.colors.opacity);
- assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\((ltr|rtl)\)|:first|:fullscreen|:left|:read-only|:read-write|:right)/);
+ assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\([a-z-]*\)|:first(?![a-z-])|:fullscreen|:left|:read-only|:read-write|:right)/);
}
},
'as a complex string value without group': {
assert.isTrue(options.properties.merging);
assert.isFalse(options.units.rem);
assert.isTrue(options.colors.opacity);
- assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\((ltr|rtl)\)|:first|:fullscreen|:left|:read-only|:read-write|:right)/);
+ assert.deepEqual(options.selectors.special, /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:dir\([a-z-]*\)|:first(?![a-z-])|:fullscreen|:left|:read-only|:read-write|:right)/);
}
}
})