From cc97cb7e59ac55c9855c772bb79cf1f3aa7adcaa Mon Sep 17 00:00:00 2001 From: Julien Neuhart Date: Fri, 24 Apr 2026 14:33:02 +0200 Subject: [PATCH] docs(chromium): tighten paint-polyfill always-on godoc per CONTRIBUTING style --- pkg/modules/chromium/paint_polyfill.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/modules/chromium/paint_polyfill.go b/pkg/modules/chromium/paint_polyfill.go index 9d7a9e5f..081c189f 100644 --- a/pkg/modules/chromium/paint_polyfill.go +++ b/pkg/modules/chromium/paint_polyfill.go @@ -124,12 +124,11 @@ const paintCallbacksPolyfill = ` // injectPaintCallbacksPolyfillActionFunc installs the // [paintCallbacksPolyfill] via [page.AddScriptToEvaluateOnNewDocument] -// so that it runs before any user script on the navigated page. The -// shim is installed unconditionally: the native rAF, ResizeObserver, -// and IntersectionObserver APIs do not fire during Chromium's -// headless-print render, so replacing them with timer-backed -// implementations either restores the behavior the page expects or has -// no effect when the page never calls them. +// before any user script runs. Runs on every conversion: Chromium's +// headless-print pipeline does not fire the native rAF, +// ResizeObserver, and IntersectionObserver, so the timer-backed +// replacements fire the user's callbacks when the page relies on them +// and have no effect otherwise. func injectPaintCallbacksPolyfillActionFunc(logger *slog.Logger) chromedp.ActionFunc { return func(ctx context.Context) error { logger.DebugContext(ctx, "inject paint-callbacks polyfill")