From 8f37301d1fc15a9d91c9f5155025833338ba12f0 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 5 Feb 2023 17:56:18 +0100 Subject: [PATCH] Remove the "div-css" gulp task (PR 15968 follow-up) After the compatibility updates in PR 15968 it's no longer strictly necessary to build the `viewer.css` file in order for the *development viewer* to work in Chromium-based browsers. *Please note:* Given that Chromium-based browsers still don't support the *unprefixed* `mask-image` property the icons won't look right, however the development viewer itself works. Given that Firefox is the *primary* development target, and that running `gulp generic` locally will generate polyfilled CSS, it seems reasonable to make this simplification here. --- gulpfile.js | 28 ---------------------------- web/viewer-geckoview.js | 7 ------- web/viewer.js | 8 -------- 3 files changed, 43 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6193a7297..25b2a9068 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2004,27 +2004,6 @@ gulp.task( ) ); -gulp.task("dev-css", function createDevCSS() { - console.log(); - console.log("### Building development CSS"); - - const defines = builder.merge(DEFINES, { GENERIC: true, TESTING: true }); - const cssDir = BUILD_DIR + "dev-css/"; - - return merge([ - gulp.src("web/images/*", { base: "web/" }).pipe(gulp.dest(cssDir)), - - preprocessCSS("web/viewer.css", defines) - .pipe( - postcss([ - postcssDirPseudoClass(), - autoprefixer({ overrideBrowserslist: ["last 1 versions"] }), - ]) - ) - .pipe(gulp.dest(cssDir)), - ]); -}); - gulp.task( "dev-sandbox", gulp.series( @@ -2053,13 +2032,6 @@ gulp.task( gulp.task( "server", gulp.parallel( - function watchDevCSS() { - gulp.watch( - ["web/*.css", "web/images/*"], - { ignoreInitial: false }, - gulp.series("dev-css") - ); - }, function watchDevFitCurve() { gulp.watch( ["src/display/editor/*"], diff --git a/web/viewer-geckoview.js b/web/viewer-geckoview.js index b3beb22e5..21eb6d46b 100644 --- a/web/viewer-geckoview.js +++ b/web/viewer-geckoview.js @@ -61,13 +61,6 @@ function getViewerConfiguration() { function webViewerLoad() { const config = getViewerConfiguration(); if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) { - if (window.chrome) { - const link = document.createElement("link"); - link.rel = "stylesheet"; - link.href = "../build/dev-css/viewer.css"; - - document.head.append(link); - } window.isGECKOVIEW = true; import("pdfjs-web/genericcom.js").then(function (genericCom) { diff --git a/web/viewer.js b/web/viewer.js index aea2eb7c1..900fe5de5 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -207,14 +207,6 @@ function getViewerConfiguration() { function webViewerLoad() { const config = getViewerConfiguration(); if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) { - if (window.chrome) { - const link = document.createElement("link"); - link.rel = "stylesheet"; - link.href = "../build/dev-css/viewer.css"; - - document.head.append(link); - } - Promise.all([ import("pdfjs-web/genericcom.js"), import("pdfjs-web/pdf_print_service.js"),