Skip to content

Commit

Permalink
Support for (de)serializing node state
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/yoga#1570

X-link: facebook/react-native#42751

tsia. Need node state

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D53206323

fbshipit-source-id: eb48c3873536eb52c8ffcce8005725da274e5373
  • Loading branch information
joevilches authored and facebook-github-bot committed Feb 10, 2024
1 parent 9516d71 commit c9a4de2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/yoga/src/main/cpp/yoga/YGNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ void YGNodeSetAlwaysFormsContainingBlock(
resolveRef(node)->setAlwaysFormsContainingBlock(alwaysFormsContainingBlock);
}

bool YGNodeGetAlwaysFormsContainingBlock(YGNodeConstRef node) {
return resolveRef(node)->alwaysFormsContainingBlock();
}

// TODO: This leaks internal details to the public API. Remove after removing
// ComponentKit usage of it.
bool YGNodeCanUseCachedMeasurement(
Expand Down
8 changes: 8 additions & 0 deletions lib/yoga/src/main/cpp/yoga/YGNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ YG_EXPORT void YGNodeSetAlwaysFormsContainingBlock(
YGNodeRef node,
bool alwaysFormsContainingBlock);

/**
* Whether the node will always form a containing block for any descendant. This
* can happen in situation where the client implements something like a
* transform that can affect containing blocks but is not handled by Yoga
* directly.
*/
YG_EXPORT bool YGNodeGetAlwaysFormsContainingBlock(YGNodeConstRef node);

/**
* @deprecated
*/
Expand Down

0 comments on commit c9a4de2

Please sign in to comment.