Skip to content

Commit

Permalink
Merge pull request #18988 from Snuffleupagus/split-dom-factory
Browse files Browse the repository at this point in the history
Move the various DOM-factories into their own files
  • Loading branch information
timvandermeij authored Nov 2, 2024
2 parents e930f30 + 4e12906 commit 3634dab
Show file tree
Hide file tree
Showing 24 changed files with 1,038 additions and 919 deletions.
12 changes: 12 additions & 0 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ function createWebpackAlias(defines) {
"fluent-dom": "node_modules/@fluent/dom/esm/index.js",
};
const libraryAlias = {
"display-cmap_reader_factory": "src/display/stubs.js",
"display-standard_fontdata_factory": "src/display/stubs.js",
"display-fetch_stream": "src/display/stubs.js",
"display-network": "src/display/stubs.js",
"display-node_stream": "src/display/stubs.js",
Expand Down Expand Up @@ -219,6 +221,10 @@ function createWebpackAlias(defines) {
};

if (defines.CHROME) {
libraryAlias["display-cmap_reader_factory"] =
"src/display/cmap_reader_factory.js";
libraryAlias["display-standard_fontdata_factory"] =
"src/display/standard_fontdata_factory.js";
libraryAlias["display-fetch_stream"] = "src/display/fetch_stream.js";
libraryAlias["display-network"] = "src/display/network.js";

Expand All @@ -231,6 +237,10 @@ function createWebpackAlias(defines) {
// Aliases defined here must also be replicated in the paths section of
// the tsconfig.json file for the type generation to work.
// In the tsconfig.json files, the .js extension must be omitted.
libraryAlias["display-cmap_reader_factory"] =
"src/display/cmap_reader_factory.js";
libraryAlias["display-standard_fontdata_factory"] =
"src/display/standard_fontdata_factory.js";
libraryAlias["display-fetch_stream"] = "src/display/fetch_stream.js";
libraryAlias["display-network"] = "src/display/network.js";
libraryAlias["display-node_stream"] = "src/display/node_stream.js";
Expand Down Expand Up @@ -1573,6 +1583,8 @@ function buildLibHelper(bundleDefines, inputStream, outputDir) {
defines: bundleDefines,
map: {
"pdfjs-lib": "../pdf.js",
"display-cmap_reader_factory": "./cmap_reader_factory.js",
"display-standard_fontdata_factory": "./standard_fontdata_factory.js",
"display-fetch_stream": "./fetch_stream.js",
"display-network": "./network.js",
"display-node_stream": "./node_stream.js",
Expand Down
7 changes: 2 additions & 5 deletions src/display/annotation_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ import {
Util,
warn,
} from "../shared/util.js";
import {
DOMSVGFactory,
PDFDateString,
setLayerDimensions,
} from "./display_utils.js";
import { PDFDateString, setLayerDimensions } from "./display_utils.js";
import { AnnotationStorage } from "./annotation_storage.js";
import { ColorConverters } from "../shared/scripting_utils.js";
import { DOMSVGFactory } from "./svg_factory.js";
import { XfaLayer } from "./xfa_layer.js";

const DEFAULT_TAB_INDEX = 1000;
Expand Down
8 changes: 4 additions & 4 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ import {
} from "./annotation_storage.js";
import {
deprecated,
DOMCanvasFactory,
DOMCMapReaderFactory,
DOMFilterFactory,
DOMStandardFontDataFactory,
isDataScheme,
isValidFetchUrl,
PageViewport,
Expand All @@ -64,6 +60,10 @@ import {
NodeStandardFontDataFactory,
} from "display-node_utils";
import { CanvasGraphics } from "./canvas.js";
import { DOMCanvasFactory } from "./canvas_factory.js";
import { DOMCMapReaderFactory } from "display-cmap_reader_factory";
import { DOMFilterFactory } from "./filter_factory.js";
import { DOMStandardFontDataFactory } from "display-standard_fontdata_factory";
import { GlobalWorkerOptions } from "./worker_options.js";
import { MessageHandler } from "../shared/message_handler.js";
import { Metadata } from "./metadata.js";
Expand Down
234 changes: 0 additions & 234 deletions src/display/base_factory.js

This file was deleted.

Loading

0 comments on commit 3634dab

Please sign in to comment.