Skip to content

fix(screenshot): project transformed iframe geometry accurately - #752

Merged
leeguooooo merged 4 commits into
leeguooooo:mainfrom
euvoor:fix/screenshot-projective-frames
Oct 26, 2026
Merged

leeguooooo merged 4 commits into
leeguooooo:mainfrom
euvoor:fix/screenshot-projective-frames

Conversation

@euvoor

@euvoor euvoor commented Oct 26, 2026

Copy link
Copy Markdown

What and why

Annotated screenshots currently refuse rotation, skew, reflection and perspective at out-of-process iframe boundaries. Scrolling frames can also produce enlarged and displaced boxes because the owner content quad includes scrollbar space while Page.getLayoutMetrics excludes it.

Compose full projective transforms across renderer boundaries, project all four element corners, and form the final capture-relative bounding box. Measure each child viewport, including scrollbar space, in the existing required isolated world. Preserve explicit refusal for missing, collapsed, concave, ill-conditioned or horizon-crossing geometry. Simple affine transforms retain their exact arithmetic path.

Part of #747. Nested relay targets also require the separate attachment fix in #749; this PR does not change relay attachment or screenshot capture transport.

Stealth mode

  • Nothing here is visible to the pages chrome-use drives.
  • Something here is page-visible and only runs with stealth mode off.

Annotations remain CLI raster operations. Geometry uses CDP quads and a read-only innerWidth/innerHeight expression in the required isolated world, without new page globals, nodes, styles, listeners, input or requests. There is no main-world fallback or Runtime.enable. Unavailable isolation fails explicitly. No tab activation or timing workaround is added.

Tests

All compilation and browser execution used disposable GitHub-hosted runners and fresh profiles, not a personal browser.

  • 21 screenshot unit/protocol/raster tests passed, including projective interiors, matrix composition, degenerate/horizon refusal, renderer identity and an assertion that viewport reads carry the isolated context.
  • Four actual permanent screenshot E2E tests passed, including transformed/nested OOP frames with scrolling child documents, raster annotations and no DOM mutations. These legacy headless helpers disable Chrome's internal sandbox; the disposable hosted VM is their isolation boundary.
  • 112 headed acceptance captures passed: launch and extension relay, seven layouts (scale, rotation, skew, reflection, perspective, nested and scrolling frames), DPR 1/2, scroll offsets, and viewport/full/clip/selector regions. Same-renderer controls and OOP specimens have identical content/transforms separated by 500 CSS pixels; boxes agree within one pixel. No new globals or DOM mutations were observed. The headed harness retains Chrome's sandbox.
  • Hosted harness source: 9aa58f938392c4184c6e0ff70c248365f508dfff, containing this production change through 588a5487 and fix(relay): attach nested out-of-process iframe targets #749's nested relay fix. Tested binary SHA-256: 20f08e2cbf34a8ab830aad4094b4a9938ac7803d565526ec4102f86a18240d3a. The final commit only mirrors documentation.

Validation limit: the extended geometry matrix uses active owned fixture tabs to isolate projection. Earlier inactive relay transform captures intermittently stalled, including unannotated controls; plain active/inactive controls all passed. Those capture timeouts remain separately tracked in #747, and this PR does not claim to fix them. Likewise, the public detector comparison remains red on shared WebGL and managed-challenge outcomes; neither benchmark results nor native fingerprints are altered here.

Docs

  • Help, README (EN/ZH), core command/reading references, command/media docs (ZH and EN), and source comments updated.
  • CHANGELOG.md and both docs changelogs when this ships in the maintainer's release PR.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b65bc54-0930-4539-b911-c64c553526e4
Commits

Reviewing files that changed from the base of the PR and between f5e7ac5 and 5856b04.

Files selected for processing: 11
  • README.md
  • README.zh.md
  • cli/src/native/screenshot_annotation_e2e_tests.rs
  • cli/src/native/screenshot_geometry.rs
  • cli/src/output.rs
  • docs/commands.html
  • docs/en/commands.html
  • docs/en/media.html
  • docs/media.html
  • skill-data/core/references/commands.md
  • skill-data/core/references/reading.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@leeguooooo
leeguooooo merged commit df89806 into leeguooooo:main Oct 26, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants