Merge pull request #16999 from Snuffleupagus/issue-16994

[GeckoView] Exclude `annotation_editor_layer_builder.css` in the build (issue 16994)
This commit is contained in:
Jonas Jenwald 2023-09-21 19:26:50 +02:00 committed by GitHub
commit e9f707ce3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -42,6 +42,12 @@ function preprocess(inFilename, outFilename, defines) {
return content.replaceAll(
/^\s*@import\s+url\(([^)]+)\);\s*$/gm,
function (all, url) {
if (defines.GECKOVIEW) {
switch (url) {
case "annotation_editor_layer_builder.css":
return "";
}
}
const file = path.join(path.dirname(baseUrl), url);
const imported = fs.readFileSync(file, "utf8").toString();
return expandCssImports(imported, file);

View File

@ -1354,6 +1354,7 @@ gulp.task(
console.log();
console.log("### Building mozilla-central extension");
const defines = builder.merge(DEFINES, { MOZCENTRAL: true });
const gvDefines = builder.merge(defines, { GECKOVIEW: true });
const MOZCENTRAL_DIR = BUILD_DIR + "mozcentral/",
MOZCENTRAL_EXTENSION_DIR = MOZCENTRAL_DIR + "browser/extensions/pdfjs/",
@ -1405,7 +1406,7 @@ gulp.task(
preprocessHTML("web/viewer.html", defines).pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
),
preprocessHTML("web/viewer-geckoview.html", defines).pipe(
preprocessHTML("web/viewer-geckoview.html", gvDefines).pipe(
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
),
@ -1414,7 +1415,7 @@ gulp.task(
.pipe(replaceMozcentralCSS())
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")),
preprocessCSS("web/viewer-geckoview.css", defines)
preprocessCSS("web/viewer-geckoview.css", gvDefines)
.pipe(postcss([autoprefixer(MOZCENTRAL_AUTOPREFIXER_CONFIG)]))
.pipe(replaceMozcentralCSS())
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")),

View File

@ -15,6 +15,7 @@
@import url(text_layer_builder.css);
@import url(annotation_layer_builder.css);
@import url(xfa_layer_builder.css);
/* Ignored in GECKOVIEW builds: */
@import url(annotation_editor_layer_builder.css);
:root {