Index: toolkit/components/pdfjs/content/build/pdf.mjs =================================================================== --- toolkit/components/pdfjs/content/build/pdf.mjs +++ toolkit/components/pdfjs/content/build/pdf.mjs @@ -19,12 +19,12 @@ * @licend The above is the entire license notice for the * JavaScript code in this page */ /** - * pdfjsVersion = 6.0.366 - * pdfjsBuild = 3a0932911 + * pdfjsVersion = 6.0.372 + * pdfjsBuild = 7f7b38b42 */ ;// ./src/shared/util.js const isNodeJS = false; const BBOX_INIT = [Infinity, Infinity, -Infinity, -Infinity]; @@ -1988,11 +1988,11 @@ this.#buttons.append(button); } } ;// ./src/shared/internal_evt.js -const INTERNAL_EVT = "17cc422c-e983-4519-89b8-f3ec0438401e"; +const INTERNAL_EVT = "c9183911-f3c4-4999-ab77-d0210d85331c"; const internalOpt = Object.freeze({ internal: INTERNAL_EVT }); ;// ./src/display/editor/tools.js @@ -14210,11 +14210,11 @@ }); task._worker = worker; } const docParams = { docId, - apiVersion: "6.0.366", + apiVersion: "6.0.372", data, password, disableAutoFetch, rangeChunkSize, docBaseUrl, @@ -15859,12 +15859,12 @@ this.callback(); } } } } -const version = "6.0.366"; -const build = "3a0932911"; +const version = "6.0.372"; +const build = "7f7b38b42"; ;// ./src/display/editor/color_picker.js @@ -21049,13 +21049,10 @@ return outlines; } get box() { return this.#box; } - get classNamesForOutlining() { - return ["highlightOutline"]; - } } class FreeHighlightOutliner extends FreeDrawOutliner { newFreeDrawOutline(outline, points, box, scaleFactor, innerMargin, isLTR) { return new FreeHighlightOutline(outline, points, box, scaleFactor, innerMargin, isLTR); } Index: toolkit/components/pdfjs/content/build/pdf.scripting.mjs =================================================================== --- toolkit/components/pdfjs/content/build/pdf.scripting.mjs +++ toolkit/components/pdfjs/content/build/pdf.scripting.mjs @@ -19,12 +19,12 @@ * @licend The above is the entire license notice for the * JavaScript code in this page */ /** - * pdfjsVersion = 6.0.366 - * pdfjsBuild = 3a0932911 + * pdfjsVersion = 6.0.372 + * pdfjsBuild = 7f7b38b42 */ ;// ./src/scripting_api/constants.js const Border = Object.freeze({ s: "solid", Index: toolkit/components/pdfjs/content/build/pdf.worker.mjs =================================================================== --- toolkit/components/pdfjs/content/build/pdf.worker.mjs +++ toolkit/components/pdfjs/content/build/pdf.worker.mjs @@ -19,12 +19,12 @@ * @licend The above is the entire license notice for the * JavaScript code in this page */ /** - * pdfjsVersion = 6.0.366 - * pdfjsBuild = 3a0932911 + * pdfjsVersion = 6.0.372 + * pdfjsBuild = 7f7b38b42 */ ;// ./src/shared/util.js const isNodeJS = false; const BBOX_INIT = [Infinity, Infinity, -Infinity, -Infinity]; @@ -54549,11 +54549,11 @@ } const xfa = { path: this.data.fieldName, value: value ? this.data.exportValue : "" }; - const name = Name.get(value ? this.data.exportValue : "Off"); + const name = Name.get(value ? this._onStateName : "Off"); this.setValue(dict, name, evaluator.xref, changes); dict.set("AS", name); dict.set("M", `D:${getModificationDate()}`); if (flags !== undefined) { dict.set("F", flags); @@ -54598,11 +54598,11 @@ } const xfa = { path: this.data.fieldName, value: value ? this.data.buttonValue : "" }; - const name = Name.get(value ? this.data.buttonValue : "Off"); + const name = Name.get(value ? this._onStateName : "Off"); if (value) { this.setValue(dict, name, evaluator.xref, changes); } dict.set("AS", name); dict.set("M", `D:${getModificationDate()}`); @@ -54659,10 +54659,93 @@ resources.set("Font", font); appearanceStreamDict.set("Resources", resources); this.checkedAppearance = new StringStream(appearance, appearanceStreamDict); this._streams.push(this.checkedAppearance); } + _getOnStateName(dict) { + const appearanceStates = dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return null; + } + const normalAppearance = appearanceStates.get("N"); + if (!(normalAppearance instanceof Dict)) { + return null; + } + for (const key of normalAppearance.getKeys()) { + if (key !== "Off") { + return key; + } + } + return null; + } + _getExportValueForOptIndex(index, opt, xref) { + if (Number.isInteger(index) && index >= 0 && index < opt.length) { + const value = this._decodeFormValue(xref.fetchIfRef(opt[index])); + if (typeof value === "string") { + return value; + } + } + return null; + } + _getOptInfo(dict, onState, opt, xref) { + if (!Array.isArray(opt)) { + return null; + } + const stateToIndex = new Map(); + let currentIndex = null; + const fieldParent = dict.get("Parent"); + const kids = fieldParent instanceof Dict ? fieldParent.get("Kids") : null; + if (Array.isArray(kids)) { + for (let i = 0, ii = Math.min(kids.length, opt.length); i < ii; i++) { + const kid = kids[i]; + if (kid instanceof Ref && isRefsEqual(kid, this.ref)) { + currentIndex = i; + } + const kidDict = xref.fetchIfRef(kid); + if (!(kidDict instanceof Dict)) { + continue; + } + if (kidDict === dict) { + currentIndex = i; + } + const kidOnState = this._getOnStateName(kidDict); + if (typeof kidOnState === "string" && !stateToIndex.has(kidOnState)) { + stateToIndex.set(kidOnState, i); + } + } + } else if (opt.length === 1 && typeof onState === "string") { + currentIndex = 0; + stateToIndex.set(onState, 0); + } + return { + currentIndex, + opt, + stateToIndex + }; + } + _getExportValue(state, optInfo, xref) { + if (!optInfo || typeof state !== "string" || state === "Off") { + return state; + } + if (state === this._onStateName) { + const exportValue = this._getExportValueForOptIndex(optInfo.currentIndex, optInfo.opt, xref); + if (exportValue !== null) { + return exportValue; + } + } + if (optInfo.stateToIndex.has(state)) { + const exportValue = this._getExportValueForOptIndex(optInfo.stateToIndex.get(state), optInfo.opt, xref); + if (exportValue !== null) { + return exportValue; + } + } + const index = parseInt(state, 10); + if (Number.isInteger(index) && String(index) === state) { + return this._getExportValueForOptIndex(index, optInfo.opt, xref) || state; + } + return state; + } _processCheckBox(params) { const customAppearance = params.dict.get("AP"); let normalAppearance = customAppearance instanceof Dict ? customAppearance.get("N") : null; if (!(normalAppearance instanceof Dict)) { normalAppearance = null; @@ -54687,15 +54770,24 @@ } else { const otherYes = exportValues.find(v => v !== "Off"); exportValues.length = 0; exportValues.push("Off", otherYes); } - if (!exportValues.includes(this.data.fieldValue)) { + const onState = exportValues[1]; + this._onStateName = onState; + const opt = getInheritableProperty({ + dict: params.dict, + key: "Opt" + }); + const optInfo = this._getOptInfo(params.dict, onState, opt, params.xref); + this.data.exportValue = this._getExportValue(onState, optInfo, params.xref); + if (!exportValues.includes(this.data.fieldValue) && this.data.fieldValue !== this.data.exportValue) { this.data.fieldValue = "Off"; } - this.data.exportValue = exportValues[1]; - const checkedAppearance = normalAppearance?.get(this.data.exportValue); + this.data.fieldValue = this._getExportValue(this.data.fieldValue, optInfo, params.xref); + this.data.defaultFieldValue = this._getExportValue(this.data.defaultFieldValue, optInfo, params.xref); + const checkedAppearance = normalAppearance?.get(onState); this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; const uncheckedAppearance = normalAppearance?.get("Off"); this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; if (this.checkedAppearance) { this._streams.push(this.checkedAppearance); @@ -54726,17 +54818,27 @@ } const normalAppearance = appearanceStates.get("N"); if (!(normalAppearance instanceof Dict)) { return; } + let onState = null; for (const key of normalAppearance.getKeys()) { if (key !== "Off") { - this.data.buttonValue = key; - break; - } - } - const checkedAppearance = normalAppearance.get(this.data.buttonValue); + onState = key; + break; + } + } + this._onStateName = onState; + const opt = getInheritableProperty({ + dict: params.dict, + key: "Opt" + }); + const optInfo = this._getOptInfo(params.dict, onState, opt, params.xref); + this.data.buttonValue = this._getExportValue(onState, optInfo, params.xref); + this.data.fieldValue = this._getExportValue(this.data.fieldValue, optInfo, params.xref); + this.data.defaultFieldValue = this._getExportValue(this.data.defaultFieldValue, optInfo, params.xref); + const checkedAppearance = normalAppearance.get(onState); this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; const uncheckedAppearance = normalAppearance.get("Off"); this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; if (this.checkedAppearance) { this._streams.push(this.checkedAppearance); @@ -63322,11 +63424,11 @@ const verbosity = getVerbosityLevel(); const { docId, apiVersion } = docParams; - const workerVersion = "6.0.366"; + const workerVersion = "6.0.372"; if (apiVersion !== workerVersion) { throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); } const workerHandlerName = docId + "_worker"; let handler = new MessageHandler(workerHandlerName, docId, port); @@ -63599,16 +63701,11 @@ } if (!task) { task = new WorkerTask("GetAnnotationsByType"); startWorkerTask(task); } - pagePromises.push(pdfManager.getPage(i).then(async page => { - if (!page) { - return []; - } - return page.collectAnnotationsByType(handler, task, types, annotationPromises, annotationGlobals) || []; - })); + pagePromises.push(pdfManager.getPage(i).then(page => page.collectAnnotationsByType(handler, task, types, annotationPromises, annotationGlobals))); } await Promise.all(pagePromises); const annotations = await Promise.all(annotationPromises); return annotations.filter(a => !!a); } finally { Index: toolkit/components/pdfjs/content/web/viewer-geckoview.mjs =================================================================== --- toolkit/components/pdfjs/content/web/viewer-geckoview.mjs +++ toolkit/components/pdfjs/content/web/viewer-geckoview.mjs @@ -19,12 +19,12 @@ * @licend The above is the entire license notice for the * JavaScript code in this page */ /** - * pdfjsVersion = 6.0.366 - * pdfjsBuild = 3a0932911 + * pdfjsVersion = 6.0.372 + * pdfjsBuild = 7f7b38b42 */ ;// ./web/ui_utils.js const DEFAULT_SCALE_VALUE = "auto"; const DEFAULT_SCALE = 1.0; @@ -979,11 +979,11 @@ version, XfaLayer } = globalThis.pdfjsLib; ;// ./web/internal_evt.js -const INTERNAL_EVT = "17cc422c-e983-4519-89b8-f3ec0438401e"; +const INTERNAL_EVT = "c9183911-f3c4-4999-ab77-d0210d85331c"; const internalOpt = Object.freeze({ internal: INTERNAL_EVT }); ;// ./web/pdf_link_service.js @@ -8667,11 +8667,11 @@ #viewerAlert = null; #copiedPageViews = null; #savedPageViews = null; #deletedPageNumbers = null; constructor(options) { - const viewerVersion = "6.0.366"; + const viewerVersion = "6.0.372"; if (version !== viewerVersion) { throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`); } this.container = options.container; this.viewer = options.viewer || options.container.firstElementChild; Index: toolkit/components/pdfjs/content/web/viewer.mjs =================================================================== --- toolkit/components/pdfjs/content/web/viewer.mjs +++ toolkit/components/pdfjs/content/web/viewer.mjs @@ -19,12 +19,12 @@ * @licend The above is the entire license notice for the * JavaScript code in this page */ /** - * pdfjsVersion = 6.0.366 - * pdfjsBuild = 3a0932911 + * pdfjsVersion = 6.0.372 + * pdfjsBuild = 7f7b38b42 */ ;// ./web/ui_utils.js const DEFAULT_SCALE_VALUE = "auto"; const DEFAULT_SCALE = 1.0; @@ -979,11 +979,11 @@ version, XfaLayer } = globalThis.pdfjsLib; ;// ./web/internal_evt.js -const INTERNAL_EVT = "17cc422c-e983-4519-89b8-f3ec0438401e"; +const INTERNAL_EVT = "c9183911-f3c4-4999-ab77-d0210d85331c"; const internalOpt = Object.freeze({ internal: INTERNAL_EVT }); ;// ./web/pdf_link_service.js @@ -13165,11 +13165,11 @@ #viewerAlert = null; #copiedPageViews = null; #savedPageViews = null; #deletedPageNumbers = null; constructor(options) { - const viewerVersion = "6.0.366"; + const viewerVersion = "6.0.372"; if (version !== viewerVersion) { throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`); } this.container = options.container; this.viewer = options.viewer || options.container.firstElementChild; Index: toolkit/components/pdfjs/moz.yaml =================================================================== --- toolkit/components/pdfjs/moz.yaml +++ toolkit/components/pdfjs/moz.yaml @@ -18,12 +18,12 @@ # Usually different from repository url url: https://github.com/mozilla/pdf.js # Human-readable identifier for this version/release # Generally "version NNN", "tag SSS", "bookmark SSS" - release: 3a093291135136f20babaf8d76c7dee3cc938515 (2026-06-14T19:51:42Z). - revision: 3a093291135136f20babaf8d76c7dee3cc938515 + release: 7f7b38b424a601fdccd3b306b8b085bf80ce635c (2026-06-15T19:41:10Z). + revision: 7f7b38b424a601fdccd3b306b8b085bf80ce635c # The package's license, where possible using the mnemonic from # https://spdx.org/licenses/ # Multiple licenses can be specified (as a YAML list) # A "LICENSE" file must exist containing the full license text