Bug 1829638 - Update PDF.js to new version 1b79b0cd210e38aab6e3420de5fe862a1c7f56c7 r=pdfjs-reviewers,Snuffleupagus

Differential Revision: https://phabricator.services.mozilla.com/D176299
This commit is contained in:
Calixte 2023-04-24 17:42:33 +00:00
parent a493bef73e
commit 7daed634d5
12 changed files with 1112 additions and 1264 deletions

View File

@ -947,7 +947,7 @@ function getDocument(src) {
}
const fetchDocParams = {
docId,
apiVersion: '3.6.74',
apiVersion: '3.6.115',
data,
password,
disableAutoFetch,
@ -2621,9 +2621,9 @@ class InternalRenderTask {
}
}
}
const version = '3.6.74';
const version = '3.6.115';
exports.version = version;
const build = '42faecf31';
const build = '1b79b0cd2';
exports.build = build;
/***/ }),
@ -13254,8 +13254,8 @@ var _annotation_layer = __w_pdfjs_require__(26);
var _worker_options = __w_pdfjs_require__(14);
var _svg = __w_pdfjs_require__(29);
var _xfa_layer = __w_pdfjs_require__(28);
const pdfjsVersion = '3.6.74';
const pdfjsBuild = '42faecf31';
const pdfjsVersion = '3.6.115';
const pdfjsBuild = '1b79b0cd2';
})();
/******/ return __webpack_exports__;

View File

@ -4258,8 +4258,8 @@ Object.defineProperty(exports, "initSandbox", ({
}
}));
var _initialization = __w_pdfjs_require__(1);
const pdfjsVersion = '3.6.74';
const pdfjsBuild = '42faecf31';
const pdfjsVersion = '3.6.115';
const pdfjsBuild = '1b79b0cd2';
})();
/******/ return __webpack_exports__;

File diff suppressed because it is too large Load Diff

View File

@ -14,9 +14,7 @@
*/
#PDFBug,
#PDFBug input,
#PDFBug button,
#PDFBug select {
#PDFBug :is(input, button, select) {
font: message-box;
}
#PDFBug {
@ -67,8 +65,7 @@
text-align: center;
}
#PDFBug table.showText,
#PDFBug table.showText tr,
#PDFBug table.showText td {
#PDFBug table.showText :is(tr, td) {
border: 1px solid black;
padding: 1px;
}

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.969 10.059C17.262 9.766 17.737 9.766 18.03 10.059C18.323 10.352 18.323 10.827 18.03 11.12L12.15 17H11.35L5.46896 11.12C5.17596 10.827 5.17596 10.352 5.46896 10.059C5.76196 9.766 6.23696 9.766 6.52996 10.059L11 14.529V2.75C11 2.336 11.336 2 11.75 2C12.164 2 12.5 2.336 12.499 2.75V14.529L16.969 10.059ZM4.98193 19.7L5.78193 20.5H17.7169L18.5169 19.7V17.75C18.5169 17.336 18.8529 17 19.2669 17C19.6809 17 20.0169 17.336 20.0169 17.75V19.5C20.0169 20.881 18.8979 22 17.5169 22H5.98193C4.60093 22 3.48193 20.881 3.48193 19.5V17.75C3.48193 17.336 3.81793 17 4.23193 17C4.64593 17 4.98193 17.336 4.98193 17.75V19.7Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 782 B

View File

@ -38,8 +38,7 @@
z-index: 2;
}
.textLayer span,
.textLayer br {
.textLayer :is(span, br) {
color: transparent;
position: absolute;
white-space: pre;
@ -49,10 +48,6 @@
/* Only necessary in Google Chrome, see issue 14205, and most unfortunately
* the problem doesn't show up in "text" reference tests. */
.textLayer span.markedContent {
top: 0;
height: 0;
}
.textLayer .highlight {
margin: -1px;
@ -86,9 +81,6 @@
}
/* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
.textLayer br::selection {
background: transparent;
}
.textLayer .endOfContent {
display: block;
@ -122,11 +114,11 @@
--input-hover-border-color: Highlight;
--link-outline: 1.5px solid LinkText;
}
.annotationLayer .textWidgetAnnotation input:required,
.annotationLayer .textWidgetAnnotation textarea:required,
.annotationLayer .textWidgetAnnotation :is(input, textarea):required,
.annotationLayer .choiceWidgetAnnotation select:required,
.annotationLayer .buttonWidgetAnnotation.checkBox input:required,
.annotationLayer .buttonWidgetAnnotation.radioButton input:required {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input:required {
outline: 1.5px solid selectedItem;
}
@ -172,8 +164,7 @@
outline: var(--link-outline);
}
.annotationLayer .linkAnnotation > a,
.annotationLayer .buttonWidgetAnnotation.pushButton > a {
.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {
position: absolute;
font-size: 1em;
top: 0;
@ -182,8 +173,9 @@
height: 100%;
}
.annotationLayer .linkAnnotation > a:hover,
.annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
.annotationLayer
:is(.linkAnnotation, .buttonWidgetAnnotation.pushButton)
> a:hover {
opacity: 0.2;
background: rgba(255, 255, 0, 1);
box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
@ -198,11 +190,9 @@
left: 0;
}
.annotationLayer .textWidgetAnnotation input,
.annotationLayer .textWidgetAnnotation textarea,
.annotationLayer .textWidgetAnnotation :is(input, textarea),
.annotationLayer .choiceWidgetAnnotation select,
.annotationLayer .buttonWidgetAnnotation.checkBox input,
.annotationLayer .buttonWidgetAnnotation.radioButton input {
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
background-image: var(--annotation-unfocused-field-background);
border: 2px solid var(--input-unfocused-border-color);
box-sizing: border-box;
@ -213,11 +203,11 @@
width: 100%;
}
.annotationLayer .textWidgetAnnotation input:required,
.annotationLayer .textWidgetAnnotation textarea:required,
.annotationLayer .textWidgetAnnotation :is(input, textarea):required,
.annotationLayer .choiceWidgetAnnotation select:required,
.annotationLayer .buttonWidgetAnnotation.checkBox input:required,
.annotationLayer .buttonWidgetAnnotation.radioButton input:required {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input:required {
outline: 1.5px solid red;
}
@ -233,32 +223,30 @@
resize: none;
}
.annotationLayer .textWidgetAnnotation input[disabled],
.annotationLayer .textWidgetAnnotation textarea[disabled],
.annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
.annotationLayer .choiceWidgetAnnotation select[disabled],
.annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],
.annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input[disabled] {
background: none;
border: 2px solid var(--input-disabled-border-color);
cursor: not-allowed;
}
.annotationLayer .textWidgetAnnotation input:hover,
.annotationLayer .textWidgetAnnotation textarea:hover,
.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
.annotationLayer .choiceWidgetAnnotation select:hover,
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
.annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input:hover {
border: 2px solid var(--input-hover-border-color);
}
.annotationLayer .textWidgetAnnotation input:hover,
.annotationLayer .textWidgetAnnotation textarea:hover,
.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
.annotationLayer .choiceWidgetAnnotation select:hover,
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover {
border-radius: 2px;
}
.annotationLayer .textWidgetAnnotation input:focus,
.annotationLayer .textWidgetAnnotation textarea:focus,
.annotationLayer .textWidgetAnnotation :is(input, textarea):focus,
.annotationLayer .choiceWidgetAnnotation select:focus {
background: none;
border: 2px solid var(--input-focus-border-color);
@ -266,8 +254,7 @@
outline: var(--input-focus-outline);
}
.annotationLayer .buttonWidgetAnnotation.checkBox :focus,
.annotationLayer .buttonWidgetAnnotation.radioButton :focus {
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {
background-image: none;
background-color: transparent;
}
@ -283,31 +270,31 @@
outline: var(--input-focus-outline);
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
background-color: CanvasText;
content: "";
display: block;
position: absolute;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
height: 80%;
left: 45%;
width: 1px;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before {
transform: rotate(45deg);
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
transform: rotate(-45deg);
}
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
border-radius: 50%;
height: 50%;
left: 30%;
@ -331,8 +318,7 @@
width: 103%;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input,
.annotationLayer .buttonWidgetAnnotation.radioButton input {
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
appearance: none;
}
@ -522,14 +508,8 @@
outline: 1.5px solid red;
}
.xfaLayer div {
pointer-events: none;
}
.xfaLayer svg {
pointer-events: none;
}
.xfaLayer div,
.xfaLayer svg,
.xfaLayer svg * {
pointer-events: none;
}
@ -580,10 +560,7 @@
align-items: center;
}
.xfaLeft > .xfaCaption,
.xfaLeft > .xfaCaptionForCheckButton,
.xfaRight > .xfaCaption,
.xfaRight > .xfaCaptionForCheckButton {
:is(.xfaLeft, .xfaRight) > :is(.xfaCaption, .xfaCaptionForCheckButton) {
max-height: 100%;
}
@ -599,10 +576,7 @@
align-items: flex-start;
}
.xfaTop > .xfaCaption,
.xfaTop > .xfaCaptionForCheckButton,
.xfaBottom > .xfaCaption,
.xfaBottom > .xfaCaptionForCheckButton {
:is(.xfaTop, .xfaBottom) > :is(.xfaCaption, .xfaCaptionForCheckButton) {
width: 100%;
}
@ -617,16 +591,14 @@
height: 100%;
}
.xfaTextfield:focus,
.xfaSelect:focus {
:is(.xfaTextfield, .xfaSelect):focus {
background-image: none;
background-color: transparent;
outline: var(--xfa-focus-outline);
outline-offset: -1px;
}
.xfaCheckbox:focus,
.xfaRadio:focus {
:is(.xfaCheckbox, .xfaRadio):focus {
outline: var(--xfa-focus-outline);
}
@ -644,10 +616,7 @@
padding-inline: 2px;
}
.xfaTop > .xfaTextfield,
.xfaTop > .xfaSelect,
.xfaBottom > .xfaTextfield,
.xfaBottom > .xfaSelect {
:is(.xfaTop, .xfaBottom) > :is(.xfaTextfield, .xfaSelect) {
flex: 0 1 auto;
}
@ -748,12 +717,7 @@
flex: 1;
}
.xfaNonInteractive input,
.xfaNonInteractive textarea,
.xfaDisabled input,
.xfaDisabled textarea,
.xfaReadOnly input,
.xfaReadOnly textarea {
:is(.xfaNonInteractive, .xfaDisabled, .xfaReadOnly) :is(input, textarea) {
background: initial;
}
@ -889,8 +853,8 @@
resize: horizontal;
}
.annotationEditorLayer .freeTextEditor:hover:not(.selectedEditor),
.annotationEditorLayer .inkEditor:hover:not(.selectedEditor) {
.annotationEditorLayer
:is(.freeTextEditor, .inkEditor):hover:not(.selectedEditor) {
outline: var(--hover-outline);
}
@ -990,8 +954,7 @@
height: var(--viewer-container-height);
}
.pdfViewer.scrollHorizontal,
.pdfViewer.scrollWrapped,
.pdfViewer:is(.scrollHorizontal, .scrollWrapped),
.spread {
margin-inline: 3.5px;
text-align: center;
@ -1002,24 +965,18 @@
white-space: nowrap;
}
.pdfViewer.scrollHorizontal .spread,
.pdfViewer.scrollWrapped .spread {
.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .spread {
margin-inline: 0;
}
.spread .page,
.spread .dummyPage,
.pdfViewer.scrollHorizontal .page,
.pdfViewer.scrollWrapped .page,
.pdfViewer.scrollHorizontal .spread,
.pdfViewer.scrollWrapped .spread {
.spread :is(.page, .dummyPage),
.pdfViewer:is(.scrollHorizontal, .scrollWrapped) :is(.page, .spread) {
display: inline-block;
vertical-align: middle;
}
.spread .page,
.pdfViewer.scrollHorizontal .page,
.pdfViewer.scrollWrapped .page {
.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .page {
margin-inline: var(--spreadHorizontalWrapped-margin-LR);
}
@ -1041,7 +998,7 @@
height: 100%;
}
.pdfViewer .page.loadingIcon:after {
.pdfViewer .page.loadingIcon::after {
position: absolute;
top: 0;
left: 0;
@ -1058,11 +1015,11 @@
contain: strict;
}
.pdfViewer .page.loading:after {
.pdfViewer .page.loading::after {
display: block;
}
.pdfViewer .page:not(.loading):after {
.pdfViewer .page:not(.loading)::after {
transition-property: none;
display: none;
}
@ -1100,7 +1057,11 @@
--dialog-button-bg-color: rgba(12, 12, 13, 0.1);
--dialog-button-hover-bg-color: rgba(12, 12, 13, 0.3);
--toolbarButton-download-icon: url(images/toolbarButton-download.svg);
--toolbar-bg-color: #f9f9fb;
--toolbar-divider-color: #e0e0e6;
--toolbar-fg-color: #15141a;
--toolbarButton-download-icon: url(images/gv-toolbarButton-download.svg);
}
:root:dir(rtl) {
@ -1115,6 +1076,10 @@
--scrollbar-bg-color: rgba(35, 35, 39, 1);
--dialog-button-bg-color: rgba(92, 92, 97, 1);
--dialog-button-hover-bg-color: rgba(115, 115, 115, 1);
--toolbar-bg-color: #2b2a33;
--toolbar-divider-color: #5b5b66;
--toolbar-fg-color: #fbfbfe;
}
}
@ -1163,7 +1128,7 @@ body {
#viewerContainer {
overflow: auto;
position: absolute;
inset: 0;
inset: 41px 0 0;
outline: none;
}
@ -1175,13 +1140,11 @@ body {
outline: none;
}
.dialogButton:hover,
.dialogButton:focus-visible {
.dialogButton:is(:hover, :focus-visible) {
background-color: var(--dialog-button-hover-bg-color);
}
.dialogButton:hover > span,
.dialogButton:focus-visible > span {
.dialogButton:is(:hover, :focus-visible) > span {
color: var(--dialog-button-hover-color);
}
@ -1222,14 +1185,16 @@ body {
}
#floatingToolbar {
display: flex;
align-items: center;
position: absolute;
width: 40px;
height: auto;
bottom: 5%;
right: 5%;
background-color: transparent;
transition-property: opacity;
transition-duration: 400ms;
width: 100%;
height: 40px;
top: 0;
left: 0;
box-sizing: content-box;
border-block-end: solid 1px var(--toolbar-divider-color);
background-color: var(--toolbar-bg-color);
}
#floatingToolbar.show {
@ -1243,46 +1208,36 @@ body {
}
.toolbarButton {
margin: 2px;
padding: 8px;
border-style: solid;
border-width: 1px;
border-color: transparent;
border-radius: 19px;
display: flex;
align-items: center;
border-style: none;
user-select: none;
box-sizing: border-box;
background-color: transparent;
backdrop-filter: blur(20px) contrast(100%) invert(100%);
width: 38px;
height: 38px;
width: auto;
height: auto;
outline: none;
position: relative;
}
.toolbarButton > span {
display: inline-block;
width: 0;
height: 0;
color: var(--toolbar-fg-color);
width: auto;
height: auto;
overflow: hidden;
}
.toolbarButton[disabled],
.dialogButton[disabled] {
:is(.toolbarButton .dialogButton)[disabled] {
opacity: 0.5;
}
.toolbarButton::before {
display: inline-block;
width: 100%;
height: 100%;
width: 24px;
height: 24px;
content: "";
background-color: transparent;
backdrop-filter: invert(100%);
background-color: var(--toolbar-fg-color);
mask-size: cover;
}
.toolbarButton::before {
opacity: var(--toolbar-icon-opacity);
margin-inline: 12px 8px;
}
#download::before {

View File

@ -40,6 +40,12 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="mainContainer">
<div id="floatingToolbar" class="show">
<button id="download" class="toolbarButton" title="Save" tabindex="31" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span>
</button>
</div>
<div id="viewerContainer" tabindex="0">
<div id="viewer" class="pdfViewer"></div>
</div>
@ -62,11 +68,5 @@ See https://github.com/adobe-type-tools/cmap-resources
</div> <!-- outerContainer -->
<div id="floatingToolbar">
<button id="download" class="toolbarButton" title="Save" tabindex="31" data-l10n-id="save">
<span data-l10n-id="save_label">Save</span>
</button>
</div>
</body>
</html>

View File

@ -44,11 +44,14 @@ class FirefoxCom {
static requestSync(action, data) {
const request = document.createTextNode("");
document.documentElement.append(request);
const sender = document.createEvent("CustomEvent");
sender.initCustomEvent("pdf.js.message", true, false, {
action,
data,
sync: true
const sender = new CustomEvent("pdf.js.message", {
bubbles: true,
cancelable: false,
detail: {
action,
data,
sync: true
}
});
request.dispatchEvent(sender);
const response = sender.detail.response;
@ -72,12 +75,15 @@ class FirefoxCom {
});
}
document.documentElement.append(request);
const sender = document.createEvent("CustomEvent");
sender.initCustomEvent("pdf.js.message", true, false, {
action,
data,
sync: false,
responseExpected: !!callback
const sender = new CustomEvent("pdf.js.message", {
bubbles: true,
cancelable: false,
detail: {
action,
data,
sync: false,
responseExpected: !!callback
}
});
request.dispatchEvent(sender);
}
@ -3515,7 +3521,7 @@ exports.EventBus = EventBus;
class AutomationEventBus extends EventBus {
dispatch(eventName, data) {
super.dispatch(eventName, data);
const details = Object.create(null);
const detail = Object.create(null);
if (data) {
for (const key in data) {
const value = data[key];
@ -3525,11 +3531,14 @@ class AutomationEventBus extends EventBus {
}
continue;
}
details[key] = value;
detail[key] = value;
}
}
const event = document.createEvent("CustomEvent");
event.initCustomEvent(eventName, true, true, details);
const event = new CustomEvent(eventName, {
bubbles: true,
cancelable: true,
detail
});
document.dispatchEvent(event);
}
}
@ -6065,7 +6074,7 @@ class PDFViewer {
#onVisibilityChange = null;
#scaleTimeoutId = null;
constructor(options) {
const viewerVersion = '3.6.74';
const viewerVersion = '3.6.115';
if (_pdfjsLib.version !== viewerVersion) {
throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`);
}
@ -9291,26 +9300,16 @@ Object.defineProperty(exports, "__esModule", ({
value: true
}));
exports.Toolbar = void 0;
const TIME_BEFORE_SHOWING_TOOLBAR = 200;
class Toolbar {
#buttons;
#checkForScrollEndBound = this.#checkForScrollEnd.bind(this);
#eventBus;
#hideBound = this.#hide.bind(this);
#mainContainer;
#scrollEndTimeoutId = null;
#showBound = this.#show.bind(this);
#toolbar;
constructor(options, eventBus, _l10n) {
this.#toolbar = options.container;
this.#mainContainer = options.mainContainer;
this.#eventBus = eventBus;
this.#buttons = [{
element: options.download,
eventName: "download"
}];
this.#bindListeners(options);
this.#checkForScrollEnd();
}
setPageNumber(pageNumber, pageLabel) {}
setPagesCount(pagesCount, hasPageLabels) {}
@ -9333,24 +9332,6 @@ class Toolbar {
}
}
updateLoadingIndicatorState(loading = false) {}
#checkForScrollEnd() {
if (this.#scrollEndTimeoutId !== null) {
clearTimeout(this.#scrollEndTimeoutId);
}
this.#scrollEndTimeoutId = setTimeout(this.#showBound, TIME_BEFORE_SHOWING_TOOLBAR);
}
#show() {
this.#toolbar.classList.toggle("show", true);
this.#mainContainer.removeEventListener("scroll", this.#checkForScrollEndBound);
this.#scrollEndTimeoutId = null;
this.#mainContainer.addEventListener("scroll", this.#hideBound);
}
#hide() {
this.#toolbar.classList.toggle("show", false);
this.#mainContainer.removeEventListener("scroll", this.#hideBound);
this.#mainContainer.addEventListener("scroll", this.#checkForScrollEndBound);
this.#checkForScrollEnd();
}
}
exports.Toolbar = Toolbar;
@ -9606,8 +9587,8 @@ var _ui_utils = __webpack_require__(4);
var _app_options = __webpack_require__(6);
var _pdf_link_service = __webpack_require__(8);
var _app = __webpack_require__(3);
const pdfjsVersion = '3.6.74';
const pdfjsBuild = '42faecf31';
const pdfjsVersion = '3.6.115';
const pdfjsBuild = '1b79b0cd2';
const AppConstants = null;
exports.PDFViewerApplicationConstants = AppConstants;
window.PDFViewerApplication = _app.PDFViewerApplication;

View File

@ -38,8 +38,7 @@
z-index: 2;
}
.textLayer span,
.textLayer br {
.textLayer :is(span, br) {
color: transparent;
position: absolute;
white-space: pre;
@ -49,10 +48,6 @@
/* Only necessary in Google Chrome, see issue 14205, and most unfortunately
* the problem doesn't show up in "text" reference tests. */
.textLayer span.markedContent {
top: 0;
height: 0;
}
.textLayer .highlight {
margin: -1px;
@ -86,9 +81,6 @@
}
/* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */
.textLayer br::selection {
background: transparent;
}
.textLayer .endOfContent {
display: block;
@ -122,11 +114,11 @@
--input-hover-border-color: Highlight;
--link-outline: 1.5px solid LinkText;
}
.annotationLayer .textWidgetAnnotation input:required,
.annotationLayer .textWidgetAnnotation textarea:required,
.annotationLayer .textWidgetAnnotation :is(input, textarea):required,
.annotationLayer .choiceWidgetAnnotation select:required,
.annotationLayer .buttonWidgetAnnotation.checkBox input:required,
.annotationLayer .buttonWidgetAnnotation.radioButton input:required {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input:required {
outline: 1.5px solid selectedItem;
}
@ -172,8 +164,7 @@
outline: var(--link-outline);
}
.annotationLayer .linkAnnotation > a,
.annotationLayer .buttonWidgetAnnotation.pushButton > a {
.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a {
position: absolute;
font-size: 1em;
top: 0;
@ -182,8 +173,9 @@
height: 100%;
}
.annotationLayer .linkAnnotation > a:hover,
.annotationLayer .buttonWidgetAnnotation.pushButton > a:hover {
.annotationLayer
:is(.linkAnnotation, .buttonWidgetAnnotation.pushButton)
> a:hover {
opacity: 0.2;
background: rgba(255, 255, 0, 1);
box-shadow: 0 2px 10px rgba(255, 255, 0, 1);
@ -198,11 +190,9 @@
left: 0;
}
.annotationLayer .textWidgetAnnotation input,
.annotationLayer .textWidgetAnnotation textarea,
.annotationLayer .textWidgetAnnotation :is(input, textarea),
.annotationLayer .choiceWidgetAnnotation select,
.annotationLayer .buttonWidgetAnnotation.checkBox input,
.annotationLayer .buttonWidgetAnnotation.radioButton input {
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
background-image: var(--annotation-unfocused-field-background);
border: 2px solid var(--input-unfocused-border-color);
box-sizing: border-box;
@ -213,11 +203,11 @@
width: 100%;
}
.annotationLayer .textWidgetAnnotation input:required,
.annotationLayer .textWidgetAnnotation textarea:required,
.annotationLayer .textWidgetAnnotation :is(input, textarea):required,
.annotationLayer .choiceWidgetAnnotation select:required,
.annotationLayer .buttonWidgetAnnotation.checkBox input:required,
.annotationLayer .buttonWidgetAnnotation.radioButton input:required {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input:required {
outline: 1.5px solid red;
}
@ -233,32 +223,30 @@
resize: none;
}
.annotationLayer .textWidgetAnnotation input[disabled],
.annotationLayer .textWidgetAnnotation textarea[disabled],
.annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled],
.annotationLayer .choiceWidgetAnnotation select[disabled],
.annotationLayer .buttonWidgetAnnotation.checkBox input[disabled],
.annotationLayer .buttonWidgetAnnotation.radioButton input[disabled] {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input[disabled] {
background: none;
border: 2px solid var(--input-disabled-border-color);
cursor: not-allowed;
}
.annotationLayer .textWidgetAnnotation input:hover,
.annotationLayer .textWidgetAnnotation textarea:hover,
.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
.annotationLayer .choiceWidgetAnnotation select:hover,
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover,
.annotationLayer .buttonWidgetAnnotation.radioButton input:hover {
.annotationLayer
.buttonWidgetAnnotation:is(.checkBox, .radioButton)
input:hover {
border: 2px solid var(--input-hover-border-color);
}
.annotationLayer .textWidgetAnnotation input:hover,
.annotationLayer .textWidgetAnnotation textarea:hover,
.annotationLayer .textWidgetAnnotation :is(input, textarea):hover,
.annotationLayer .choiceWidgetAnnotation select:hover,
.annotationLayer .buttonWidgetAnnotation.checkBox input:hover {
border-radius: 2px;
}
.annotationLayer .textWidgetAnnotation input:focus,
.annotationLayer .textWidgetAnnotation textarea:focus,
.annotationLayer .textWidgetAnnotation :is(input, textarea):focus,
.annotationLayer .choiceWidgetAnnotation select:focus {
background: none;
border: 2px solid var(--input-focus-border-color);
@ -266,8 +254,7 @@
outline: var(--input-focus-outline);
}
.annotationLayer .buttonWidgetAnnotation.checkBox :focus,
.annotationLayer .buttonWidgetAnnotation.radioButton :focus {
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus {
background-image: none;
background-color: transparent;
}
@ -283,31 +270,31 @@
outline: var(--input-focus-outline);
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after,
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
background-color: CanvasText;
content: "";
display: block;
position: absolute;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before,
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
height: 80%;
left: 45%;
width: 1px;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before {
transform: rotate(45deg);
}
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after {
.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after {
transform: rotate(-45deg);
}
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before {
.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before {
border-radius: 50%;
height: 50%;
left: 30%;
@ -331,8 +318,7 @@
width: 103%;
}
.annotationLayer .buttonWidgetAnnotation.checkBox input,
.annotationLayer .buttonWidgetAnnotation.radioButton input {
.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input {
appearance: none;
}
@ -522,14 +508,8 @@
outline: 1.5px solid red;
}
.xfaLayer div {
pointer-events: none;
}
.xfaLayer svg {
pointer-events: none;
}
.xfaLayer div,
.xfaLayer svg,
.xfaLayer svg * {
pointer-events: none;
}
@ -580,10 +560,7 @@
align-items: center;
}
.xfaLeft > .xfaCaption,
.xfaLeft > .xfaCaptionForCheckButton,
.xfaRight > .xfaCaption,
.xfaRight > .xfaCaptionForCheckButton {
:is(.xfaLeft, .xfaRight) > :is(.xfaCaption, .xfaCaptionForCheckButton) {
max-height: 100%;
}
@ -599,10 +576,7 @@
align-items: flex-start;
}
.xfaTop > .xfaCaption,
.xfaTop > .xfaCaptionForCheckButton,
.xfaBottom > .xfaCaption,
.xfaBottom > .xfaCaptionForCheckButton {
:is(.xfaTop, .xfaBottom) > :is(.xfaCaption, .xfaCaptionForCheckButton) {
width: 100%;
}
@ -617,16 +591,14 @@
height: 100%;
}
.xfaTextfield:focus,
.xfaSelect:focus {
:is(.xfaTextfield, .xfaSelect):focus {
background-image: none;
background-color: transparent;
outline: var(--xfa-focus-outline);
outline-offset: -1px;
}
.xfaCheckbox:focus,
.xfaRadio:focus {
:is(.xfaCheckbox, .xfaRadio):focus {
outline: var(--xfa-focus-outline);
}
@ -644,10 +616,7 @@
padding-inline: 2px;
}
.xfaTop > .xfaTextfield,
.xfaTop > .xfaSelect,
.xfaBottom > .xfaTextfield,
.xfaBottom > .xfaSelect {
:is(.xfaTop, .xfaBottom) > :is(.xfaTextfield, .xfaSelect) {
flex: 0 1 auto;
}
@ -748,12 +717,7 @@
flex: 1;
}
.xfaNonInteractive input,
.xfaNonInteractive textarea,
.xfaDisabled input,
.xfaDisabled textarea,
.xfaReadOnly input,
.xfaReadOnly textarea {
:is(.xfaNonInteractive, .xfaDisabled, .xfaReadOnly) :is(input, textarea) {
background: initial;
}
@ -889,8 +853,8 @@
resize: horizontal;
}
.annotationEditorLayer .freeTextEditor:hover:not(.selectedEditor),
.annotationEditorLayer .inkEditor:hover:not(.selectedEditor) {
.annotationEditorLayer
:is(.freeTextEditor, .inkEditor):hover:not(.selectedEditor) {
outline: var(--hover-outline);
}
@ -990,8 +954,7 @@
height: var(--viewer-container-height);
}
.pdfViewer.scrollHorizontal,
.pdfViewer.scrollWrapped,
.pdfViewer:is(.scrollHorizontal, .scrollWrapped),
.spread {
margin-inline: 3.5px;
text-align: center;
@ -1002,24 +965,18 @@
white-space: nowrap;
}
.pdfViewer.scrollHorizontal .spread,
.pdfViewer.scrollWrapped .spread {
.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .spread {
margin-inline: 0;
}
.spread .page,
.spread .dummyPage,
.pdfViewer.scrollHorizontal .page,
.pdfViewer.scrollWrapped .page,
.pdfViewer.scrollHorizontal .spread,
.pdfViewer.scrollWrapped .spread {
.spread :is(.page, .dummyPage),
.pdfViewer:is(.scrollHorizontal, .scrollWrapped) :is(.page, .spread) {
display: inline-block;
vertical-align: middle;
}
.spread .page,
.pdfViewer.scrollHorizontal .page,
.pdfViewer.scrollWrapped .page {
.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .page {
margin-inline: var(--spreadHorizontalWrapped-margin-LR);
}
@ -1041,7 +998,7 @@
height: 100%;
}
.pdfViewer .page.loadingIcon:after {
.pdfViewer .page.loadingIcon::after {
position: absolute;
top: 0;
left: 0;
@ -1058,11 +1015,11 @@
contain: strict;
}
.pdfViewer .page.loading:after {
.pdfViewer .page.loading::after {
display: block;
}
.pdfViewer .page:not(.loading):after {
.pdfViewer .page:not(.loading)::after {
transition-property: none;
display: none;
}
@ -1327,8 +1284,7 @@ body {
transition-timing-function: var(--sidebar-transition-timing-function);
}
#outerContainer.sidebarMoving #sidebarContainer,
#outerContainer.sidebarOpen #sidebarContainer {
#outerContainer:is(.sidebarMoving, .sidebarOpen) #sidebarContainer {
visibility: visible;
}
#outerContainer.sidebarOpen #sidebarContainer {
@ -1374,22 +1330,9 @@ body {
font: message-box;
}
.toolbar input,
.toolbar button,
.toolbar select,
.secondaryToolbar input,
.secondaryToolbar button,
.secondaryToolbar a,
.secondaryToolbar select,
.editorParamsToolbar input,
.editorParamsToolbar button,
.editorParamsToolbar select,
.findbar input,
.findbar button,
.findbar select,
#sidebarContainer input,
#sidebarContainer button,
#sidebarContainer select {
:is(.toolbar, .editorParamsToolbar, .findbar, #sidebarContainer)
:is(input, button, select),
.secondaryToolbar :is(input, button, a, select) {
outline: none;
font: message-box;
}
@ -1496,9 +1439,8 @@ body {
animation: progressIndeterminate 1s linear infinite;
}
#outerContainer.sidebarResizing #sidebarContainer,
#outerContainer.sidebarResizing #viewerContainer,
#outerContainer.sidebarResizing #loadingBar {
#outerContainer.sidebarResizing
:is(#sidebarContainer, #viewerContainer, #loadingBar) {
/* Improve responsiveness and avoid visual glitches when the sidebar is resized. */
transition-duration: 0s;
}
@ -1648,10 +1590,8 @@ body {
0 0 0 1px var(--doorhanger-border-color);
border: var(--doorhanger-border-color-whcm);
}
.doorHanger:after,
.doorHanger:before,
.doorHangerRight:after,
.doorHangerRight:before {
:is(.doorHanger, .doorHangerRight)::after,
:is(.doorHanger, .doorHangerRight)::before {
bottom: 100%;
border: 8px solid rgba(0, 0, 0, 0);
content: " ";
@ -1661,26 +1601,25 @@ body {
pointer-events: none;
opacity: var(--doorhanger-triangle-opacity-whcm);
}
.doorHanger:after {
.doorHanger::after {
inset-inline-start: 10px;
margin-inline-start: -8px;
border-bottom-color: var(--toolbar-bg-color);
}
.doorHangerRight:after {
.doorHangerRight::after {
inset-inline-end: 10px;
margin-inline-end: -8px;
border-bottom-color: var(--doorhanger-bg-color);
}
.doorHanger:before,
.doorHangerRight:before {
:is(.doorHanger, .doorHangerRight)::before {
border-bottom-color: var(--doorhanger-border-color);
border-width: 9px;
}
.doorHanger:before {
.doorHanger::before {
inset-inline-start: 10px;
margin-inline-start: -9px;
}
.doorHangerRight:before {
.doorHangerRight::before {
inset-inline-end: 10px;
margin-inline-end: -9px;
}
@ -1697,8 +1636,7 @@ body {
color: rgba(251, 0, 0, 1);
}
#findResultsCount:empty,
#findMsg:empty {
:is(#findResultsCount, #findMsg):empty {
display: none;
}
@ -1755,13 +1693,11 @@ body {
outline: none;
}
.dialogButton:hover,
.dialogButton:focus-visible {
.dialogButton:is(:hover, :focus-visible) {
background-color: var(--dialog-button-hover-bg-color);
}
.dialogButton:hover > span,
.dialogButton:focus-visible > span {
.dialogButton:is(:hover, :focus-visible) > span {
color: var(--dialog-button-hover-color);
}
@ -1772,14 +1708,11 @@ body {
overflow: hidden;
}
.toolbarButton[disabled],
.secondaryToolbarButton[disabled],
.dialogButton[disabled] {
:is(.toolbarButton, .secondaryToolbarButton, .dialogButton)[disabled] {
opacity: 0.5;
}
.splitToolbarButton > .toolbarButton:hover,
.splitToolbarButton > .toolbarButton:focus-visible,
.splitToolbarButton > .toolbarButton:is(:hover, :focus-visible),
.dropdownToolbarButton:hover {
background-color: var(--button-hover-color);
}
@ -1816,31 +1749,26 @@ body {
box-sizing: border-box;
}
.toolbarButton:hover,
.toolbarButton:focus-visible {
.toolbarButton:is(:hover, :focus-visible) {
background-color: var(--button-hover-color);
}
.secondaryToolbarButton:hover,
.secondaryToolbarButton:focus-visible {
.secondaryToolbarButton:is(:hover, :focus-visible) {
background-color: var(--doorhanger-hover-bg-color);
color: var(--doorhanger-hover-color);
}
.toolbarButton.toggled,
.splitToolbarButton.toggled > .toolbarButton.toggled,
.secondaryToolbarButton.toggled {
:is(.toolbarButton, .secondaryToolbarButton).toggled,
.splitToolbarButton.toggled > .toolbarButton.toggled {
background-color: var(--toggled-btn-bg-color);
color: var(--toggled-btn-color);
}
.toolbarButton.toggled::before,
.secondaryToolbarButton.toggled::before {
:is(.toolbarButton, .secondaryToolbarButton).toggled::before {
background-color: var(--toggled-btn-color);
}
.toolbarButton.toggled:hover:active,
.splitToolbarButton.toggled > .toolbarButton.toggled:hover:active,
.secondaryToolbarButton.toggled:hover:active {
:is(.toolbarButton, .secondaryToolbarButton).toggled:hover:active,
.splitToolbarButton.toggled > .toolbarButton.toggled:hover:active {
background-color: var(--toggled-hover-active-btn-color);
}
@ -1873,8 +1801,7 @@ body {
border: none;
background-color: var(--dropdown-btn-bg-color);
}
.dropdownToolbarButton > select:hover,
.dropdownToolbarButton > select:focus-visible {
.dropdownToolbarButton > select:is(:hover, :focus-visible) {
background-color: var(--button-hover-color);
color: var(--toggled-btn-color);
}
@ -1889,10 +1816,8 @@ body {
height: 1px;
}
.toolbarButton::before,
.secondaryToolbarButton::before,
.dropdownToolbarButton::after,
.treeItemToggler::before {
:is(.toolbarButton, .secondaryToolbarButton, .treeItemToggler)::before,
.dropdownToolbarButton::after {
/* All matching images have a size of 16x16
* All relevant containers have a size of 28x28 */
position: absolute;
@ -1905,9 +1830,7 @@ body {
mask-size: cover;
}
.dropdownToolbarButton:hover::after,
.dropdownToolbarButton:focus-visible::after,
.dropdownToolbarButton:active::after {
.dropdownToolbarButton:is(:hover, :focus-visible, :active)::after {
background-color: var(--toolbar-icon-hover-bg-color);
}
@ -1917,10 +1840,8 @@ body {
left: 6px;
}
.toolbarButton:hover::before,
.toolbarButton:focus-visible::before,
.secondaryToolbarButton:hover::before,
.secondaryToolbarButton:focus-visible::before {
.toolbarButton:is(:hover, :focus-visible)::before,
.secondaryToolbarButton:is(:hover, :focus-visible)::before {
background-color: var(--toolbar-icon-hover-bg-color);
}
@ -1981,8 +1902,7 @@ body {
mask-image: var(--toolbarButton-print-icon);
}
#download::before,
#secondaryDownload::before {
:is(#download, #secondaryDownload)::before {
mask-image: var(--toolbarButton-download-icon);
}
@ -1990,8 +1910,7 @@ a.secondaryToolbarButton {
padding-top: 5px;
text-decoration: none;
}
a.toolbarButton[href="#"],
a.secondaryToolbarButton[href="#"] {
a:is(.toolbarButton, .secondaryToolbarButton)[href="#"] {
opacity: 0.5;
pointer-events: none;
}
@ -2206,8 +2125,7 @@ a.secondaryToolbarButton[href="#"] {
padding: 10px 30px 0;
}
#thumbnailView > a:active,
#thumbnailView > a:focus {
#thumbnailView > a:is(:active, :focus) {
outline: 0;
}
@ -2479,8 +2397,7 @@ dialog :link {
position: relative;
}
#printContainer > .printedPage canvas,
#printContainer > .printedPage img {
#printContainer > .printedPage :is(canvas, img) {
/* The intrinsic canvas / image size will make sure that we fit the page. */
max-width: 100%;
max-height: 100%;

View File

@ -44,11 +44,14 @@ class FirefoxCom {
static requestSync(action, data) {
const request = document.createTextNode("");
document.documentElement.append(request);
const sender = document.createEvent("CustomEvent");
sender.initCustomEvent("pdf.js.message", true, false, {
action,
data,
sync: true
const sender = new CustomEvent("pdf.js.message", {
bubbles: true,
cancelable: false,
detail: {
action,
data,
sync: true
}
});
request.dispatchEvent(sender);
const response = sender.detail.response;
@ -72,12 +75,15 @@ class FirefoxCom {
});
}
document.documentElement.append(request);
const sender = document.createEvent("CustomEvent");
sender.initCustomEvent("pdf.js.message", true, false, {
action,
data,
sync: false,
responseExpected: !!callback
const sender = new CustomEvent("pdf.js.message", {
bubbles: true,
cancelable: false,
detail: {
action,
data,
sync: false,
responseExpected: !!callback
}
});
request.dispatchEvent(sender);
}
@ -3553,7 +3559,7 @@ exports.EventBus = EventBus;
class AutomationEventBus extends EventBus {
dispatch(eventName, data) {
super.dispatch(eventName, data);
const details = Object.create(null);
const detail = Object.create(null);
if (data) {
for (const key in data) {
const value = data[key];
@ -3563,11 +3569,14 @@ class AutomationEventBus extends EventBus {
}
continue;
}
details[key] = value;
detail[key] = value;
}
}
const event = document.createEvent("CustomEvent");
event.initCustomEvent(eventName, true, true, details);
const event = new CustomEvent(eventName, {
bubbles: true,
cancelable: true,
detail
});
document.dispatchEvent(event);
}
}
@ -8643,7 +8652,7 @@ class PDFViewer {
#onVisibilityChange = null;
#scaleTimeoutId = null;
constructor(options) {
const viewerVersion = '3.6.74';
const viewerVersion = '3.6.115';
if (_pdfjsLib.version !== viewerVersion) {
throw new Error(`The API version "${_pdfjsLib.version}" does not match the Viewer version "${viewerVersion}".`);
}
@ -12830,8 +12839,8 @@ var _ui_utils = __webpack_require__(4);
var _app_options = __webpack_require__(6);
var _pdf_link_service = __webpack_require__(8);
var _app = __webpack_require__(3);
const pdfjsVersion = '3.6.74';
const pdfjsBuild = '42faecf31';
const pdfjsVersion = '3.6.115';
const pdfjsBuild = '1b79b0cd2';
const AppConstants = null;
exports.PDFViewerApplicationConstants = AppConstants;
window.PDFViewerApplication = _app.PDFViewerApplication;

View File

@ -17,7 +17,7 @@ pdfjs.jar:
content/web/viewer.html (content/web/viewer-geckoview.html)
content/web/viewer.css (content/web/viewer-geckoview.css)
content/web/viewer.js (content/web/viewer-geckoview.js)
content/web/images/toolbarButton-download.svg (content/web/images/toolbarButton-download.svg)
content/web/images/gv-toolbarButton-download.svg (content/web/images/gv-toolbarButton-download.svg)
#else
content/PdfjsParent.sys.mjs (content/PdfjsParent.sys.mjs)
content/PdfjsChild.sys.mjs (content/PdfjsChild.sys.mjs)

View File

@ -20,8 +20,8 @@ origin:
# Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS"
release: 42faecf31036232aefcadaceef7a45c71be3f9e1 (2023-04-18T20:13:19Z).
revision: 42faecf31036232aefcadaceef7a45c71be3f9e1
release: 1b79b0cd210e38aab6e3420de5fe862a1c7f56c7 (2023-04-24T12:35:35Z).
revision: 1b79b0cd210e38aab6e3420de5fe862a1c7f56c7
# The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/