feat(highlight): update highlight from raf (#11443)

This commit is contained in:
Pavel Feldman 2022-01-17 18:33:35 -08:00 committed by GitHub
parent 4a1f945a3b
commit 815e121445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -863,7 +863,13 @@ export class InjectedScript {
this._highlight = new Highlight(false);
this._highlight.install();
}
this._highlight.updateHighlight(this.querySelectorAll(selector, document.documentElement), stringifySelector(selector), false);
this._runHighlightOnRaf(selector);
}
_runHighlightOnRaf(selector: ParsedSelector) {
if (this._highlight)
this._highlight.updateHighlight(this.querySelectorAll(selector, document.documentElement), stringifySelector(selector), false);
requestAnimationFrame(() => this._runHighlightOnRaf(selector));
}
hideHighlight() {