Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
feat(highlight): update highlight from raf (#11443)
Pavel Feldman815e12144556
diff --git a/packages/playwright-core/src/server/injected/injectedScript.ts b/packages/playwright-core/src/server/injected/injectedScript.tsindex 28417ed10a..1778a7f753 100644--- a/packages/playwright-core/src/server/injected/injectedScript.ts+++ b/packages/playwright-core/src/server/injected/injectedScript.ts@@ -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() {