[api-minor] Move the handling of unbalanced markedContent to the worker-thread (PR 15630 follow-up)

This commit is contained in:
Jonas Jenwald 2022-10-26 19:43:17 +02:00
parent 27b251ac99
commit 1e7274e9c6
2 changed files with 17 additions and 10 deletions

View file

@ -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;
}