Rename YogaNode.parent -> YogaNode.owner

Summary:
In the persistent version of Yoga, a YogaNode can be shared between two YogaTrees, that means that a YogaNode could have more than one Parent at one point in time. That's why the concept of Parent of a YogaNode is not a 1-1 relationship anymore.
This diff changes the semantic of Parent of a YogaNode to Owner of a Yoga Node. CC sebmarkbage and priteshrnandgaonkar for more context.

Technically this diff renames the field YogaNode.parent to YogaNode.owner (and every internal field, Getter and Setter that is related to parent)

Note that as part of this diff I also modified the CSSLayoutDEPRECATED version of Yoga in order to keep compatibility with the C++ implementation.

Reviewed By: priteshrnandgaonkar

Differential Revision: D7352778

fbshipit-source-id: dcf1af5e72bfc3063b5c4bda197d7952a9194768
This commit is contained in:
David Vacca
2018-04-01 18:27:06 -07:00
committed by Facebook Github Bot
parent 17901ea5c2
commit f0edefdbb7
12 changed files with 344 additions and 331 deletions

View File

@@ -46,14 +46,14 @@ import java.util.Map;
* <YogaLayout
* xmlns:android="http://schemas.android.com/apk/res/android"
* xmlns:yoga="http://schemas.android.com/apk/com.facebook.yoga.android"
* android:layout_width="match_parent"
* android:layout_height="match_parent"
* android:layout_width="match_owner"
* android:layout_height="match_owner"
* yoga:flex_direction="row"
* yoga:padding_all="10dp"
* >
* <TextView
* android:layout_width="match_parent"
* android:layout_height="match_parent"
* android:layout_width="match_owner"
* android:layout_height="match_owner"
* android:text="Hello, World!"
* yoga:flex="1"
* />
@@ -262,11 +262,11 @@ public class YogaLayout extends ViewGroup {
return;
}
final YogaNode parent = node.getParent();
final YogaNode owner = node.getOwner();
for (int i = 0; i < parent.getChildCount(); i++) {
if (parent.getChildAt(i).equals(node)) {
parent.removeChildAt(i);
for (int i = 0; i < owner.getChildCount(); i++) {
if (owner.getChildAt(i).equals(node)) {
owner.removeChildAt(i);
break;
}
}
@@ -315,7 +315,7 @@ public class YogaLayout extends ViewGroup {
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
// Either we are a root of a tree, or this function is called by our parent's onLayout, in which
// Either we are a root of a tree, or this function is called by our owner's onLayout, in which
// case our r-l and b-t are the size of our node.
if (!(getParent() instanceof YogaLayout)) {
createLayout(
@@ -699,7 +699,7 @@ public class YogaLayout extends ViewGroup {
/**
* Constructs a set of layout params, given width and height specs. In this case, we can set
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
* options (such as {@code match_parent} or {@code wrap_content} are given, then the parent
* options (such as {@code match_owner} or {@code wrap_content} are given, then the owner
* LayoutParams will store them, and we deal with them during layout. (see
* {@link YogaLayout#createLayout})
*
@@ -773,9 +773,9 @@ public class YogaLayout extends ViewGroup {
* {@code View}'s measure function.
*
* @param node The yoga node to measure
* @param width The suggested width from the parent
* @param width The suggested width from the owner
* @param widthMode The type of suggestion for the width
* @param height The suggested height from the parent
* @param height The suggested height from the owner
* @param heightMode The type of suggestion for the height
* @return A measurement output ({@code YogaMeasureOutput}) for the node
*/

View File

@@ -29,7 +29,7 @@ public class YogaNode implements Cloneable {
*/
static native int jni_YGNodeGetInstanceCount();
private YogaNode mParent;
private YogaNode mOwner;
private List<YogaNode> mChildren;
private YogaMeasureFunction mMeasureFunction;
private YogaBaselineFunction mBaselineFunction;
@@ -152,7 +152,7 @@ public class YogaNode implements Cloneable {
private native void jni_YGNodeInsertChild(long nativePointer, long childPointer, int index);
public void addChildAt(YogaNode child, int i) {
if (child.mParent != null) {
if (child.mOwner != null) {
throw new IllegalStateException("Child already has a parent, it must be removed first.");
}
@@ -160,7 +160,7 @@ public class YogaNode implements Cloneable {
mChildren = new ArrayList<>(4);
}
mChildren.add(i, child);
child.mParent = this;
child.mOwner = this;
jni_YGNodeInsertChild(mNativePointer, child.mNativePointer, i);
}
@@ -180,15 +180,23 @@ public class YogaNode implements Cloneable {
public YogaNode removeChildAt(int i) {
final YogaNode child = mChildren.remove(i);
child.mParent = null;
child.mOwner = null;
jni_YGNodeRemoveChild(mNativePointer, child.mNativePointer);
return child;
}
/**
* @returns the {@link YogaNode} that owns this {@link YogaNode}.
* The owner is used to identify the YogaTree that a {@link YogaNode} belongs
* to.
* This method will return the parent of the {@link YogaNode} when the
* {@link YogaNode} only belongs to one YogaTree or null when the
* {@link YogaNode} is shared between two or more YogaTrees.
*/
@Nullable
public
YogaNode getParent() {
return mParent;
YogaNode getOwner() {
return mOwner;
}
public int indexOf(YogaNode child) {

View File

@@ -152,7 +152,7 @@ static inline YGConfigRef _jlong2YGConfigRef(jlong addr) {
static YGNodeRef YGJNIOnNodeClonedFunc(
YGNodeRef oldNode,
YGNodeRef parent,
YGNodeRef owner,
int childIndex) {
auto config = oldNode->getConfig();
if (!config) {
@@ -171,7 +171,7 @@ static YGNodeRef YGJNIOnNodeClonedFunc(
auto newNode = onNodeClonedFunc(
javaConfig->get(),
YGNodeJobject(oldNode)->lockLocal(),
YGNodeJobject(parent)->lockLocal(),
YGNodeJobject(owner)->lockLocal(),
childIndex);
static auto replaceChild = findClassStatic("com/facebook/yoga/YogaNode")
@@ -180,7 +180,7 @@ static YGNodeRef YGJNIOnNodeClonedFunc(
jint)>("replaceChild");
jlong newNodeNativePointer = replaceChild(
YGNodeJobject(parent)->lockLocal(),
YGNodeJobject(owner)->lockLocal(),
newNode,
childIndex);

View File

@@ -258,7 +258,7 @@ public class YogaNodeTest {
config.setOnCloneNode(
new YogaNodeCloneFunction() {
@Override
public YogaNode cloneNode(YogaNode oldNode, YogaNode parent, int childIndex) {
public YogaNode cloneNode(YogaNode oldNode, YogaNode owner, int childIndex) {
try {
onNodeClonedExecuted.set(true);
return oldNode.clone();
@@ -295,7 +295,7 @@ public class YogaNodeTest {
config.setOnCloneNode(
new YogaNodeCloneFunction() {
@Override
public YogaNode cloneNode(YogaNode oldNode, YogaNode parent, int childIndex) {
public YogaNode cloneNode(YogaNode oldNode, YogaNode owner, int childIndex) {
try {
return oldNode.clone();
} catch (CloneNotSupportedException ex) {

View File

@@ -23,17 +23,17 @@ TEST(YogaTest, set_children_adds_children_to_parent) {
YGNodeRef const root = YGNodeNew();
YGNodeRef const root_child0 = YGNodeNew();
YGNodeRef const root_child1 = YGNodeNew();
YGNodeSetChildren(root, {root_child0, root_child1});
const std::vector<YGNodeRef> children = getChildren(root);
const std::vector<YGNodeRef> expectedChildren = {root_child0, root_child1};
ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> parents = {YGNodeGetParent(root_child0), YGNodeGetParent(root_child1)};
const std::vector<YGNodeRef> expectedParents = {root, root};
ASSERT_EQ(parents, expectedParents);
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {root, root};
ASSERT_EQ(owners, expectedOwners);
YGNodeFreeRecursive(root);
}
@@ -41,18 +41,18 @@ TEST(YogaTest, set_children_to_empty_removes_old_children) {
YGNodeRef const root = YGNodeNew();
YGNodeRef const root_child0 = YGNodeNew();
YGNodeRef const root_child1 = YGNodeNew();
YGNodeSetChildren(root, {root_child0, root_child1});
YGNodeSetChildren(root, {});
const std::vector<YGNodeRef> children = getChildren(root);
const std::vector<YGNodeRef> expectedChildren = {};
ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> parents = {YGNodeGetParent(root_child0), YGNodeGetParent(root_child1)};
const std::vector<YGNodeRef> expectedParents = {nullptr, nullptr};
ASSERT_EQ(parents, expectedParents);
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
ASSERT_EQ(owners, expectedOwners);
YGNodeFreeRecursive(root);
}
@@ -60,22 +60,22 @@ TEST(YogaTest, set_children_replaces_non_common_children) {
YGNodeRef const root = YGNodeNew();
YGNodeRef const root_child0 = YGNodeNew();
YGNodeRef const root_child1 = YGNodeNew();
YGNodeSetChildren(root, {root_child0, root_child1});
YGNodeRef const root_child2 = YGNodeNew();
YGNodeRef const root_child3 = YGNodeNew();
YGNodeSetChildren(root, {root_child2, root_child3});
const std::vector<YGNodeRef> children = getChildren(root);
const std::vector<YGNodeRef> expectedChildren = {root_child2, root_child3};
ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> parents = {YGNodeGetParent(root_child0), YGNodeGetParent(root_child1)};
const std::vector<YGNodeRef> expectedParents = {nullptr, nullptr};
ASSERT_EQ(parents, expectedParents);
const std::vector<YGNodeRef> owners = {YGNodeGetOwner(root_child0), YGNodeGetOwner(root_child1)};
const std::vector<YGNodeRef> expectedOwners = {nullptr, nullptr};
ASSERT_EQ(owners, expectedOwners);
YGNodeFreeRecursive(root);
YGNodeFree(root_child0);
YGNodeFree(root_child1);
@@ -86,26 +86,26 @@ TEST(YogaTest, set_children_keeps_and_reorders_common_children) {
YGNodeRef const root_child0 = YGNodeNew();
YGNodeRef const root_child1 = YGNodeNew();
YGNodeRef const root_child2 = YGNodeNew();
YGNodeSetChildren(root, {root_child0, root_child1, root_child2});
YGNodeRef const root_child3 = YGNodeNew();
YGNodeSetChildren(root, {root_child2, root_child1, root_child3});
const std::vector<YGNodeRef> children = getChildren(root);
const std::vector<YGNodeRef> expectedChildren = {root_child2, root_child1, root_child3};
ASSERT_EQ(children, expectedChildren);
const std::vector<YGNodeRef> parents = {
YGNodeGetParent(root_child0),
YGNodeGetParent(root_child1),
YGNodeGetParent(root_child2),
YGNodeGetParent(root_child3)
const std::vector<YGNodeRef> owners = {
YGNodeGetOwner(root_child0),
YGNodeGetOwner(root_child1),
YGNodeGetOwner(root_child2),
YGNodeGetOwner(root_child3)
};
const std::vector<YGNodeRef> expectedParents = {nullptr, root, root, root};
ASSERT_EQ(parents, expectedParents);
const std::vector<YGNodeRef> expectedOwners = {nullptr, root, root, root};
ASSERT_EQ(owners, expectedOwners);
YGNodeFreeRecursive(root);
YGNodeFree(root_child0);
}

View File

@@ -45,7 +45,7 @@ struct YGCollectFlexItemsRowValues {
float remainingFreeSpace;
// The size of the mainDim for the row after considering size, padding, margin
// and border of flex items. This is used to calculate maxLineDim after going
// through all the rows to decide on the main axis size of parent.
// through all the rows to decide on the main axis size of owner.
float mainDim;
// The size of the crossDim for the row after considering size, padding,
// margin and border of flex items. Used for calculating containers crossSize.
@@ -109,7 +109,7 @@ inline bool YGFlexDirectionIsRow(const YGFlexDirection flexDirection) {
flexDirection == YGFlexDirectionRowReverse;
}
inline YGFloatOptional YGResolveValue(const YGValue value, const float parentSize) {
inline YGFloatOptional YGResolveValue(const YGValue value, const float ownerSize) {
switch (value.unit) {
case YGUnitUndefined:
case YGUnitAuto:
@@ -118,7 +118,7 @@ inline YGFloatOptional YGResolveValue(const YGValue value, const float parentSiz
return YGFloatOptional(value.value);
case YGUnitPercent:
return YGFloatOptional(
static_cast<float>(value.value * parentSize * 0.01));
static_cast<float>(value.value * ownerSize * 0.01));
}
return YGFloatOptional();
}
@@ -144,6 +144,6 @@ inline YGFlexDirection YGResolveFlexDirection(
static inline float YGResolveValueMargin(
const YGValue value,
const float parentSize) {
return value.unit == YGUnitAuto ? 0 : YGUnwrapFloatOptional(YGResolveValue(value, parentSize));
const float ownerSize) {
return value.unit == YGUnitAuto ? 0 : YGUnwrapFloatOptional(YGResolveValue(value, ownerSize));
}

View File

@@ -22,7 +22,7 @@ YGLayout::YGLayout()
computedFlexBasis(YGUndefined),
hadOverflow(false),
generationCount(0),
lastParentDirection((YGDirection)-1),
lastOwnerDirection((YGDirection)-1),
nextCachedMeasurementsIndex(0),
cachedMeasurements(),
measuredDimensions(kYGDefaultDimensionValues),
@@ -37,7 +37,7 @@ bool YGLayout::operator==(YGLayout layout) const {
YGFloatArrayEqual(border, layout.border) &&
YGFloatArrayEqual(padding, layout.padding) &&
direction == layout.direction && hadOverflow == layout.hadOverflow &&
lastParentDirection == layout.lastParentDirection &&
lastOwnerDirection == layout.lastOwnerDirection &&
nextCachedMeasurementsIndex == layout.nextCachedMeasurementsIndex &&
cachedLayout == layout.cachedLayout;

View File

@@ -23,7 +23,7 @@ struct YGLayout {
// Instead of recomputing the entire layout every single time, we
// cache some information to break early when nothing changed
uint32_t generationCount;
YGDirection lastParentDirection;
YGDirection lastOwnerDirection;
uint32_t nextCachedMeasurementsIndex;
std::array<YGCachedMeasurement, YG_MAX_CACHED_RESULT_COUNT>

View File

@@ -49,8 +49,8 @@ uint32_t YGNode::getLineIndex() const {
return lineIndex_;
}
YGNodeRef YGNode::getParent() const {
return parent_;
YGNodeRef YGNode::getOwner() const {
return owner_;
}
YGVector YGNode::getChildren() const {
@@ -237,8 +237,8 @@ void YGNode::setLineIndex(uint32_t lineIndex) {
lineIndex_ = lineIndex;
}
void YGNode::setParent(YGNodeRef parent) {
parent_ = parent;
void YGNode::setOwner(YGNodeRef owner) {
owner_ = owner;
}
void YGNode::setChildren(const YGVector& children) {
@@ -305,8 +305,8 @@ void YGNode::setLayoutPadding(float padding, int index) {
layout_.padding[index] = padding;
}
void YGNode::setLayoutLastParentDirection(YGDirection direction) {
layout_.lastParentDirection = direction;
void YGNode::setLayoutLastOwnerDirection(YGDirection direction) {
layout_.lastOwnerDirection = direction;
}
void YGNode::setLayoutComputedFlexBasis(float computedFlexBasis) {
@@ -347,11 +347,11 @@ void YGNode::setPosition(
const YGDirection direction,
const float mainSize,
const float crossSize,
const float parentWidth) {
const float ownerWidth) {
/* Root nodes should be always layouted as LTR, so we don't return negative
* values. */
const YGDirection directionRespectingRoot =
parent_ != nullptr ? direction : YGDirectionLTR;
owner_ != nullptr ? direction : YGDirectionLTR;
const YGFlexDirection mainAxis =
YGResolveFlexDirection(style_.flexDirection, directionRespectingRoot);
const YGFlexDirection crossAxis =
@@ -361,16 +361,16 @@ void YGNode::setPosition(
const float relativePositionCross = relativePosition(crossAxis, crossSize);
setLayoutPosition(
getLeadingMargin(mainAxis, parentWidth) + relativePositionMain,
getLeadingMargin(mainAxis, ownerWidth) + relativePositionMain,
leading[mainAxis]);
setLayoutPosition(
getTrailingMargin(mainAxis, parentWidth) + relativePositionMain,
getTrailingMargin(mainAxis, ownerWidth) + relativePositionMain,
trailing[mainAxis]);
setLayoutPosition(
getLeadingMargin(crossAxis, parentWidth) + relativePositionCross,
getLeadingMargin(crossAxis, ownerWidth) + relativePositionCross,
leading[crossAxis]);
setLayoutPosition(
getTrailingMargin(crossAxis, parentWidth) + relativePositionCross,
getTrailingMargin(crossAxis, ownerWidth) + relativePositionCross,
trailing[crossAxis]);
}
@@ -385,7 +385,7 @@ YGNode::YGNode()
style_(YGStyle()),
layout_(YGLayout()),
lineIndex_(0),
parent_(nullptr),
owner_(nullptr),
children_(YGVector()),
nextChild_(nullptr),
config_(nullptr),
@@ -403,7 +403,7 @@ YGNode::YGNode(const YGNode& node)
style_(node.style_),
layout_(node.layout_),
lineIndex_(node.lineIndex_),
parent_(node.parent_),
owner_(node.owner_),
children_(node.children_),
nextChild_(node.nextChild_),
config_(node.config_),
@@ -425,7 +425,7 @@ YGNode::YGNode(
YGStyle style,
const YGLayout& layout,
uint32_t lineIndex,
YGNodeRef parent,
YGNodeRef owner,
const YGVector& children,
YGNodeRef nextChild,
YGConfigRef config,
@@ -441,7 +441,7 @@ YGNode::YGNode(
style_(style),
layout_(layout),
lineIndex_(lineIndex),
parent_(parent),
owner_(owner),
children_(children),
nextChild_(nextChild),
config_(config),
@@ -467,7 +467,7 @@ YGNode& YGNode::operator=(const YGNode& node) {
style_ = node.style_;
layout_ = node.layout_;
lineIndex_ = node.getLineIndex();
parent_ = node.getParent();
owner_ = node.getOwner();
children_ = node.getChildren();
nextChild_ = node.getNextChild();
config_ = node.getConfig();
@@ -518,9 +518,9 @@ void YGNode::resolveDimension() {
}
}
YGDirection YGNode::resolveDirection(const YGDirection parentDirection) {
YGDirection YGNode::resolveDirection(const YGDirection ownerDirection) {
if (style_.direction == YGDirectionInherit) {
return parentDirection > YGDirectionInherit ? parentDirection
return ownerDirection > YGDirectionInherit ? ownerDirection
: YGDirectionLTR;
} else {
return style_.direction;
@@ -550,10 +550,10 @@ void YGNode::cloneChildrenIfNeeded() {
}
const YGNodeRef firstChild = children_.front();
if (firstChild->getParent() == this) {
// If the first child has this node as its parent, we assume that it is
if (firstChild->getOwner() == this) {
// If the first child has this node as its owner, we assume that it is
// already unique. We can do this because if we have it has a child, that
// means that its parent was at some point cloned which made that subtree
// means that its owner was at some point cloned which made that subtree
// immutable. We also assume that all its sibling are cloned as well.
return;
}
@@ -569,7 +569,7 @@ void YGNode::cloneChildrenIfNeeded() {
newChild = YGNodeClone(oldChild);
}
replaceChild(newChild, i);
newChild->setParent(this);
newChild->setOwner(this);
}
}
@@ -577,8 +577,8 @@ void YGNode::markDirtyAndPropogate() {
if (!isDirty_) {
setDirty(true);
setLayoutComputedFlexBasis(YGUndefined);
if (parent_) {
parent_->markDirtyAndPropogate();
if (owner_) {
owner_->markDirtyAndPropogate();
}
}
}
@@ -592,7 +592,7 @@ void YGNode::markDirtyAndPropogateDownwards() {
float YGNode::resolveFlexGrow() {
// Root nodes flexGrow should always be 0
if (parent_ == nullptr) {
if (owner_ == nullptr) {
return 0.0;
}
if (!style_.flexGrow.isUndefined()) {
@@ -605,7 +605,7 @@ float YGNode::resolveFlexGrow() {
}
float YGNode::resolveFlexShrink() {
if (parent_ == nullptr) {
if (owner_ == nullptr) {
return 0.0;
}
if (!style_.flexShrink.isUndefined()) {

View File

@@ -23,7 +23,7 @@ struct YGNode {
YGStyle style_;
YGLayout layout_;
uint32_t lineIndex_;
YGNodeRef parent_;
YGNodeRef owner_;
YGVector children_;
YGNodeRef nextChild_;
YGConfigRef config_;
@@ -49,7 +49,7 @@ struct YGNode {
YGStyle style,
const YGLayout& layout,
uint32_t lineIndex,
YGNodeRef parent,
YGNodeRef owner,
const YGVector& children,
YGNodeRef nextChild,
YGConfigRef config,
@@ -69,7 +69,12 @@ struct YGNode {
// For Performance reasons passing as reference.
YGLayout& getLayout();
uint32_t getLineIndex() const;
YGNodeRef getParent() const;
// returns the YGNodeRef that owns this YGNode. An owner is used to identify
// the YogaTree that a YGNode belongs to.
// This method will return the parent of the YGNode when a YGNode only belongs
// to one YogaTree or nullptr when the YGNode is shared between two or more
// YogaTrees.
YGNodeRef getOwner() const;
YGVector getChildren() const;
uint32_t getChildrenCount() const;
YGNodeRef getChild(uint32_t index) const;
@@ -111,12 +116,12 @@ struct YGNode {
void setStyleAlignContent(YGAlign alignContent);
void setLayout(const YGLayout& layout);
void setLineIndex(uint32_t lineIndex);
void setParent(YGNodeRef parent);
void setOwner(YGNodeRef owner);
void setChildren(const YGVector& children);
void setNextChild(YGNodeRef nextChild);
void setConfig(YGConfigRef config);
void setDirty(bool isDirty);
void setLayoutLastParentDirection(YGDirection direction);
void setLayoutLastOwnerDirection(YGDirection direction);
void setLayoutComputedFlexBasis(float computedFlexBasis);
void setLayoutComputedFlexBasisGeneration(
uint32_t computedFlexBasisGeneration);
@@ -132,7 +137,7 @@ struct YGNode {
const YGDirection direction,
const float mainSize,
const float crossSize,
const float parentWidth);
const float ownerWidth);
void setAndPropogateUseLegacyFlag(bool useLegacyFlag);
void setLayoutDoesLegacyFlagAffectsLayout(bool doesLegacyFlagAffectsLayout);
void setLayoutDidUseLegacyFlag(bool didUseLegacyFlag);
@@ -143,7 +148,7 @@ struct YGNode {
YGValue marginTrailingValue(const YGFlexDirection axis) const;
YGValue resolveFlexBasisPtr() const;
void resolveDimension();
YGDirection resolveDirection(const YGDirection parentDirection);
YGDirection resolveDirection(const YGDirection ownerDirection);
void clearChildren();
/// Replaces the occurrences of oldChild with newChild
void replaceChild(YGNodeRef oldChild, YGNodeRef newChild);

File diff suppressed because it is too large Load Diff

View File

@@ -81,14 +81,14 @@ WIN_EXPORT void YGNodeInsertChild(const YGNodeRef node,
WIN_EXPORT void YGNodeRemoveChild(const YGNodeRef node, const YGNodeRef child);
WIN_EXPORT void YGNodeRemoveAllChildren(const YGNodeRef node);
WIN_EXPORT YGNodeRef YGNodeGetChild(const YGNodeRef node, const uint32_t index);
WIN_EXPORT YGNodeRef YGNodeGetParent(const YGNodeRef node);
WIN_EXPORT YGNodeRef YGNodeGetOwner(const YGNodeRef node);
WIN_EXPORT uint32_t YGNodeGetChildCount(const YGNodeRef node);
WIN_EXPORT void YGNodeSetChildren(YGNodeRef const parent, const YGNodeRef children[], const uint32_t count);
WIN_EXPORT void YGNodeCalculateLayout(const YGNodeRef node,
const float availableWidth,
const float availableHeight,
const YGDirection parentDirection);
const YGDirection ownerDirection);
// Mark a node as dirty. Only valid for nodes with a custom measure function
// set.