fix(pdf): detect nested pointer-events:none loading overlays#840
Closed
cursor[bot] wants to merge 2 commits into
Closed
fix(pdf): detect nested pointer-events:none loading overlays#840cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
#839 only scanned direct children of body for pointer-events:none overlays. SPAs that mount loaders inside #root as siblings of content were missed, letting the PDF fast path skip the blank check and ship white PDFs.
The ancestor-walking scan dropped two guards the body-level scan had, turning ordinary layouts into false covered positives (fail-slow: the fast path is skipped and the screenshot poll runs on pages it was built to avoid): - pointer-events filter: any positioned opaque sibling qualified, so a fixed page background painted behind the content (z-index:-1) flagged as covering it. Restored — anything hit-testable is coveredAt's job. - content guard: a layer painting counted content paints with it, not over it. Restored as the only relation check; it subsumes the per-anchor === /contains checks, which sibling geometry made dead. Also cheaper per poll: rect test before getComputedStyle, and scanned parents are shared across content samples so each level resolves once. Both regressions verified live against the previous commit and pinned with not-covered tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DnCNthP4fLPv6yeEjjSaUh
Member
|
Closing: the nested-overlay case is hypothetical at this point and the deeper per-poll scan isn't worth the cost. #839's body-level scan stays. If a real page ships blank because of a nested pointer-events:none loader, we'll reopen with that URL as the test case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug and impact
PDF
waitUntil: autocan ship blank/white PDFs when a SPA mounts apointer-events: noneloading overlay as a sibling of content inside#root/#app.#839added acoveredcheck so the zero-screenshot fast path is skipped when content hides behind an opaque overlay. That scan only inspected direct children of<body>, so nested loaders were missed:waitForReadyreportedcovered: falsewith 200+ visible text chars, the fast path skipped the blank-SPA screenshot poll, and the PDF captured the white overlay.Root cause
elementFromPoint(andelementsFromPoint) skippointer-events: noneelements in Chromium. The fallback scan in#839was limited todocument.body.children, missing the commonbody > #root > [overlay, content]structure.Fix
For each content sample, walk up the ancestor chain and check siblings for unrelated opaque viewport-filling fixed/absolute/sticky layers. Replaces the body-children-only scan and covers both direct and nested mount patterns.
Validation
covered: a pointer-events:none overlay nested in #root is caughtwait-for-ready-livetests pass (16/16)@browserless/browserlessPDF unit tests pass (11/11)@browserless/screenshotsuite passes (44/44)