Skip to content

optionally calculate originFromRoot for ShadowNode and pass to ShadowView#55045

Closed
zeyap wants to merge 1 commit into
react:mainfrom
zeyap:export-D89573536
Closed

optionally calculate originFromRoot for ShadowNode and pass to ShadowView#55045
zeyap wants to merge 1 commit into
react:mainfrom
zeyap:export-D89573536

Conversation

@zeyap

@zeyap zeyap commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

Summary:

Changelog:

[General] [Added] - optionally calculate originFromRoot for ShadowNode and pass to ShadowView

  • If a LayoutableShadowNode calls layout() with LayoutContext.includeOriginFromRoot==true, all its (recursive) children will calculate originFromRoot. This will be needed for shared transition/view transition, where we'll later need to know the absolute position of a shadowNode/shadowView
    • if includeOriginFromRoot is false, there's no overhead of calculating originFromRoot_ field
  • the way originFromRoot is calculated: we first initialize originFromRoot_ on the LayoutableShadowNode that enables includeOriginFromRoot (using LayoutableShadowNode::computeRelativeLayoutMetrics, which traverses all the ancestors), then calculate originFromRoot for children in its subtree recursively (LayoutableShadowNode::computeOriginFromRoot which only calculates by the difference from immediate parent)

Differential Revision: D89573536

…View

Summary:
## Changelog:

[General] [Added] - optionally calculate originFromRoot for ShadowNode and pass to ShadowView

* If a LayoutableShadowNode calls `layout()` with `LayoutContext.includeOriginFromRoot==true`, all its (recursive) children will calculate `originFromRoot`. This will be needed for shared transition/view transition, where we'll later need to know the absolute position of a shadowNode/shadowView
  * if includeOriginFromRoot is false, there's no overhead of calculating `originFromRoot_` field
* the way originFromRoot is calculated: we first initialize `originFromRoot_` on the LayoutableShadowNode that enables `includeOriginFromRoot` (using `LayoutableShadowNode::computeRelativeLayoutMetrics`, which traverses all the ancestors), then calculate originFromRoot for children in its subtree recursively (`LayoutableShadowNode::computeOriginFromRoot` which only calculates by the difference from immediate parent)

Differential Revision: D89573536
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 5, 2026
@meta-codesync

meta-codesync Bot commented Jan 5, 2026

Copy link
Copy Markdown

@zeyap has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89573536.

@react-native-bot

Copy link
Copy Markdown
Collaborator

Closing this PR as the diff D89573536 has been abandoned internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants