Repository navigation
Wake ResizeObserver for native-only layout changes - #60157
Open
rubennorte wants to merge 2 commits into
Open
rubennorte wants to merge 2 commits into
rubennorte wants to merge 2 commits into
Conversation
Summary: ## Context Fantom can create roots with a chosen viewport size, but its existing native `TesterAppDelegate::updateSurfaceConstraints` method was not exposed to JavaScript tests. Tests of native host resizing need to change root constraints without another React render or flushing pending JS work. ## Changes - Add a thin `root.updateSurfaceConstraints(width, height)` binding to the existing tester method, forwarding the root’s device pixel ratio. - Add root-view tests for growing and shrinking native constraints, percentage-sized descendants, stable host refs, deferred JS work, and attempts to resize a destroyed root. - Document the control. Do not add context tracking or a queue-validation API. Changelog: [Internal] Differential Revision: D133247484
Summary: ## Context Native-only layout commits can leave `ResizeObserver` notifications pending while the JavaScript runtime is idle. Without an `onLayout` listener, no event task is guaranteed to drive the existing resize-observation rendering step. Commits without dirty observed families should not enqueue extra JS work. ## Changes - Request a coalesced wake only when the commit reports dirty observed families, using the existing scheduler API and commit-listener contract. - Keep the commit hook limited to collecting family identities. All resize computation and reported-size updates stay in the existing JS rendering-step gather/broadcast loop. - Keep queued work lifetime-safe across disconnect/reconnect with a per-connection flag captured by the wake task. Document the existing UIManager unregister barrier before connection members are reset. - Add native root-resize tests using the preceding Fantom control. Cover idle delivery, ordering before newly scheduled `onLayout`, coalescing, unobserved surfaces, queued reconnects, and no queued wake without a dirty observed family. Dirty targets whose selected box is unchanged do not produce callbacks. Events queued before observation retain FIFO order. - Leave runtime-scheduler implementation, commit-hook infrastructure, and C++ API snapshots unchanged. Changelog: [General][Fixed] - Notify `ResizeObserver` of native layout changes when the JavaScript runtime is idle Differential Revision: D133233918
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D133233918. |
andrewdacenko
approved these changes
Nov 19, 2026
andrewdacenko
left a comment
Contributor
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
This branch has not been deployed
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.



Summary:
Context
Native-only layout commits can leave
ResizeObservernotifications pending while the JavaScript runtime is idle. Without anonLayoutlistener, no event task is guaranteed to drive the existing resize-observation rendering step. Commits without dirty observed families should not enqueue extra JS work.Changes
onLayout, coalescing, unobserved surfaces, queued reconnects, and no queued wake without a dirty observed family. Dirty targets whose selected box is unchanged do not produce callbacks. Events queued before observation retain FIFO order.Changelog:
[General][Fixed] - Notify
ResizeObserverof native layout changes when the JavaScript runtime is idleDifferential Revision: D133233918