diff --git a/src/core/annotation.js b/src/core/annotation.js index f5fba7225..06eeff126 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -3842,6 +3842,7 @@ class PopupAnnotation extends Annotation { return; } this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null); + this.data.creationDate = parentItem.get("CreationDate") || ""; const rt = parentItem.get("RT"); if (isName(rt, AnnotationReplyType.GROUP)) { diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index ec825bf6f..5e6ce2c4b 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -2071,7 +2071,7 @@ class PopupAnnotationElement extends AnnotationElement { container: this.container, color: this.data.color, titleObj: this.data.titleObj, - modificationDate: this.data.modificationDate, + modificationDate: this.data.modificationDate || this.data.creationDate, contentsObj: this.data.contentsObj, richText: this.data.richText, rect: this.data.rect, @@ -2212,14 +2212,17 @@ class PopupElement { const header = document.createElement("span"); header.className = "header"; - const title = document.createElement("h1"); - header.append(title); - ({ dir: title.dir, str: title.textContent } = this.#titleObj); + if (this.#titleObj?.str) { + const title = document.createElement("span"); + title.className = "title"; + header.append(title); + ({ dir: title.dir, str: title.textContent } = this.#titleObj); + } popup.append(header); if (this.#dateObj) { const modificationDate = document.createElement("time"); - modificationDate.classList.add("popupDate"); + modificationDate.className = "popupDate"; modificationDate.setAttribute( "data-l10n-id", "pdfjs-annotation-date-time-string" diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index a50c36e9b..35f08e9d7 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -730,3 +730,4 @@ !empty#hash.pdf !bug1885505.pdf !bug1974436.pdf +!firefox_logo.pdf diff --git a/test/pdfs/firefox_logo.pdf b/test/pdfs/firefox_logo.pdf new file mode 100755 index 000000000..a955379d7 Binary files /dev/null and b/test/pdfs/firefox_logo.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 7e2b18a75..1038aca95 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -12156,5 +12156,13 @@ "rounds": 1, "type": "eq", "annotations": true + }, + { + "id": "firefox_logo", + "file": "pdfs/firefox_logo.pdf", + "md5": "e212e0cec3e39907950c597782a42c3a", + "rounds": 1, + "type": "eq", + "annotations": true } ] diff --git a/web/annotation_layer_builder.css b/web/annotation_layer_builder.css index 94cc07831..62ee1d8e1 100644 --- a/web/annotation_layer_builder.css +++ b/web/annotation_layer_builder.css @@ -342,8 +342,9 @@ display: inline-block; } - .popup > .header h1 { + .popup > .header > .title { display: inline; + font-weight: bold; } .popup > .header .popupDate {