mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
[api-minor] Move the handling of unbalanced markedContent to the worker-thread (PR 15630 follow-up)
This commit is contained in:
parent
27b251ac99
commit
1e7274e9c6
2 changed files with 17 additions and 10 deletions
|
@ -224,8 +224,6 @@ function render(task) {
|
|||
}
|
||||
|
||||
class TextLayerRenderTask {
|
||||
#initialContainer = null;
|
||||
|
||||
constructor({
|
||||
textContent,
|
||||
textContentStream,
|
||||
|
@ -237,7 +235,6 @@ class TextLayerRenderTask {
|
|||
this._textContent = textContent;
|
||||
this._textContentStream = textContentStream;
|
||||
this._container = container;
|
||||
this.#initialContainer = container;
|
||||
this._document = container.ownerDocument;
|
||||
this._viewport = viewport;
|
||||
this._textDivs = textDivs || [];
|
||||
|
@ -321,13 +318,7 @@ class TextLayerRenderTask {
|
|||
}
|
||||
parent.append(this._container);
|
||||
} else if (item.type === "endMarkedContent") {
|
||||
const parent = this._container.parentNode;
|
||||
if (!parent || this._container === this.#initialContainer) {
|
||||
// Handle unbalanced beginMarkedContent/endMarkedContent operators
|
||||
// (fixes issue15629.pdf).
|
||||
continue;
|
||||
}
|
||||
this._container = parent;
|
||||
this._container = this._container.parentNode;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue