Merge pull request #14676 from Snuffleupagus/preprocessCSS-cleanup
Remove the custom `grab`/`grabbing` cursor image files
This commit is contained in:
commit
82770e0655
32
gulpfile.js
32
gulpfile.js
@ -63,7 +63,7 @@ const DIST_DIR = BUILD_DIR + "dist/";
|
|||||||
const TYPES_DIR = BUILD_DIR + "types/";
|
const TYPES_DIR = BUILD_DIR + "types/";
|
||||||
const TMP_DIR = BUILD_DIR + "tmp/";
|
const TMP_DIR = BUILD_DIR + "tmp/";
|
||||||
const TYPESTEST_DIR = BUILD_DIR + "typestest/";
|
const TYPESTEST_DIR = BUILD_DIR + "typestest/";
|
||||||
const COMMON_WEB_FILES = ["web/images/*.{png,svg,gif,cur}", "web/debugger.js"];
|
const COMMON_WEB_FILES = ["web/images/*.{png,svg,gif}", "web/debugger.js"];
|
||||||
const MOZCENTRAL_DIFF_FILE = "mozcentral.diff";
|
const MOZCENTRAL_DIFF_FILE = "mozcentral.diff";
|
||||||
|
|
||||||
const REPO = "git@github.com:mozilla/pdf.js.git";
|
const REPO = "git@github.com:mozilla/pdf.js.git";
|
||||||
@ -801,16 +801,15 @@ gulp.task("cmaps", function (done) {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
function preprocessCSS(source, mode, defines, cleanup) {
|
function preprocessCSS(source, mode, defines) {
|
||||||
const outName = getTempFile("~preprocess", ".css");
|
const outName = getTempFile("~preprocess", ".css");
|
||||||
builder.preprocessCSS(mode, source, outName);
|
builder.preprocessCSS(mode, source, outName);
|
||||||
let out = fs.readFileSync(outName).toString();
|
let out = fs.readFileSync(outName).toString();
|
||||||
fs.unlinkSync(outName);
|
fs.unlinkSync(outName);
|
||||||
if (cleanup) {
|
|
||||||
// Strip out all license headers in the middle.
|
// Strip out all license headers in the middle.
|
||||||
const reg = /\n\/\* Copyright(.|\n)*?Mozilla Foundation(.|\n)*?\*\//g;
|
const reg = /\n\/\* Copyright(.|\n)*?Mozilla Foundation(.|\n)*?\*\//g;
|
||||||
out = out.replace(reg, "");
|
out = out.replace(reg, "");
|
||||||
}
|
|
||||||
|
|
||||||
const i = source.lastIndexOf("/");
|
const i = source.lastIndexOf("/");
|
||||||
return createStringSource(source.substr(i + 1), out);
|
return createStringSource(source.substr(i + 1), out);
|
||||||
@ -849,7 +848,7 @@ function buildGeneric(defines, dir) {
|
|||||||
createStandardFontBundle().pipe(gulp.dest(dir + "web/standard_fonts")),
|
createStandardFontBundle().pipe(gulp.dest(dir + "web/standard_fonts")),
|
||||||
|
|
||||||
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
|
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
|
||||||
preprocessCSS("web/viewer.css", "generic", defines, true)
|
preprocessCSS("web/viewer.css", "generic", defines)
|
||||||
.pipe(postcss([calc(), autoprefixer(AUTOPREFIXER_CONFIG)]))
|
.pipe(postcss([calc(), autoprefixer(AUTOPREFIXER_CONFIG)]))
|
||||||
.pipe(gulp.dest(dir + "web")),
|
.pipe(gulp.dest(dir + "web")),
|
||||||
|
|
||||||
@ -925,7 +924,7 @@ function buildComponents(defines, dir) {
|
|||||||
return merge([
|
return merge([
|
||||||
createComponentsBundle(defines).pipe(gulp.dest(dir)),
|
createComponentsBundle(defines).pipe(gulp.dest(dir)),
|
||||||
gulp.src(COMPONENTS_IMAGES).pipe(gulp.dest(dir + "images")),
|
gulp.src(COMPONENTS_IMAGES).pipe(gulp.dest(dir + "images")),
|
||||||
preprocessCSS("web/pdf_viewer.css", "components", defines, true)
|
preprocessCSS("web/pdf_viewer.css", "components", defines)
|
||||||
.pipe(postcss([calc(), autoprefixer(AUTOPREFIXER_CONFIG)]))
|
.pipe(postcss([calc(), autoprefixer(AUTOPREFIXER_CONFIG)]))
|
||||||
.pipe(gulp.dest(dir)),
|
.pipe(gulp.dest(dir)),
|
||||||
]);
|
]);
|
||||||
@ -1015,7 +1014,7 @@ function buildMinified(defines, dir) {
|
|||||||
createStandardFontBundle().pipe(gulp.dest(dir + "web/standard_fonts")),
|
createStandardFontBundle().pipe(gulp.dest(dir + "web/standard_fonts")),
|
||||||
|
|
||||||
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
|
preprocessHTML("web/viewer.html", defines).pipe(gulp.dest(dir + "web")),
|
||||||
preprocessCSS("web/viewer.css", "minified", defines, true)
|
preprocessCSS("web/viewer.css", "minified", defines)
|
||||||
.pipe(postcss([calc(), autoprefixer(AUTOPREFIXER_CONFIG)]))
|
.pipe(postcss([calc(), autoprefixer(AUTOPREFIXER_CONFIG)]))
|
||||||
.pipe(gulp.dest(dir + "web")),
|
.pipe(gulp.dest(dir + "web")),
|
||||||
|
|
||||||
@ -1216,13 +1215,6 @@ gulp.task(
|
|||||||
const version = versionJSON.version,
|
const version = versionJSON.version,
|
||||||
commit = versionJSON.commit;
|
commit = versionJSON.commit;
|
||||||
|
|
||||||
// Ignore the fallback cursor images, since they're unnecessary in
|
|
||||||
// Firefox.
|
|
||||||
const MOZCENTRAL_COMMON_WEB_FILES = [
|
|
||||||
...COMMON_WEB_FILES,
|
|
||||||
"!web/images/*.cur",
|
|
||||||
];
|
|
||||||
|
|
||||||
return merge([
|
return merge([
|
||||||
createMainBundle(defines).pipe(
|
createMainBundle(defines).pipe(
|
||||||
gulp.dest(MOZCENTRAL_CONTENT_DIR + "build")
|
gulp.dest(MOZCENTRAL_CONTENT_DIR + "build")
|
||||||
@ -1240,7 +1232,7 @@ gulp.task(
|
|||||||
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
|
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
|
||||||
),
|
),
|
||||||
gulp
|
gulp
|
||||||
.src(MOZCENTRAL_COMMON_WEB_FILES, { base: "web/" })
|
.src(COMMON_WEB_FILES, { base: "web/" })
|
||||||
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")),
|
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")),
|
||||||
createCMapBundle().pipe(
|
createCMapBundle().pipe(
|
||||||
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/cmaps")
|
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/cmaps")
|
||||||
@ -1252,7 +1244,7 @@ gulp.task(
|
|||||||
preprocessHTML("web/viewer.html", defines).pipe(
|
preprocessHTML("web/viewer.html", defines).pipe(
|
||||||
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
|
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
|
||||||
),
|
),
|
||||||
preprocessCSS("web/viewer.css", "mozcentral", defines, true)
|
preprocessCSS("web/viewer.css", "mozcentral", defines)
|
||||||
.pipe(
|
.pipe(
|
||||||
postcss([
|
postcss([
|
||||||
autoprefixer({
|
autoprefixer({
|
||||||
@ -1344,7 +1336,7 @@ gulp.task(
|
|||||||
preprocessHTML("web/viewer.html", defines).pipe(
|
preprocessHTML("web/viewer.html", defines).pipe(
|
||||||
gulp.dest(CHROME_BUILD_CONTENT_DIR + "web")
|
gulp.dest(CHROME_BUILD_CONTENT_DIR + "web")
|
||||||
),
|
),
|
||||||
preprocessCSS("web/viewer.css", "chrome", defines, true)
|
preprocessCSS("web/viewer.css", "chrome", defines)
|
||||||
.pipe(
|
.pipe(
|
||||||
postcss([autoprefixer({ overrideBrowserslist: ["Chrome >= 73"] })])
|
postcss([autoprefixer({ overrideBrowserslist: ["Chrome >= 73"] })])
|
||||||
)
|
)
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 326 B |
Binary file not shown.
Before Width: | Height: | Size: 326 B |
@ -1699,7 +1699,6 @@ html[dir="rtl"] .treeItemToggler::before {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.grab-to-pan-grab {
|
.grab-to-pan-grab {
|
||||||
cursor: url("images/grab.cur"), move !important;
|
|
||||||
cursor: grab !important;
|
cursor: grab !important;
|
||||||
}
|
}
|
||||||
.grab-to-pan-grab
|
.grab-to-pan-grab
|
||||||
@ -1708,7 +1707,6 @@ html[dir="rtl"] .treeItemToggler::before {
|
|||||||
}
|
}
|
||||||
.grab-to-pan-grab:active,
|
.grab-to-pan-grab:active,
|
||||||
.grab-to-pan-grabbing {
|
.grab-to-pan-grabbing {
|
||||||
cursor: url("images/grabbing.cur"), move !important;
|
|
||||||
cursor: grabbing !important;
|
cursor: grabbing !important;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background: rgba(0, 0, 0, 0);
|
background: rgba(0, 0, 0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user