module.exports = function Optimizer(data, context, options) {
var specialSelectors = {
'*': /\-(moz|ms|o|webkit)\-/,
- 'ie8': /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:not|:target|:visited|:empty|:first\-of|:last|:nth|:only|:root)/,
- 'ie7': /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:not|:target|:visited|:empty|:first\-of|:last|:nth|:only|:root|:after|:before|:focus)/
+ 'ie8': /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:root|:nth|:first\-of|:last|:only|:empty|:target|:checked|::selection|:enabled|:disabled|:not)/,
+ 'ie7': /(\-moz\-|\-ms\-|\-o\-|\-webkit\-|:focus|:before|:after|:root|:nth|:first\-of|:last|:only|:empty|:target|:checked|::selection|:enabled|:disabled|:not)/
};
var minificationsMade = [];
teardown: function() {
this.server.close();
}
+ }),
+ 'ie7 compatibility': binaryContext('--compatibility ie7 ./test/data/unsupported/selectors-ie7.css', {
+ 'should not transform source': function(error, stdout) {
+ assert.equal(stdout, readFile('./test/data/unsupported/selectors-ie7.css'));
+ }
+ }),
+ 'ie8 compatibility': binaryContext('--compatibility ie8 ./test/data/unsupported/selectors-ie8.css', {
+ 'should not transform source': function(error, stdout) {
+ assert.equal(stdout, readFile('./test/data/unsupported/selectors-ie8.css'));
+ }
})
});
--- /dev/null
+p:focus{top:0}
+p:before{top:0}
+p:after{top:0}
+p:root{top:0}
+p:nth-of-type(1){top:0}
+p:nth-last-of-type(1){top:0}
+p:first-of-type{top:0}
+p:last-of-type{top:0}
+p:only-of-type{top:0}
+p:only-child{top:0}
+p:last-child{top:0}
+p:nth-child(1){top:0}
+p:nth-last-child(1){top:0}
+p:empty{top:0}
+p:target{top:0}
+p:checked{top:0}
+p::selection{top:0}
+input:enabled{top:0}
+input:disabled{top:0}
+p:not(.x){top:0}
--- /dev/null
+p:root{top:0}
+p:nth-of-type(1){top:0}
+p:nth-last-of-type(1){top:0}
+p:first-of-type{top:0}
+p:last-of-type{top:0}
+p:only-of-type{top:0}
+p:only-child{top:0}
+p:last-child{top:0}
+p:nth-child(1){top:0}
+p:nth-last-child(1){top:0}
+p:empty{top:0}
+p:target{top:0}
+p:checked{top:0}
+p::selection{top:0}
+input:enabled{top:0}
+input:disabled{top:0}
+p:not(.x){top:0}