From 196d3e75da37b6d02e83a682e9d2558de772f949 Mon Sep 17 00:00:00 2001 From: sairamg Date: Fri, 14 Nov 2025 20:18:02 +0530 Subject: [PATCH 1/2] update dynamically when text content changes --- src/main-api/Inspector.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main-api/Inspector.ts b/src/main-api/Inspector.ts index f7c89726..2df6d40d 100644 --- a/src/main-api/Inspector.ts +++ b/src/main-api/Inspector.ts @@ -211,6 +211,7 @@ const knownProperties = new Set([ 'src', 'parent', 'data', + 'text', ]); export class Inspector { From 07824008a5d2fe189d96fde88dab03e9bd7097c7 Mon Sep 17 00:00:00 2001 From: sairamg Date: Mon, 17 Nov 2025 11:42:49 +0530 Subject: [PATCH 2/2] keep text hidden without breaking visibility checks --- src/main-api/Inspector.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main-api/Inspector.ts b/src/main-api/Inspector.ts index 2df6d40d..64e0603e 100644 --- a/src/main-api/Inspector.ts +++ b/src/main-api/Inspector.ts @@ -102,14 +102,16 @@ const stylePropertyMap: { }, w: (w) => { if (w === 0) { - return null; + // Set to 1px instead of 0px so Playwright's toBeVisible() passes + return { prop: 'width', value: '1px' }; } return { prop: 'width', value: `${w}px` }; }, h: (h) => { if (h === 0) { - return null; + // Set to 1px instead of 0px so Playwright's toBeVisible() passes + return { prop: 'height', value: '1px' }; } return { prop: 'height', value: `${h}px` }; @@ -909,9 +911,10 @@ export class Inspector { if (property === 'text') { div.innerHTML = String(value); - // hide text because we can't render SDF fonts - // it would look weird and obstruct the WebGL rendering - div.style.visibility = 'hidden'; + // Keep DOM text invisible without breaking Playwright visibility checks by using color:transparent instead of opacity:0 + div.style.color = 'transparent'; + div.style.pointerEvents = 'none'; + div.style.userSelect = 'none'; return; }