Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/display/text_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ class TextLayer {
// their replacements when they aren't embedded) and then we can use an
// OffscreenCanvas.
const canvas = document.createElement("canvas");
canvas.className = "hiddenCanvasElement";
canvas.style.cssText =
"position:absolute;top:0;left:0;width:0;height:0;display:none";
canvas.lang = lang;
document.body.append(canvas);
ctx = canvas.getContext("2d", {
Expand Down
10 changes: 0 additions & 10 deletions web/pdf_viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@
transform: rotate(270deg) translateX(-100%);
}

#hiddenCopyElement,
.hiddenCanvasElement {
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
display: none;
}

.pdfViewer {
/* Define this variable here and not in :root to avoid to reflow all the UI
when scaling (see #15929). */
Expand Down
2 changes: 2 additions & 0 deletions web/pdf_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,8 @@ class PDFViewer {
const element = (this.#hiddenCopyElement =
document.createElement("div"));
element.id = "hiddenCopyElement";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this line be removed now?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept this one: #hiddenCopyElement is used by test/integration/copy_paste_spec.mjs as a loadAndWait selector and via document.getElementById in the selectAll helper, so removing the id would break those tests.

element.style.cssText =
"position:absolute;top:0;left:0;width:0;height:0;display:none";
viewer.before(element);
}

Expand Down
Loading