fix(browser): park webviews permanently paintable

Delete the renderer capture prep handshake and keep screenshots on the serialized invalidate/retry path. The capture harness now defaults to the production P1 attach-off parking check.
This commit is contained in:
Mohamed Boudra
2026-07-03 11:34:48 +02:00
parent cc21262130
commit ab62a023fd
15 changed files with 358 additions and 1652 deletions

View File

@@ -16,13 +16,15 @@
#paseo-browser-resident-webviews {
position: fixed;
left: -20000px;
left: 0;
top: 0;
width: 1280px;
height: 800px;
width: 1px;
height: 1px;
overflow: hidden;
opacity: 0;
opacity: 1;
pointer-events: none;
display: block;
visibility: visible;
}
.capture-harness-webview {
@@ -152,23 +154,24 @@
host.style.position = "fixed";
host.style.left = "0";
host.style.top = "0";
host.style.width = `${RESIDENT_VIEWPORT_WIDTH}px`;
host.style.height = `${RESIDENT_VIEWPORT_HEIGHT}px`;
host.style.width = "1px";
host.style.height = "1px";
host.style.overflow = "hidden";
host.style.opacity = "1";
host.style.pointerEvents = "none";
host.style.zIndex = "1";
host.style.display = "block";
host.style.zIndex = "";
host.style.clipPath = "";
host.style.visibility = "";
host.style.visibility = "visible";
host.style.transform = "";
host.style.transformOrigin = "0 0";
host.style.transformOrigin = "";
}
function applyPermanentWebviewBase(webview, index) {
applyStackedWebviewStyle(webview);
webview.style.opacity = "1";
webview.style.opacity = "";
webview.style.transform = "";
webview.style.pointerEvents = "none";
webview.style.pointerEvents = "";
webview.style.zIndex = "0";
webview.style.width = `${RESIDENT_VIEWPORT_WIDTH}px`;
webview.style.height = `${RESIDENT_VIEWPORT_HEIGHT}px`;
@@ -183,9 +186,6 @@
webviews.forEach(applyPermanentWebviewBase);
if (stateName === "p1-overflow-1x1") {
host.style.width = "1px";
host.style.height = "1px";
host.style.overflow = "hidden";
return state();
}

View File

@@ -13,15 +13,15 @@ const CAPTURE_RETRY_INTERVAL_MS = 200;
const REPEAT_COUNT = 5;
const FRESH_REPEAT_COUNT = 3;
const SOAK_MS = Number(process.env.PASEO_CAPTURE_HARNESS_SOAK_MS || 75000);
const HARNESS_GROUP = process.env.PASEO_CAPTURE_HARNESS_GROUP || "all";
const HARNESS_GROUP = process.env.PASEO_CAPTURE_HARNESS_GROUP || "permanent-parking";
const PERMANENT_STATE_FILTER = new Set(
(process.env.PASEO_CAPTURE_HARNESS_STATES || "")
(process.env.PASEO_CAPTURE_HARNESS_STATES || "P1")
.split(",")
.map((state) => state.trim())
.filter(Boolean),
);
const PERMANENT_VARIANT_FILTER = new Set(
(process.env.PASEO_CAPTURE_HARNESS_VARIANTS || "")
(process.env.PASEO_CAPTURE_HARNESS_VARIANTS || "attach-off")
.split(",")
.map((variant) => variant.trim())
.filter(Boolean),
@@ -377,14 +377,8 @@ async function readGuestMetrics(contents) {
}
async function capturePageSequence(contents) {
const previousBackgroundThrottling = contents.getBackgroundThrottling();
contents.setBackgroundThrottling(false);
try {
contents.invalidate();
return await withTimeout(contents.capturePage(undefined, { stayHidden: false }), "capturePage");
} finally {
contents.setBackgroundThrottling(previousBackgroundThrottling);
}
contents.invalidate();
return await withTimeout(contents.capturePage(undefined, { stayHidden: false }), "capturePage");
}
async function captureFullPage(contents) {
@@ -426,14 +420,8 @@ async function captureFullPage(contents) {
}
async function captureFullPageSequence(contents) {
const previousBackgroundThrottling = contents.getBackgroundThrottling();
contents.setBackgroundThrottling(false);
try {
contents.invalidate();
return await captureFullPage(contents);
} finally {
contents.setBackgroundThrottling(previousBackgroundThrottling);
}
contents.invalidate();
return await captureFullPage(contents);
}
function installHarnessWebviewGuards(win) {
@@ -1100,6 +1088,10 @@ async function runPermanentParkingGroup() {
} finally {
await closeHarnessWindow(keeper);
}
const failedResults = results.filter((result) => !result.pass);
if (failedResults.length > 0) {
fail(`permanent parking failed ${failedResults.length}/${results.length} checks`);
}
return results;
}