Skip to content

fix(apple): report DevTools geometry again once Core Animation commits it - #2768

Merged
houko merged 1 commit into
mainfrom
fix/devtools-uncommitted-geometry
Nov 29, 2026
Merged

houko merged 1 commit into
mainfrom
fix/devtools-uncommitted-geometry

Conversation

@houko

@houko houko commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2753

Summary

DevTools on Apple platforms read each view's geometry through its presentation layer once, as a mount batch ended. A change that is not animated, such as the setContentOffset: of a non-animated ScrollTo, moves the presentation layers only at the next Core Animation commit, so that report still showed the old geometry, and with no animation running nothing reported again.

That is what TestNativeDevToolsFollowStickyScroll hit on apple-simulator: a traced run showed the native scroll view at 200 (before 0 after 200, no remount, no pull-back) while DevTools kept the header at its unscrolled y=130, however long the test waited.

ReportLayerGeometry (internal/platform/apple/dev_geometry.go) now also keeps the frames coming while a layer's presentation geometry differs from its model geometry, so the next frame reports the committed geometry. It only does this while DevTools observes.

Verification

  • apple-simulator with the whole testdata/devtools-geometry package run 15 times in a row on this change (diagnostic branch, run 46273234047): 15 passes. Before it, the sticky test failed about one run in six (2 of 12 in run 46272285407).
  • Builds for ios (simulator SDK) and macos.

Screenshots

None.

…s it

DevTools read each view's geometry through its presentation layer once, as a mount batch ended. A change that is not animated, such as the setContentOffset: of a non-animated ScrollTo, moves the presentation layers only at the next Core Animation commit, so that report still showed the old geometry, and with no animation running nothing reported again: TestNativeDevToolsFollowStickyScroll read the sticky header at its unscrolled y=130 after scrolling to 200 in about one run in six, however long it waited, while the native scroll view was at 200.

ReportLayerGeometry now also keeps the frames coming while a layer's presentation geometry differs from its model geometry, so the next frame reports the committed geometry.

Fixes #2753
@github-actions github-actions Bot added bug Something isn't working local-ci-skipped size/S labels Nov 29, 2026
@github-actions

Copy link
Copy Markdown

This pull request has no valid Local CI declaration for its head commit, so a maintainer audits it before merging:

  • the body has no <!-- local-ci --> block under ## Verification

Run the checks on the head commit, fill the block in the template, then push or edit the body: this label and comment update on their own.

@houko
houko merged commit 44b684f into main Nov 29, 2026
46 of 47 checks passed
@houko
houko deleted the fix/devtools-uncommitted-geometry branch November 29, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working iOS macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: TestNativeDevToolsFollowStickyScroll reads the native sticky bounds before UIKit places them

1 participant