Merge pull request #18103 from Snuffleupagus/pr-18089-followup
Actually disable `TextLayerRenderTask.prototype.#processItems` when `MAX_TEXT_DIVS_TO_RENDER` is reached (PR 18089 follow-up)
This commit is contained in:
commit
128705c16e
@ -192,6 +192,8 @@ function layout(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TextLayerRenderTask {
|
class TextLayerRenderTask {
|
||||||
|
#disableProcessItems = false;
|
||||||
|
|
||||||
#reader = null;
|
#reader = null;
|
||||||
|
|
||||||
#textContentSource = null;
|
#textContentSource = null;
|
||||||
@ -278,6 +280,9 @@ class TextLayerRenderTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#processItems(items, lang) {
|
#processItems(items, lang) {
|
||||||
|
if (this.#disableProcessItems) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!this._layoutTextParams.ctx) {
|
if (!this._layoutTextParams.ctx) {
|
||||||
this._textDivProperties.set(this._rootContainer, { lang });
|
this._textDivProperties.set(this._rootContainer, { lang });
|
||||||
this._layoutTextParams.ctx = getCtx(lang);
|
this._layoutTextParams.ctx = getCtx(lang);
|
||||||
@ -291,7 +296,7 @@ class TextLayerRenderTask {
|
|||||||
if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {
|
if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {
|
||||||
warn("Ignoring additional textDivs for performance reasons.");
|
warn("Ignoring additional textDivs for performance reasons.");
|
||||||
|
|
||||||
this._processItems = () => {}; // Avoid multiple warnings for one page.
|
this.#disableProcessItems = true; // Avoid multiple warnings for one page.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user