Skip to content

Commit

Permalink
In BundleTransformer.Autoprefixer added support of Autoprefixer versi…
Browse files Browse the repository at this point in the history
…on 8.3.0.1
  • Loading branch information
Taritsyn committed Apr 26, 2018
1 parent 60bb116 commit 51120bd
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<projectUrl>https://github.com/Taritsyn/BundleTransformer</projectUrl>
<iconUrl>https://raw.githubusercontent.com/Taritsyn/BundleTransformer/master/images/icons/128/BundleTransformer_Autoprefixer_Logo_128x128.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>BundleTransformer.Autoprefixer contains one postprocessor-adapter for postprocessing of CSS code - `AutoprefixCssPostProcessor`. `AutoprefixCssPostProcessor` is based on the Andrey Sitnik's Autoprefixer (https://github.com/postcss/autoprefixer) version 8.3.
<description>BundleTransformer.Autoprefixer contains one postprocessor-adapter for postprocessing of CSS code - `AutoprefixCssPostProcessor`. `AutoprefixCssPostProcessor` is based on the Andrey Sitnik's Autoprefixer (https://github.com/postcss/autoprefixer) version 8.3.0.1.

As a JS engine is used the JavaScript Engine Switcher library (https://github.com/Taritsyn/JavaScriptEngineSwitcher). For correct working of this module, you need to install one of the following NuGet packages: JavaScriptEngineSwitcher.Msie (only in the Chakra JsRT modes), JavaScriptEngineSwitcher.V8 or JavaScriptEngineSwitcher.ChakraCore.</description>
<summary>BundleTransformer.Autoprefixer contains one postprocessor-adapter for postprocessing of CSS code - `AutoprefixCssPostProcessor`. `AutoprefixCssPostProcessor` is based on the Andrey Sitnik's Autoprefixer version 8.3.</summary>
<releaseNotes>Added support of Autoprefixer version 8.3.</releaseNotes>
<summary>BundleTransformer.Autoprefixer contains one postprocessor-adapter for postprocessing of CSS code - `AutoprefixCssPostProcessor`. `AutoprefixCssPostProcessor` is based on the Andrey Sitnik's Autoprefixer version 8.3.0.1.</summary>
<releaseNotes>Added support of Autoprefixer version 8.3.0.1.</releaseNotes>
<copyright>Copyright (c) 2012-2018 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
<language>en-US</language>
<tags>BundleTransformer System.Web.Optimization IBundleTransform ASP.NET CSS Bundling Postprocessing Postprocessor Autoprefixer</tags>
Expand Down
4 changes: 2 additions & 2 deletions NuGet/BundleTransformer.Autoprefixer/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
BundleTransformer.Autoprefixer contains one postprocessor-adapter for
postprocessing of CSS code - `AutoprefixCssPostProcessor`.
`AutoprefixCssPostProcessor` is based on the Andrey Sitnik's Autoprefixer
(https://github.com/postcss/autoprefixer) version 8.3.
(https://github.com/postcss/autoprefixer) version 8.3.0.1.

As a JS engine is used the JavaScript Engine Switcher library
(https://github.com/Taritsyn/JavaScriptEngineSwitcher).

=============
RELEASE NOTES
=============
Added support of Autoprefixer version 8.3.
Added support of Autoprefixer version 8.3.0.1.

====================
POST-INSTALL ACTIONS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ if (!Object.hasOwnProperty('assign')) {
}

/*!
* Autoprefixer v8.3
* Autoprefixer v8.3.0.1
* https://github.com/postcss/autoprefixer
* https://github.com/ai/autoprefixer-rails
*
Expand Down Expand Up @@ -9275,51 +9275,64 @@ for (var i = 0, len = code.length; i < len; ++i) {
revLookup['-'.charCodeAt(0)] = 62;
revLookup['_'.charCodeAt(0)] = 63;

function placeHoldersCount(b64) {
function getLens(b64) {
var len = b64.length;

if (len % 4 > 0) {
throw new Error('Invalid string. Length must be a multiple of 4');
}

// the number of equal signs (place holders)
// if there are two placeholders, than the two characters before it
// represent one byte
// if there is only one, then the three characters before it represent 2 bytes
// this is just a cheap hack to not do indexOf twice
return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf('=');
if (validLen === -1) validLen = len;

var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;

return [validLen, placeHoldersLen];
}

// base64 is 4/3 + up to two characters of the original data
function byteLength(b64) {
// base64 is 4/3 + up to two characters of the original data
return b64.length * 3 / 4 - placeHoldersCount(b64);
var lens = getLens(b64);
var validLen = lens[0];
var placeHoldersLen = lens[1];
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
}

function _byteLength(b64, validLen, placeHoldersLen) {
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
}

function toByteArray(b64) {
var i, l, tmp, placeHolders, arr;
var len = b64.length;
placeHolders = placeHoldersCount(b64);
var tmp;
var lens = getLens(b64);
var validLen = lens[0];
var placeHoldersLen = lens[1];

arr = new Arr(len * 3 / 4 - placeHolders);
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));

// if there are placeholders, only get up to the last complete 4 chars
l = placeHolders > 0 ? len - 4 : len;
var curByte = 0;

var L = 0;
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0 ? validLen - 4 : validLen;

for (i = 0; i < l; i += 4) {
for (var i = 0; i < len; i += 4) {
tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
arr[L++] = tmp >> 16 & 0xFF;
arr[L++] = tmp >> 8 & 0xFF;
arr[L++] = tmp & 0xFF;
arr[curByte++] = tmp >> 16 & 0xFF;
arr[curByte++] = tmp >> 8 & 0xFF;
arr[curByte++] = tmp & 0xFF;
}

if (placeHolders === 2) {
if (placeHoldersLen === 2) {
tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
arr[L++] = tmp & 0xFF;
} else if (placeHolders === 1) {
arr[curByte++] = tmp & 0xFF;
}

if (placeHoldersLen === 1) {
tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
arr[L++] = tmp >> 8 & 0xFF;
arr[L++] = tmp & 0xFF;
arr[curByte++] = tmp >> 8 & 0xFF;
arr[curByte++] = tmp & 0xFF;
}

return arr;
Expand All @@ -9343,7 +9356,6 @@ function fromByteArray(uint8) {
var tmp;
var len = uint8.length;
var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
var output = '';
var parts = [];
var maxChunkLength = 16383; // must be multiple of 3

Expand All @@ -9355,19 +9367,12 @@ function fromByteArray(uint8) {
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1];
output += lookup[tmp >> 2];
output += lookup[tmp << 4 & 0x3F];
output += '==';
parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
output += lookup[tmp >> 10];
output += lookup[tmp >> 4 & 0x3F];
output += lookup[tmp << 2 & 0x3F];
output += '=';
parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');
}

parts.push(output);

return parts.join('');
}

Expand Down Expand Up @@ -9593,7 +9598,7 @@ function resolve(queries, context) {
var array = type.select.apply(browserslist, args);
if (isExclude) {
array = array.concat(array.map(function (j) {
return j.replace(/\s\d+/, ' 0');
return j.replace(/\s[^\s]+/, ' 0');
}));
return result.filter(function (j) {
return array.indexOf(j) === -1;
Expand Down Expand Up @@ -9777,7 +9782,7 @@ browserslist.coverage = function (browsers, stats) {
return browsers.reduce(function (all, i) {
var usage = data[i];
if (usage === undefined) {
usage = data[i.replace(/ [\d.]+$/, ' 0')];
usage = data[i.replace(/ [^\s]+$/, ' 0')];
}
return all + (usage || 0);
}, 0);
Expand Down Expand Up @@ -10121,7 +10126,7 @@ var QUERIES = [{
}, {
regexp: /^dead$/i,
select: function select() {
return ['ie 10', 'ie_mob 10', 'bb 10', 'bb 7'];
return ['ie 10', 'ie_mob 10', 'bb 10', 'bb 7', 'op_mob 12.1'];
}
}, {
regexp: /^(\w+)$/i,
Expand Down

0 comments on commit 51120bd

Please sign in to comment.