Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GeckoView] Exclude annotation_editor_layer_builder.css in the build (issue 16994) #16999

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions external/builder/builder.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down Expand Up @@ -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")
),

Expand All @@ -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")),
Expand Down
1 change: 1 addition & 0 deletions web/pdf_viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down