* Fixed issue [#247](https://github.com/GoalSmashers/clean-css/issues/247) - removes deprecated `selectorsMergeMode` switch.
* Refixed issue [#250](https://github.com/GoalSmashers/clean-css/issues/250) - based on new quotation marks removal.
+[2.1.8 / 2014-xx-xx (UNRELEASED)](https://github.com/GoalSmashers/clean-css/compare/v2.1.7...v2.1.8)
+==================
+
+* Fixed issue [#267](https://github.com/GoalSmashers/clean-css/issues/267) - incorrect non-adjacent selector merging.
+
[2.1.7 / 2014-03-24](https://github.com/GoalSmashers/clean-css/compare/v2.1.6...v2.1.7)
==================
var _reduceSelector = function(tokens, selector, data, options) {
var bodies = [];
var joinsAt = [];
+ var splitBodies = [];
var processedTokens = [];
for (var j = data.length - 1, m = 0; j >= 0; j--) {
var token = tokens[where];
var body = token.body;
bodies.push(body);
+ splitBodies.push(body.split(';'));
processedTokens.push(where);
}
for (j = 0, m = bodies.length; j < m; j++) {
if (bodies[j].length > 0)
- joinsAt.push((joinsAt[j - 1] || 0) + bodies[j].split(';').length);
+ joinsAt.push((joinsAt[j - 1] || 0) + splitBodies[j].length);
}
var optimizedBody = propertyOptimizer.process(bodies.join(';'), joinsAt, true);
var tokenIdx = processedCount - 1;
while (tokenIdx >= 0) {
- if ((tokenIdx === 0 || bodies[tokenIdx].indexOf(optimizedProperties[propertyIdx]) > -1) && propertyIdx > -1) {
+ if ((tokenIdx === 0 || splitBodies[tokenIdx].indexOf(optimizedProperties[propertyIdx]) > -1) && propertyIdx > -1) {
propertyIdx--;
continue;
}
'when same browser specific selector more than once': [
'a,::-moz-selection{color:red}p{display:block}a,::-moz-selection{color:#fff}',
'p{display:block}::-moz-selection,a{color:#fff}'
- ]
+ ],
+ 'with full property comparison': '.one{height:7rem}.two{height:auto}.one{line-height:7rem;color:red}'
}),
'rerun optimizers': cssContext({
'selectors reducible once': [