Skip to content

fix: capture stopped scroll pixels before native activation - #58

Merged
rdlabo merged 3 commits into
mainfrom
fix/capture-after-momentum-stop
Nov 16, 2026
Merged

rdlabo merged 3 commits into
mainfrom
fix/capture-after-momentum-stop

Conversation

@rdlabo

@rdlabo rdlabo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

A native tap immediately after a fling can stop scrolling but still open an overlay with every native control missing. Scroll invalidation was cancelling the unacquired request before its replacement reached native, leaving nothing to promote at contact. The real Capacitor/Ionic reproduction showed zero images during the overlay; idle presentation showed three.

Keep a live, unacquired request across scroll-origin change messages until the next prepare replaces it. Contact then uses the existing pre-dispatch ordering: stop momentum → apply layout → measure current frames → acquire pixels → dispatch input. It does not wait for another idle period. PNG encoding, delivery and decoding remain asynchronous.

Scroll notification responsibilities are documented in the integration guide:

  • SDK/native hosting and placement tracking support image switching and scrolling while preserving native tap/long-press ownership.
  • Completed composited pixels must lose next-contact eligibility when their backdrop changes.
  • An unacquired request reads current geometry at contact, so scrolling alone must not cancel it.
  • Source invalidation, reset and replacement retain their normal cancellation behavior.

Both document observation and renderer changed(owner) remain necessary for standalone/background and Shadow DOM scrolls respectively. Light DOM can traverse both paths. Time/position deduplication is deferred because capture-generation boundaries also matter; this fix adds no deduplication state.

Validation:

  • iOS 26.5 and 27.2 real Capacitor + Ionic: idle, body fling and actual ion-content fling → native tap → modal → dismiss, all six cases passed. Each overlay displayed three decoded images and restored normally. Scroll cases acquired new pixels in the same contact before activation, with native scroll views already stopped.
  • Browser projection suite: 91 passed; related Core/control tests: 142 passed; native covered snapshot tests: 21 passed, including a new live-geometry/completed-pixel invalidation regression.
  • Android emulator with the updated shared runtime: six native Button fixture cases passed, covering image contact, tap/long press, cross-region stop/restart and overlay input. This is not a live AdMob SDK test.
  • TypeScript, ESLint, formatting, Swift lint and packed-package/native-binary integrity checks passed.
  • Separate supervisor-role and independent third-party agent reviews passed the final code and notification/order documentation, with no remaining P1/P2 findings.

JavaScript runtime and iOS native code must be adopted together. Release Engine first, then update the Capacitor/Core dependency and synchronize Cordova to that Core revision.

@rdlabo
rdlabo merged commit c02ab01 into main Nov 16, 2026
9 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.

1 participant