Merge pull request #11943 from Snuffleupagus/cleanup-preprocessCSS

Remove unused code from the `external/builder/builder.js` file
This commit is contained in:
Tim van der Meij 2020-05-29 23:52:25 +02:00 committed by GitHub
commit 878619956b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,19 +196,9 @@ function preprocess(inFilename, outFilename, defines) {
}
exports.preprocess = preprocess;
var deprecatedInMozcentral = new RegExp(
"(^|\\W)(" + ["-moz-box-sizing", "-moz-grab", "-moz-grabbing"].join("|") + ")"
);
function preprocessCSS(mode, source, destination) {
function hasPrefixedFirefox(line) {
return /(^|\W)-(ms|o|webkit)-\w/.test(line);
}
function hasPrefixedMozcentral(line) {
return (
/(^|\W)-(ms|o|webkit)-\w/.test(line) || deprecatedInMozcentral.test(line)
);
return /(^|\W)-(ms|o|webkit)-\w/.test(line);
}
function expandImports(content, baseUrl) {
@ -275,11 +265,8 @@ function preprocessCSS(mode, source, destination) {
var content = fs.readFileSync(source, "utf8").toString();
content = expandImports(content, source);
if (mode === "mozcentral" || mode === "firefox") {
content = removePrefixed(
content,
mode === "mozcentral" ? hasPrefixedMozcentral : hasPrefixedFirefox
);
if (mode === "mozcentral") {
content = removePrefixed(content, hasPrefixedMozcentral);
}
fs.writeFileSync(destination, content);
}