Autoprefixer: Autoprefixer duplicates `-ms-interpolation-mode` declaration

Created on 25 Mar 2016  路  3Comments  路  Source: postcss/autoprefixer

Given the following input:

canvas {
    -ms-interpolation-mode: nearest-neighbor; /* IE */
    image-rendering: -webkit-optimize-contrast; /* Old Android, Safari, UC Browser */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
    image-rendering: pixelated; /* Chrome & Opera */
}

Actual Autoprefixer output (with default settings):

canvas {
    -ms-interpolation-mode: nearest-neighbor; /* IE */
    image-rendering: -webkit-optimize-contrast; /* Old Android, Safari, UC Browser */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
    -ms-interpolation-mode: nearest-neighbor;
        image-rendering: pixelated; /* Chrome & Opera */
}

Note that -ms-interpolation-mode: nearest-neighbor; is now duplicated.

Simple test case to reproduce the issue:

// `npm i autoprefixer postcss`
'use strict';
const autoprefixer = require('autoprefixer');
const postcss = require('postcss');

const plugin = autoprefixer();

const css = `
canvas {
    -ms-interpolation-mode: nearest-neighbor; /* IE */
    image-rendering: -webkit-optimize-contrast; /* Old Android, Safari, UC Browser */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* Safari */
    image-rendering: pixelated; /* Chrome & Opera */
}
`;

postcss([ autoprefixer ]).process(css).then(function(result) {
    result.warnings().forEach(function(warn) {
        console.warn(warn.toString());
    });
    console.log(result.css);
});
bug

Most helpful comment

Released in 6.3.5

All 3 comments

Thanks. I will try to fix it on this weekend.

Done 01476c9

Released in 6.3.5

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KeviinCosmos picture KeviinCosmos  路  3Comments

plesiecki picture plesiecki  路  4Comments

flying-sheep picture flying-sheep  路  4Comments

JakeStanger picture JakeStanger  路  3Comments

umakantp picture umakantp  路  5Comments