Skip to content

Commit 62c60e1

Browse files
committed
fix(page): drop unverified Blink internals from requestGC comment
The previous comment named a specific private EventHandler field (node_under_mouse_) on the strength of one indirect web fetch, which overclaims precision the test evidence doesn't support -- the repeated test runs only show that a mouseMoved event before collectGarbage is sufficient to release the reference, not which exact internal field does it. Rephrased to describe the observed behavior instead of naming Blink internals.
1 parent ce12be5 commit 62c60e1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/playwright-core/src/server/chromium

‎packages/playwright-core/src/server/chromium/crPage.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class CRPage implements PageDelegate {
221221
}
222222

223223
async requestGC(): Promise<void> {
224-
// Blink's EventHandler caches the last hit-tested node (node_under_mouse_) for hover/mouseout tracking and only refreshes it on the next pointer event, so a removed element stays pinned by that native reference, invisible to collectGarbage, until we force a fresh hit-test.
224+
// Chromium keeps the last hit-tested node reachable for hover/mouseout tracking even after it's removed from the DOM, and collectGarbage alone won't release it; a synthetic mouse move forces a fresh hit-test that does, so send one (off-viewport, to avoid touching real page content) first.
225225
await this._mainFrameSession._client.send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: -1, y: -1 });
226226
await this._mainFrameSession._client.send('HeapProfiler.collectGarbage');
227227
}

0 commit comments

Comments
 (0)