docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace keep keep keep keep keep
<mask> } \ <mask> } \ <mask> \ <mask> float YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge) { \ <mask> return YGComputedEdgeValue(node->style.instanceName, edge, &defaultValue)->value; \ <mask> } <mask> <mask> #define YG_NODE_LAYOUT_PROPERTY_IMPL(type, name, instanceName) \ <mask> type YGNodeLayoutGet##name(const YGNodeRef node) { \ <mask> return node->layout.instanceName; \ </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #define YG_NODE_STYLE_PROPERTY_UNIT_AUTO(type, name, paramName) \ YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node); </s> add #define YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(type, name) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node, const YGEdge edge); </s> remove node->style.instanceName[edge].unit != YGUnitPixel) { \ </s> add node->style.instanceName[edge].unit != YGUnitPoint) { \ </s> remove YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPixel; \ </s> add YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint; \ </s> add #define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name) \ YG_NODE_JNI_STYLE_UNIT_PROP(name) \ void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer) { \ YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer)); \ } </s> add #define YG_NODE_JNI_STYLE_EDGE_UNIT_PROP_AUTO(name) \ YG_NODE_JNI_STYLE_EDGE_UNIT_PROP(name) \ void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer, jint edge) { \ YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer), static_cast<YGEdge>(edge)); \ }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep keep
<mask> YG_NODE_STYLE_PROPERTY_IMPL(YGAlign, AlignSelf, alignSelf, alignSelf); <mask> YG_NODE_STYLE_PROPERTY_IMPL(YGPositionType, PositionType, positionType, positionType); <mask> YG_NODE_STYLE_PROPERTY_IMPL(YGWrap, FlexWrap, flexWrap, flexWrap); <mask> YG_NODE_STYLE_PROPERTY_IMPL(YGOverflow, Overflow, overflow, overflow); <mask> <mask> YG_NODE_STYLE_PROPERTY_IMPL(float, Flex, flex, flex); <mask> YG_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexGrow, flexGrow, flexGrow); <mask> YG_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexShrink, flexShrink, flexShrink); <mask> YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, FlexBasis, flexBasis, flexBasis); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add YG_NODE_STYLE_PROPERTY_IMPL(float, Flex, flex, flex); </s> remove YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL(float, FlexBasis, flexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, FlexBasis, flexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY(YGDisplay, Display, display); </s> remove WIN_EXPORT void YGNodeStyleSetFlex(const YGNodeRef node, const float flex); </s> add YG_NODE_STYLE_PROPERTY(float, Flex, flex); </s> remove YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position, YGValueUndefined); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin, YGValueZero); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding, YGValueZero); YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border, YGValueZero); </s> add YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Margin, margin); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding); YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border); </s> remove YG_NODE_STYLE_PROPERTY_UNIT(YGValue, FlexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, FlexBasis, flexBasis);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep keep
<mask> YG_NODE_STYLE_PROPERTY_IMPL(YGOverflow, Overflow, overflow, overflow); <mask> YG_NODE_STYLE_PROPERTY_IMPL(YGDisplay, Display, display, display); <mask> <mask> YG_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexGrow, flexGrow, flexGrow); <mask> YG_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexShrink, flexShrink, flexShrink); <mask> YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, FlexBasis, flexBasis, flexBasis); <mask> <mask> YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL(float, FlexBasis, flexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, FlexBasis, flexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_IMPL(YGDisplay, Display, display, display); </s> remove YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position, YGValueUndefined); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin, YGValueZero); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding, YGValueZero); YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border, YGValueZero); </s> add YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Margin, margin); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding); YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border); </s> add YG_NODE_STYLE_PROPERTY(YGDisplay, Display, display); </s> remove WIN_EXPORT void YGNodeStyleSetFlex(const YGNodeRef node, const float flex); </s> add YG_NODE_STYLE_PROPERTY(float, Flex, flex); </s> remove YG_NODE_STYLE_PROPERTY_UNIT(YGValue, FlexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, FlexBasis, flexBasis);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep replace keep replace replace replace replace keep keep
<mask> YG_NODE_STYLE_PROPERTY_SETTER_IMPL(float, FlexShrink, flexShrink, flexShrink); <mask> YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL(float, FlexBasis, flexBasis, flexBasis); <mask> <mask> YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position, YGValueUndefined); <mask> YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin, YGValueZero); <mask> YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding, YGValueZero); <mask> YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border, YGValueZero); <mask> <mask> YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, Width, width, dimensions[YGDimensionWidth]); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, Width, width, dimensions[YGDimensionWidth]); YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, Height, height, dimensions[YGDimensionHeight]); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Width, width, dimensions[YGDimensionWidth]); YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Height, height, dimensions[YGDimensionHeight]); </s> add YG_NODE_STYLE_PROPERTY_IMPL(float, Flex, flex, flex); </s> remove YG_NODE_STYLE_PROPERTY_UNIT(YGValue, FlexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, FlexBasis, flexBasis); </s> add YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(YGValue, Margin); </s> add YG_NODE_STYLE_PROPERTY_IMPL(YGDisplay, Display, display, display);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin, YGValueZero); <mask> YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding, YGValueZero); <mask> YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border, YGValueZero); <mask> <mask> YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, Width, width, dimensions[YGDimensionWidth]); <mask> YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, Height, height, dimensions[YGDimensionHeight]); <mask> YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MinWidth, minWidth, minDimensions[YGDimensionWidth]); <mask> YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MinHeight, minHeight, minDimensions[YGDimensionHeight]); <mask> YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MaxWidth, maxWidth, maxDimensions[YGDimensionWidth]); <mask> YG_NODE_STYLE_PROPERTY_UNIT_IMPL(YGValue, MaxHeight, maxHeight, maxDimensions[YGDimensionHeight]); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position, YGValueUndefined); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin, YGValueZero); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding, YGValueZero); YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border, YGValueZero); </s> add YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Position, position, position); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Margin, margin, margin); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO_IMPL(YGValue, Margin, margin); YG_NODE_STYLE_EDGE_PROPERTY_UNIT_IMPL(YGValue, Padding, padding, padding); YG_NODE_STYLE_EDGE_PROPERTY_IMPL(float, Border, border, border); </s> remove YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL(float, FlexBasis, flexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(YGValue, FlexBasis, flexBasis, flexBasis); </s> remove YG_NODE_STYLE_PROPERTY_UNIT(YGValue, Width, width); YG_NODE_STYLE_PROPERTY_UNIT(YGValue, Height, height); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, Width, width); YG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, Height, height); </s> add YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(YGValue, Margin); </s> remove YG_NODE_STYLE_PROPERTY_UNIT(YGValue, FlexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, FlexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_IMPL(float, Flex, flex, flex);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> const YGMeasureMode heightMeasureMode, <mask> const float parentWidth, <mask> const float parentHeight, <mask> const bool performLayout, <mask> const char *reason); <mask> <mask> inline bool YGFloatIsUndefined(const float value) { <mask> return isnan(value); <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const char *reason) { </s> add const char *reason, const YGConfigRef config) { </s> remove const bool performLayout) { </s> add const bool performLayout, const YGConfigRef config) { </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) { </s> remove const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn); </s> add const float resolvedFlexBasis = YGValueResolve(YGNodeResolveFlexBasisPtr(child), mainAxisParentSize); const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, parentWidth); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, parentHeight); </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep
<mask> <mask> return fabs(a.value - b.value) < 0.0001f; <mask> } <mask> <mask> static inline bool YGFloatsEqual(const float a, const float b) { <mask> if (YGFloatIsUndefined(a)) { <mask> return YGFloatIsUndefined(b); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> remove const char *reason); </s> add const char *reason, const YGConfigRef config); </s> remove return YGValueResolve(&node->style.margin[YGEdgeStart], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeStart], widthSize); </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } } </s> remove return YGValueResolve(&node->style.margin[YGEdgeEnd], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeEnd], widthSize); </s> remove return YGValueResolve(YGComputedEdgeValue(node->style.margin, trailing[axis], &YGValueZero), widthSize); </s> add return YGValueResolveMargin(YGComputedEdgeValue(node->style.margin, trailing[axis], &YGValueZero), widthSize);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> YGLog(YGLogLevelDebug, <mask> "%s: %g%s, ", <mask> str, <mask> number->value, <mask> number->unit == YGUnitPixel ? "px" : "%"); <mask> } <mask> } <mask> <mask> static void YGPrintNumberIfNotUndefinedf(const char *str, const float number) { <mask> if (!YGFloatIsUndefined(number)) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove number->unit == YGUnitPixel ? "px" : "%"); </s> add number->unit == YGUnitPoint ? "pt" : "%"); </s> remove const bool performLayout) { </s> add const bool performLayout, const YGConfigRef config) { </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> remove YGPrintNumberIfNotUndefinedf("flexGrow", YGNodeStyleGetFlexGrow(node)); YGPrintNumberIfNotUndefinedf("flexShrink", YGNodeStyleGetFlexShrink(node)); YGPrintNumberIfNotUndefined("flexBasis", YGNodeStyleGetFlexBasisPtr(node)); </s> add YGPrintNumberIfNotUndefinedf("flexGrow", YGResolveFlexGrow(node)); YGPrintNumberIfNotUndefinedf("flexShrink", YGNodeResolveFlexShrink(node)); YGPrintNumberIfNotUndefined("flexBasis", YGNodeResolveFlexBasisPtr(node)); </s> remove const char *reason); </s> add const char *reason, const YGConfigRef config);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> YGLog(YGLogLevelDebug, <mask> "%s: %g%s, ", <mask> str, <mask> number->value, <mask> number->unit == YGUnitPixel ? "px" : "%"); <mask> } <mask> } <mask> <mask> static bool YGFourValuesEqual(const YGValue four[4]) { <mask> return YGValueEqual(four[0], four[1]) && YGValueEqual(four[0], four[2]) && </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove number->unit == YGUnitPixel ? "px" : "%"); </s> add number->unit == YGUnitPoint ? "pt" : "%"); </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> remove (YGNodeStyleGetFlexGrow(node) != 0 || YGNodeStyleGetFlexShrink(node) != 0)); </s> add (YGResolveFlexGrow(node) != 0 || YGNodeResolveFlexShrink(node) != 0)); </s> remove inline bool YGIsExperimentalFeatureEnabled(YGExperimentalFeature feature) { return experimentalFeatures[feature]; </s> add inline bool YGConfigIsExperimentalFeatureEnabled(const YGConfigRef config, const YGExperimentalFeature feature) { return config->experimentalFeatures[feature]; </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } } </s> remove childHeight = updatedMainSize + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && widthMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], availableInnerWidth) + marginRow; childWidthMeasureMode = YGMeasureModeExactly; } </s> add childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]], availableInnerCrossDim) + marginCross; const bool isLoosePercentageMeasurement = currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent && measureModeCrossDim != YGMeasureModeExactly; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement ? YGMeasureModeUndefined : YGMeasureModeExactly;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> } else if (node->style.alignSelf == YGAlignStretch) { <mask> YGLog(YGLogLevelDebug, "alignSelf: 'stretch', "); <mask> } <mask> <mask> YGPrintNumberIfNotUndefinedf("flexGrow", YGNodeStyleGetFlexGrow(node)); <mask> YGPrintNumberIfNotUndefinedf("flexShrink", YGNodeStyleGetFlexShrink(node)); <mask> YGPrintNumberIfNotUndefined("flexBasis", YGNodeStyleGetFlexBasisPtr(node)); <mask> <mask> if (node->style.overflow == YGOverflowHidden) { <mask> YGLog(YGLogLevelDebug, "overflow: 'hidden', "); <mask> } else if (node->style.overflow == YGOverflowVisible) { <mask> YGLog(YGLogLevelDebug, "overflow: 'visible', "); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove number->unit == YGUnitPixel ? "px" : "%"); </s> add number->unit == YGUnitPoint ? "pt" : "%"); </s> remove } else { // YGAlignFlexEnd </s> add } else if (YGMarginTrailingValue(child, crossAxis)->unit == YGUnitAuto) { // No-Op } else if (YGMarginLeadingValue(child, crossAxis)->unit == YGUnitAuto) { leadingCrossDim += remainingCrossDim; } else if (alignItem == YGAlignFlexStart) { // No-Op } else if (alignItem == YGAlignCenter) { leadingCrossDim += remainingCrossDim / 2; } else { </s> remove number->unit == YGUnitPixel ? "px" : "%"); </s> add number->unit == YGUnitPoint ? "pt" : "%"); </s> remove if (alignItem == YGAlignCenter) { </s> add if (YGMarginLeadingValue(child, crossAxis)->unit == YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit == YGUnitAuto) { </s> remove childHeight = updatedMainSize + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && widthMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], availableInnerWidth) + marginRow; childWidthMeasureMode = YGMeasureModeExactly; } </s> add childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]], availableInnerCrossDim) + marginCross; const bool isLoosePercentageMeasurement = currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent && measureModeCrossDim != YGMeasureModeExactly; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove } else if (alignItem != YGAlignFlexStart) { </s> add } else {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep replace replace keep keep keep
<mask> static inline float YGNodeLeadingMargin(const YGNodeRef node, <mask> const YGFlexDirection axis, <mask> const float widthSize) { <mask> if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { <mask> return YGValueResolve(&node->style.margin[YGEdgeStart], widthSize); <mask> } <mask> <mask> return YGValueResolve(YGComputedEdgeValue(node->style.margin, leading[axis], &YGValueZero), <mask> widthSize); <mask> } <mask> <mask> static float YGNodeTrailingMargin(const YGNodeRef node, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove return YGValueResolve(&node->style.margin[YGEdgeEnd], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeEnd], widthSize); </s> remove return YGValueResolve(YGComputedEdgeValue(node->style.margin, trailing[axis], &YGValueZero), widthSize); </s> add return YGValueResolveMargin(YGComputedEdgeValue(node->style.margin, trailing[axis], &YGValueZero), widthSize); </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } } </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace keep keep replace replace keep keep keep
<mask> const float widthSize) { <mask> if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { <mask> return YGValueResolve(&node->style.margin[YGEdgeEnd], widthSize); <mask> } <mask> <mask> return YGValueResolve(YGComputedEdgeValue(node->style.margin, trailing[axis], &YGValueZero), <mask> widthSize); <mask> } <mask> <mask> static float YGNodeLeadingPadding(const YGNodeRef node, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove return YGValueResolve(YGComputedEdgeValue(node->style.margin, leading[axis], &YGValueZero), widthSize); </s> add return YGValueResolveMargin(YGComputedEdgeValue(node->style.margin, leading[axis], &YGValueZero), widthSize); </s> remove return YGValueResolve(&node->style.margin[YGEdgeStart], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeStart], widthSize); </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } } </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> remove (YGNodeStyleGetFlexGrow(node) != 0 || YGNodeStyleGetFlexShrink(node) != 0)); </s> add (YGResolveFlexGrow(node) != 0 || YGNodeResolveFlexShrink(node) != 0));
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> return baseline; <mask> } <mask> <mask> YGNodeRef baselineChild = NULL; <mask> for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { <mask> const YGNodeRef child = YGNodeGetChild(node, i); <mask> if (child->lineIndex > 0) { <mask> break; <mask> } <mask> if (child->style.positionType == YGPositionTypeAbsolute) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add float totalFlexBasis = 0; </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> add // As we only wrapped in normal direction yet, we need to reverse the positions on wrap-reverse. if (performLayout && node->style.flexWrap == YGWrapWrapReverse) { for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeGetChild(node, i); if (child->style.positionType == YGPositionTypeRelative) { child->layout.position[pos[crossAxis]] = node->layout.measuredDimensions[dim[crossAxis]] - child->layout.position[pos[crossAxis]] - child->layout.measuredDimensions[dim[crossAxis]]; } } } </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> static inline bool YGNodeIsFlex(const YGNodeRef node) { <mask> return (node->style.positionType == YGPositionTypeRelative && <mask> (YGNodeStyleGetFlexGrow(node) != 0 || YGNodeStyleGetFlexShrink(node) != 0)); <mask> } <mask> <mask> static bool YGIsBaselineLayout(const YGNodeRef node) { <mask> if (YGFlexDirectionIsColumn(node->style.flexDirection)) { <mask> return false; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> add static inline void YGResolveDimensions(YGNodeRef node) { for (YGDimension dim = YGDimensionWidth; dim <= YGDimensionHeight; dim++) { if (node->style.maxDimensions[dim].unit != YGUnitUndefined && YGValueEqual(node->style.maxDimensions[dim], node->style.minDimensions[dim])) { node->resolvedDimensions[dim] = &node->style.maxDimensions[dim]; } else { node->resolvedDimensions[dim] = &node->style.dimensions[dim]; } } } </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } } </s> remove return YGValueResolve(&node->style.margin[YGEdgeStart], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeStart], widthSize); </s> remove using JQuickPerformanceLoggerProvider = JObjectWrapper<jqplProvider>; }} </s> add </s> remove return YGValueResolve(&node->style.margin[YGEdgeEnd], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeEnd], widthSize);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> if (node->style.alignItems == YGAlignBaseline) { <mask> return true; <mask> } <mask> for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { <mask> const YGNodeRef child = YGNodeGetChild(node, i); <mask> if (child->style.positionType == YGPositionTypeRelative && <mask> child->style.alignSelf == YGAlignBaseline) { <mask> return true; <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add float totalFlexBasis = 0; </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child); </s> add // As we only wrapped in normal direction yet, we need to reverse the positions on wrap-reverse. if (performLayout && node->style.flexWrap == YGWrapWrapReverse) { for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeGetChild(node, i); if (child->style.positionType == YGPositionTypeRelative) { child->layout.position[pos[crossAxis]] = node->layout.measuredDimensions[dim[crossAxis]] - child->layout.position[pos[crossAxis]] - child->layout.measuredDimensions[dim[crossAxis]]; } } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> return node->layout.measuredDimensions[dim[axis]] + YGNodeLeadingMargin(node, axis, widthSize) + <mask> YGNodeTrailingMargin(node, axis, widthSize); <mask> } <mask> <mask> static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { <mask> return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && <mask> node->style.dimensions[dim[axis]].value >= 0.0f; <mask> } <mask> <mask> static inline bool YGNodeIsLayoutDimDefined(const YGNodeRef node, const YGFlexDirection axis) { <mask> const float value = node->layout.measuredDimensions[dim[axis]]; <mask> return !YGFloatIsUndefined(value) && value >= 0.0f; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove return YGValueResolve(&node->style.margin[YGEdgeStart], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeStart], widthSize); </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } } </s> remove return YGValueResolve(&node->style.margin[YGEdgeEnd], widthSize); </s> add return YGValueResolveMargin(&node->style.margin[YGEdgeEnd], widthSize); </s> remove return YGValueResolve(YGComputedEdgeValue(node->style.margin, trailing[axis], &YGValueZero), widthSize); </s> add return YGValueResolveMargin(YGComputedEdgeValue(node->style.margin, trailing[axis], &YGValueZero), widthSize); </s> remove return YGValueResolve(YGComputedEdgeValue(node->style.margin, leading[axis], &YGValueZero), widthSize); </s> add return YGValueResolveMargin(YGComputedEdgeValue(node->style.margin, leading[axis], &YGValueZero), widthSize); </s> remove (YGNodeStyleGetFlexGrow(node) != 0 || YGNodeStyleGetFlexShrink(node) != 0)); </s> add (YGResolveFlexGrow(node) != 0 || YGNodeResolveFlexShrink(node) != 0));
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep
<mask> return boundValue; <mask> } <mask> <mask> // Like YGNodeBoundAxisWithinMinAndMax but also ensures that the value doesn't go <mask> // below the <mask> // padding and border amount. <mask> static inline float YGNodeBoundAxis(const YGNodeRef node, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> remove const float availableWidth, const float availableHeight, </s> add const float parentWidth, const float parentHeight, </s> remove // pixel values then the returned value will be the same as YGNodeStyleGetXXX. However if </s> add // point values then the returned value will be the same as YGNodeStyleGetXXX. However if </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove YGValueResolve(&child->style.dimensions[YGDimensionHeight], parentHeight) + marginColumn; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionHeight], parentHeight) + marginColumn;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> const float height, <mask> const float parentWidth, <mask> const float parentHeight, <mask> const YGMeasureMode heightMode, <mask> const YGDirection direction) { <mask> const YGFlexDirection mainAxis = YGFlexDirectionResolve(node->style.flexDirection, direction); <mask> const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis); <mask> const float mainAxisSize = isMainAxisRow ? width : height; <mask> const float mainAxisParentSize = isMainAxisRow ? parentWidth : parentHeight; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const bool isNodeFlexWrap = node->style.flexWrap == YGWrapWrap; </s> add const bool isNodeFlexWrap = node->style.flexWrap != YGWrapNoWrap; </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; </s> remove const bool performLayout) { </s> add const bool performLayout, const YGConfigRef config) { </s> remove const char *reason) { </s> add const char *reason, const YGConfigRef config) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> float childHeight; <mask> YGMeasureMode childWidthMeasureMode; <mask> YGMeasureMode childHeightMeasureMode; <mask> <mask> const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow); <mask> const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn); <mask> <mask> if (YGNodeStyleGetFlexBasisPtr(child)->unit != YGUnitUndefined && <mask> !YGFloatIsUndefined(mainAxisSize)) { <mask> if (YGFloatIsUndefined(child->layout.computedFlexBasis) || <mask> (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis) && </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (YGNodeStyleGetFlexBasisPtr(child)->unit != YGUnitUndefined && !YGFloatIsUndefined(mainAxisSize)) { </s> add if (!YGFloatIsUndefined(resolvedFlexBasis) && !YGFloatIsUndefined(mainAxisSize)) { </s> remove (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis) && </s> add (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureWebFlexBasis) && </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> remove const char *reason) { </s> add const char *reason, const YGConfigRef config) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep replace replace keep replace keep keep
<mask> const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow); <mask> const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn); <mask> <mask> if (YGNodeStyleGetFlexBasisPtr(child)->unit != YGUnitUndefined && <mask> !YGFloatIsUndefined(mainAxisSize)) { <mask> if (YGFloatIsUndefined(child->layout.computedFlexBasis) || <mask> (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis) && <mask> child->layout.computedFlexBasisGeneration != gCurrentGenerationCount)) { <mask> child->layout.computedFlexBasis = </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn); </s> add const float resolvedFlexBasis = YGValueResolve(YGNodeResolveFlexBasisPtr(child), mainAxisParentSize); const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, parentWidth); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, parentHeight); </s> remove fmaxf(YGValueResolve(YGNodeStyleGetFlexBasisPtr(child), mainAxisParentSize), YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); </s> add fmaxf(resolvedFlexBasis, YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove (YGNodeStyleGetFlexGrow(node) != 0 || YGNodeStyleGetFlexShrink(node) != 0)); </s> add (YGResolveFlexGrow(node) != 0 || YGNodeResolveFlexShrink(node) != 0));
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep replace replace keep keep keep keep replace
<mask> (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis) && <mask> child->layout.computedFlexBasisGeneration != gCurrentGenerationCount)) { <mask> child->layout.computedFlexBasis = <mask> fmaxf(YGValueResolve(YGNodeStyleGetFlexBasisPtr(child), mainAxisParentSize), <mask> YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); <mask> } <mask> } else if (isMainAxisRow && isRowStyleDimDefined) { <mask> // The width is definite, so use that as the flex basis. <mask> child->layout.computedFlexBasis = <mask> fmaxf(YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth), </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis) && </s> add (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureWebFlexBasis) && </s> remove fmaxf(YGValueResolve(&child->style.dimensions[YGDimensionHeight], parentHeight), </s> add fmaxf(YGValueResolve(child->resolvedDimensions[YGDimensionHeight], parentHeight), </s> remove if (YGNodeStyleGetFlexBasisPtr(child)->unit != YGUnitUndefined && !YGFloatIsUndefined(mainAxisSize)) { </s> add if (!YGFloatIsUndefined(resolvedFlexBasis) && !YGFloatIsUndefined(mainAxisSize)) { </s> remove fmaxf(isMainAxisRow ? child->layout.measuredDimensions[YGDimensionWidth] : child->layout.measuredDimensions[YGDimensionHeight], </s> add fmaxf(child->layout.measuredDimensions[dim[mainAxis]], </s> remove "measure"); </s> add "measure", config);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> YGNodePaddingAndBorderForAxis(child, YGFlexDirectionRow, parentWidth)); <mask> } else if (!isMainAxisRow && isColumnStyleDimDefined) { <mask> // The height is definite, so use that as the flex basis. <mask> child->layout.computedFlexBasis = <mask> fmaxf(YGValueResolve(&child->style.dimensions[YGDimensionHeight], parentHeight), <mask> YGNodePaddingAndBorderForAxis(child, YGFlexDirectionColumn, parentWidth)); <mask> } else { <mask> // Compute the flex basis and hypothetical main size (i.e. the clamped <mask> // flex basis). <mask> childWidth = YGUndefined; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove fmaxf(YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth), </s> add fmaxf(YGValueResolve(child->resolvedDimensions[YGDimensionWidth], parentWidth), </s> remove fmaxf(YGValueResolve(YGNodeStyleGetFlexBasisPtr(child), mainAxisParentSize), YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); </s> add fmaxf(resolvedFlexBasis, YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) { </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, height)) { </s> remove // We resolve main dimension to fit minimum and maximum values if (YGFloatIsUndefined(availableInnerMainDim)) { </s> add // If we don't measure with exact main dimension we want to ensure we don't violate min and max if (measureModeMainDim != YGMeasureModeExactly) { </s> remove if (isMainAxisRow) { childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth)); childHeightMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childHeight = fminf((childHeight - marginColumn), availableInnerHeight); childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; } childHeight += marginColumn; } else { childWidth = fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth)); childWidthMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childWidth = fminf((childWidth - marginRow), availableInnerWidth); childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; } childWidth += marginRow; </s> add childCrossSize = fmaxf( isMainAxisRow ? (childMainSize - marginMain) / currentRelativeChild->style.aspectRatio : (childMainSize - marginMain) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, crossAxis, availableInnerWidth)); childCrossMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childCrossSize = fminf(childCrossSize - marginCross, availableInnerCrossDim); childMainSize = marginMain + (isMainAxisRow ? childCrossSize * currentRelativeChild->style.aspectRatio : childCrossSize / currentRelativeChild->style.aspectRatio); </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace keep keep keep keep replace keep keep keep keep
<mask> if (isRowStyleDimDefined) { <mask> childWidth = <mask> YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth) + marginRow; <mask> childWidthMeasureMode = YGMeasureModeExactly; <mask> } <mask> if (isColumnStyleDimDefined) { <mask> childHeight = <mask> YGValueResolve(&child->style.dimensions[YGDimensionHeight], parentHeight) + marginColumn; <mask> childHeightMeasureMode = YGMeasureModeExactly; <mask> } <mask> <mask> // The W3C spec doesn't say anything about the 'overflow' property, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove childHeight = updatedMainSize + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && widthMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], availableInnerWidth) + marginRow; childWidthMeasureMode = YGMeasureModeExactly; } </s> add childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]], availableInnerCrossDim) + marginCross; const bool isLoosePercentageMeasurement = currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent && measureModeCrossDim != YGMeasureModeExactly; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove if (isMainAxisRow) { childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth)); childHeightMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childHeight = fminf((childHeight - marginColumn), availableInnerHeight); childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; } childHeight += marginColumn; } else { childWidth = fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth)); childWidthMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childWidth = fminf((childWidth - marginRow), availableInnerWidth); childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; } childWidth += marginRow; </s> add childCrossSize = fmaxf( isMainAxisRow ? (childMainSize - marginMain) / currentRelativeChild->style.aspectRatio : (childMainSize - marginMain) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, crossAxis, availableInnerWidth)); childCrossMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childCrossSize = fminf(childCrossSize - marginCross, availableInnerCrossDim); childMainSize = marginMain + (isMainAxisRow ? childCrossSize * currentRelativeChild->style.aspectRatio : childCrossSize / currentRelativeChild->style.aspectRatio); </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) { </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, height)) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace keep keep replace replace keep keep
<mask> parentHeight, <mask> false, <mask> "measure"); <mask> <mask> child->layout.computedFlexBasis = <mask> fmaxf(isMainAxisRow ? child->layout.measuredDimensions[YGDimensionWidth] <mask> : child->layout.measuredDimensions[YGDimensionHeight], <mask> YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove fmaxf(YGValueResolve(YGNodeStyleGetFlexBasisPtr(child), mainAxisParentSize), YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); </s> add fmaxf(resolvedFlexBasis, YGNodePaddingAndBorderForAxis(child, mainAxis, parentWidth)); </s> remove (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureWebFlexBasis) && </s> add (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureWebFlexBasis) && </s> remove fmaxf(YGValueResolve(&child->style.dimensions[YGDimensionHeight], parentHeight), </s> add fmaxf(YGValueResolve(child->resolvedDimensions[YGDimensionHeight], parentHeight), </s> remove fmaxf(YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth), </s> add fmaxf(YGValueResolve(child->resolvedDimensions[YGDimensionWidth], parentWidth), </s> remove "abs-measure"); </s> add "abs-measure", config);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> const YGNodeRef child, <mask> const float width, <mask> const YGMeasureMode widthMode, <mask> const float height, <mask> const YGDirection direction) { <mask> const YGFlexDirection mainAxis = YGFlexDirectionResolve(node->style.flexDirection, direction); <mask> const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, direction); <mask> const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis); <mask> <mask> float childWidth = YGUndefined; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const bool isNodeFlexWrap = node->style.flexWrap == YGWrapWrap; </s> add const bool isNodeFlexWrap = node->style.flexWrap != YGWrapNoWrap; </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add typedef struct YGConfig *YGConfigRef; </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) { </s> remove const char *reason) { </s> add const char *reason, const YGConfigRef config) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, width); <mask> const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, width); <mask> <mask> if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)) { <mask> childWidth = YGValueResolve(&child->style.dimensions[YGDimensionWidth], width) + marginRow; <mask> } else { <mask> // If the child doesn't have a specified width, compute the width based <mask> // on the left/right <mask> // offsets if they're defined. <mask> if (YGNodeIsLeadingPosDefined(child, YGFlexDirectionRow) && </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) { </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, height)) { </s> remove YGValueResolve(&child->style.dimensions[YGDimensionHeight], height) + marginColumn; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionHeight], height) + marginColumn; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth) + marginRow; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionWidth], parentWidth) + marginRow; </s> remove "abs-measure"); </s> add "abs-measure", config); </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep replace keep replace keep keep keep
<mask> <mask> if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) { <mask> childHeight = <mask> YGValueResolve(&child->style.dimensions[YGDimensionHeight], height) + marginColumn; <mask> } else { <mask> // If the child doesn't have a specified height, compute the height <mask> // based on the top/bottom </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)) { childWidth = YGValueResolve(&child->style.dimensions[YGDimensionWidth], width) + marginRow; </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) { childWidth = YGValueResolve(child->resolvedDimensions[YGDimensionWidth], width) + marginRow; </s> remove YGValueResolve(&child->style.dimensions[YGDimensionHeight], parentHeight) + marginColumn; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionHeight], parentHeight) + marginColumn; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> childHeightMeasureMode, <mask> childWidth, <mask> childHeight, <mask> false, <mask> "abs-measure"); <mask> childWidth = child->layout.measuredDimensions[YGDimensionWidth] + <mask> YGNodeMarginForAxis(child, YGFlexDirectionRow, width); <mask> childHeight = child->layout.measuredDimensions[YGDimensionHeight] + <mask> YGNodeMarginForAxis(child, YGFlexDirectionColumn, width); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)) { childWidth = YGValueResolve(&child->style.dimensions[YGDimensionWidth], width) + marginRow; </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) { childWidth = YGValueResolve(child->resolvedDimensions[YGDimensionWidth], width) + marginRow; </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) { </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, height)) { </s> remove YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth) + marginRow; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionWidth], parentWidth) + marginRow; </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } } </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove "measure"); </s> add "measure", config);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> YGMeasureModeExactly, <mask> childWidth, <mask> childHeight, <mask> true, <mask> "abs-layout"); <mask> <mask> if (YGNodeIsTrailingPosDefined(child, mainAxis) && !YGNodeIsLeadingPosDefined(child, mainAxis)) { <mask> child->layout.position[leading[mainAxis]] = node->layout.measuredDimensions[dim[mainAxis]] - <mask> child->layout.measuredDimensions[dim[mainAxis]] - <mask> YGNodeTrailingBorder(node, mainAxis) - </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } } </s> remove "stretch"); </s> add "stretch", config); </s> remove node, YGFlexDirectionRow, availableWidth - marginAxisRow, availableWidth, availableWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis(node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, availableHeight, availableWidth); </s> add node, YGFlexDirectionRow, availableWidth - marginAxisRow, parentWidth, parentWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis( node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, parentHeight, parentWidth); </s> add // We want to make sure our available width does not violate min and max constraints </s> remove } else if (alignItem != YGAlignFlexStart) { </s> add } else { </s> remove static void roundToPixelGrid(const YGNodeRef node) { const float fractialLeft = node->layout.position[YGEdgeLeft] - floorf(node->layout.position[YGEdgeLeft]); const float fractialTop = node->layout.position[YGEdgeTop] - floorf(node->layout.position[YGEdgeTop]); node->layout.dimensions[YGDimensionWidth] = roundf(fractialLeft + node->layout.dimensions[YGDimensionWidth]) - roundf(fractialLeft); node->layout.dimensions[YGDimensionHeight] = roundf(fractialTop + node->layout.dimensions[YGDimensionHeight]) - roundf(fractialTop); </s> add static float gPointScaleFactor = 1.0;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> static void YGNodeWithMeasureFuncSetMeasuredDimensions(const YGNodeRef node, <mask> const float availableWidth, <mask> const float availableHeight, <mask> const YGMeasureMode widthMeasureMode, <mask> const YGMeasureMode heightMeasureMode) { <mask> YG_ASSERT(node->measure, "Expected node to have custom measure function"); <mask> <mask> const float paddingAndBorderAxisRow = <mask> YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, availableWidth); <mask> const float paddingAndBorderAxisColumn = </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const float availableWidth, const float availableHeight, </s> add const float parentWidth, const float parentHeight, </s> add typedef struct YGConfig *YGConfigRef; </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn); </s> add const float resolvedFlexBasis = YGValueResolve(YGNodeResolveFlexBasisPtr(child), mainAxisParentSize); const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, parentWidth); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, parentHeight);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
<mask> <mask> if (widthMeasureMode == YGMeasureModeExactly && heightMeasureMode == YGMeasureModeExactly) { <mask> // Don't bother sizing the text if both dimensions are already defined. <mask> node->layout.measuredDimensions[YGDimensionWidth] = YGNodeBoundAxis( <mask> node, YGFlexDirectionRow, availableWidth - marginAxisRow, availableWidth, availableWidth); <mask> node->layout.measuredDimensions[YGDimensionHeight] = <mask> YGNodeBoundAxis(node, <mask> YGFlexDirectionColumn, <mask> availableHeight - marginAxisColumn, <mask> availableHeight, <mask> availableWidth); <mask> } else if (innerWidth <= 0.0f || innerHeight <= 0.0f) { <mask> // Don't bother sizing the text if there's no horizontal or vertical <mask> // space. <mask> node->layout.measuredDimensions[YGDimensionWidth] = <mask> YGNodeBoundAxis(node, YGFlexDirectionRow, 0.0f, availableWidth, availableWidth); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); </s> remove if (!YGFloatIsUndefined(width)) { widthMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); </s> add float width = YGUndefined; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, parentWidth)) { width = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionRow]], parentWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth); </s> remove if (!YGFloatIsUndefined(height)) { heightMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn)) { height = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionColumn]], availableHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); </s> add float height = YGUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) { height = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionColumn]], parentHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth); </s> remove height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight); </s> add height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight); </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)) { childWidth = YGValueResolve(&child->style.dimensions[YGDimensionWidth], width) + marginRow; </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) { childWidth = YGValueResolve(child->resolvedDimensions[YGDimensionWidth], width) + marginRow; </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight) >=
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep keep
<mask> <mask> return false; <mask> } <mask> <mask> // <mask> // This is the main routine that implements a subset of the flexbox layout <mask> // algorithm <mask> // described in the W3C YG documentation: https://www.w3.org/TR/YG3-flexbox/. <mask> // </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing. </s> remove !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis) && </s> add !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis; </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension.
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> // by document order. <mask> // * The 'visibility' property is always assumed to be 'visible'. Values of <mask> // 'collapse' <mask> // and 'hidden' are not supported. <mask> // * The 'wrap' property supports only 'nowrap' (which is the default) or <mask> // 'wrap'. The <mask> // rarely-used 'wrap-reverse' is not supported. <mask> // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and <mask> // flexBasis, this algorithm supports only the three most common <mask> // combinations: <mask> // flex: 0 is equiavlent to flex: 0 0 auto <mask> // flex: n (where n is a positive value) is equivalent to flex: n 1 auto <mask> // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 <mask> // This is faster because the content doesn't need to be measured, but <mask> // it's <mask> // less flexible because the basis is always 0 and can't be overriden <mask> // with <mask> // the width/height attributes. <mask> // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto <mask> // * Margins cannot be specified as 'auto'. They must be specified in terms of <mask> // pixel <mask> // values, and the default value is 0. <mask> // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must <mask> // be <mask> // specified as pixel values, not as percentages. <mask> // * There is no support for calculation of dimensions based on intrinsic <mask> // aspect ratios <mask> // (e.g. images). <mask> // * There is no support for forced breaks. <mask> // * It does not support vertical inline directions (top-to-bottom or <mask> // bottom-to-top text). <mask> // <mask> // Deviations from standard: </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove // allocate 0 pixels for </s> add // allocate 0 points for </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis; </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> add #include <folly/Conv.h> #include <folly/dynamic.h> </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing. </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> const YGMeasureMode widthMeasureMode, <mask> const YGMeasureMode heightMeasureMode, <mask> const float parentWidth, <mask> const float parentHeight, <mask> const bool performLayout) { <mask> YG_ASSERT(YGFloatIsUndefined(availableWidth) ? widthMeasureMode == YGMeasureModeUndefined : true, <mask> "availableWidth is indefinite so widthMeasureMode must be " <mask> "YGMeasureModeUndefined"); <mask> YG_ASSERT(YGFloatIsUndefined(availableHeight) ? heightMeasureMode == YGMeasureModeUndefined <mask> : true, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const char *reason); </s> add const char *reason, const YGConfigRef config); </s> remove const char *reason) { </s> add const char *reason, const YGConfigRef config) { </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> node->layout.padding[YGEdgeBottom] = <mask> YGNodeTrailingPadding(node, flexColumnDirection, parentWidth); <mask> <mask> if (node->measure) { <mask> YGNodeWithMeasureFuncSetMeasuredDimensions( <mask> node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode); <mask> return; <mask> } <mask> <mask> const uint32_t childCount = YGNodeListCount(node->children); <mask> if (childCount == 0) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove roundToPixelGrid(YGNodeGetChild(node, i)); </s> add YGRoundToPixelGrid(YGNodeGetChild(node, i)); </s> remove node, YGFlexDirectionRow, availableWidth - marginAxisRow, availableWidth, availableWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis(node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, availableHeight, availableWidth); </s> add node, YGFlexDirectionRow, availableWidth - marginAxisRow, parentWidth, parentWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis( node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, parentHeight, parentWidth); </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove "initia" "l")) { YGNodeSetPosition(node, node->layout.direction, availableWidth, availableHeight, availableWidth); </s> add "initial", node->config)) { YGNodeSetPosition(node, node->layout.direction, parentWidth, parentHeight, parentWidth); </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) { </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> const YGFlexDirection mainAxis = YGFlexDirectionResolve(node->style.flexDirection, direction); <mask> const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, direction); <mask> const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis); <mask> const YGJustify justifyContent = node->style.justifyContent; <mask> const bool isNodeFlexWrap = node->style.flexWrap == YGWrapWrap; <mask> <mask> const float mainAxisParentSize = isMainAxisRow ? parentWidth : parentHeight; <mask> const float crossAxisParentSize = isMainAxisRow ? parentHeight : parentWidth; <mask> <mask> YGNodeRef firstAbsoluteChild = NULL; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; </s> add // We want to make sure our available height does not violate min and max constraints </s> remove if (!isCrossSizeDefinite) { childWidthMeasureMode = </s> add if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { float childMainSize = child->layout.measuredDimensions[dim[mainAxis]]; float childCrossSize = !YGFloatIsUndefined(child->style.aspectRatio) ? ((YGNodeMarginForAxis(child, crossAxis, availableInnerWidth) + (isMainAxisRow ? childMainSize / child->style.aspectRatio : childMainSize * child->style.aspectRatio))) : crossDim; childMainSize += YGNodeMarginForAxis(child, mainAxis, availableInnerWidth); YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly; YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[mainAxis]], availableInnerMainDim), &childMainMeasureMode, &childMainSize); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[crossAxis]], availableInnerCrossDim), &childCrossMeasureMode, &childCrossSize); const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode =
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> const float paddingAndBorderAxisMain = YGNodePaddingAndBorderForAxis(node, mainAxis, parentWidth); <mask> const float paddingAndBorderAxisCross = <mask> YGNodePaddingAndBorderForAxis(node, crossAxis, parentWidth); <mask> <mask> const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; <mask> const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; <mask> <mask> const float paddingAndBorderAxisRow = <mask> isMainAxisRow ? paddingAndBorderAxisMain : paddingAndBorderAxisCross; <mask> const float paddingAndBorderAxisColumn = <mask> isMainAxisRow ? paddingAndBorderAxisCross : paddingAndBorderAxisMain; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; </s> remove const bool isNodeFlexWrap = node->style.flexWrap == YGWrapWrap; </s> add const bool isNodeFlexWrap = node->style.flexWrap != YGWrapNoWrap; </s> remove if (!isCrossSizeDefinite) { childWidthMeasureMode = </s> add if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { float childMainSize = child->layout.measuredDimensions[dim[mainAxis]]; float childCrossSize = !YGFloatIsUndefined(child->style.aspectRatio) ? ((YGNodeMarginForAxis(child, crossAxis, availableInnerWidth) + (isMainAxisRow ? childMainSize / child->style.aspectRatio : childMainSize * child->style.aspectRatio))) : crossDim; childMainSize += YGNodeMarginForAxis(child, mainAxis, availableInnerWidth); YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly; YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[mainAxis]], availableInnerMainDim), &childMainMeasureMode, &childMainSize); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[crossAxis]], availableInnerCrossDim), &childCrossMeasureMode, &childCrossSize); const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = </s> add // We want to make sure our available height does not violate min and max constraints </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep keep keep
<mask> // above <mask> float availableInnerWidth = availableWidth - marginAxisRow - paddingAndBorderAxisRow; <mask> if (!YGFloatIsUndefined(availableInnerWidth)) { <mask> availableInnerWidth = fmaxf(fminf(availableInnerWidth, maxInnerWidth), minInnerWidth); <mask> } <mask> <mask> float availableInnerHeight = availableHeight - marginAxisColumn - paddingAndBorderAxisColumn; <mask> if (!YGFloatIsUndefined(availableInnerHeight)) { <mask> // We want to make sure our available height does not violate min and max constraints </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add // We want to make sure our available height does not violate min and max constraints </s> remove node, YGFlexDirectionRow, availableWidth - marginAxisRow, availableWidth, availableWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis(node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, availableHeight, availableWidth); </s> add node, YGFlexDirectionRow, availableWidth - marginAxisRow, parentWidth, parentWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis( node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, parentHeight, parentWidth); </s> remove node->layout.position[YGEdgeLeft] = roundf(node->layout.position[YGEdgeLeft]); node->layout.position[YGEdgeTop] = roundf(node->layout.position[YGEdgeTop]); </s> add void YGSetPointScaleFactor(float pixelsInPoint) { YG_ASSERT(pixelsInPoint >= 0.0, "Scale factor should not be less than zero"); // We store points for Pixel as we will use it for rounding if (pixelsInPoint == 0.0) { // Zero is used to skip rounding gPointScaleFactor = 0.0; } else { gPointScaleFactor = 1.0 / pixelsInPoint; } } static void YGRoundToPixelGrid(const YGNodeRef node) { if (gPointScaleFactor == 0.0) { return; } const float nodeLeft = node->layout.position[YGEdgeLeft]; const float nodeTop = node->layout.position[YGEdgeTop]; // To round correctly to the pixel grid, first we calculate left and top coordinates float fractialLeft = fmodf(nodeLeft, gPointScaleFactor); float fractialTop = fmodf(nodeTop, gPointScaleFactor); float roundedLeft = nodeLeft - fractialLeft; float roundedTop = nodeTop - fractialTop; // To do the actual rounding we check if leftover fraction is bigger or equal than half of the grid step if (fractialLeft >= gPointScaleFactor / 2.0) { roundedLeft += gPointScaleFactor; fractialLeft -= gPointScaleFactor; } if (fractialTop >= gPointScaleFactor / 2.0) { roundedTop += gPointScaleFactor; fractialTop -= gPointScaleFactor; } node->layout.position[YGEdgeLeft] = roundedLeft; node->layout.position[YGEdgeTop] = roundedTop; // Now we round width and height in the same way accounting for fractial leftovers from rounding position const float adjustedWidth = fractialLeft + node->layout.dimensions[YGDimensionWidth]; const float adjustedHeight = fractialTop + node->layout.dimensions[YGDimensionHeight]; float roundedWidth = adjustedWidth - fmodf(adjustedWidth, gPointScaleFactor); float roundedHeight = adjustedHeight - fmodf(adjustedHeight, gPointScaleFactor); if (adjustedWidth - roundedWidth >= gPointScaleFactor / 2.0) { roundedWidth += gPointScaleFactor; } if (adjustedHeight - roundedHeight >= gPointScaleFactor / 2.0) { roundedHeight += gPointScaleFactor; } node->layout.dimensions[YGDimensionWidth] = roundedWidth; node->layout.dimensions[YGDimensionHeight] = roundedHeight; </s> remove // We resolve main dimension to fit minimum and maximum values if (YGFloatIsUndefined(availableInnerMainDim)) { </s> add // If we don't measure with exact main dimension we want to ensure we don't violate min and max if (measureModeMainDim != YGMeasureModeExactly) { </s> remove static void roundToPixelGrid(const YGNodeRef node) { const float fractialLeft = node->layout.position[YGEdgeLeft] - floorf(node->layout.position[YGEdgeLeft]); const float fractialTop = node->layout.position[YGEdgeTop] - floorf(node->layout.position[YGEdgeTop]); node->layout.dimensions[YGDimensionWidth] = roundf(fractialLeft + node->layout.dimensions[YGDimensionWidth]) - roundf(fractialLeft); node->layout.dimensions[YGDimensionHeight] = roundf(fractialTop + node->layout.dimensions[YGDimensionHeight]) - roundf(fractialTop); </s> add static float gPointScaleFactor = 1.0; </s> remove if (isMainAxisRow) { childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth)); childHeightMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childHeight = fminf((childHeight - marginColumn), availableInnerHeight); childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; } childHeight += marginColumn; } else { childWidth = fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth)); childWidthMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childWidth = fminf((childWidth - marginRow), availableInnerWidth); childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; } childWidth += marginRow; </s> add childCrossSize = fmaxf( isMainAxisRow ? (childMainSize - marginMain) / currentRelativeChild->style.aspectRatio : (childMainSize - marginMain) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, crossAxis, availableInnerWidth)); childCrossMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childCrossSize = fminf(childCrossSize - marginCross, availableInnerCrossDim); childMainSize = marginMain + (isMainAxisRow ? childCrossSize * currentRelativeChild->style.aspectRatio : childCrossSize / currentRelativeChild->style.aspectRatio);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep keep
<mask> <mask> float availableInnerHeight = availableHeight - marginAxisColumn - paddingAndBorderAxisColumn; <mask> if (!YGFloatIsUndefined(availableInnerHeight)) { <mask> availableInnerHeight = fmaxf(fminf(availableInnerHeight, maxInnerHeight), minInnerHeight); <mask> } <mask> <mask> float availableInnerMainDim = isMainAxisRow ? availableInnerWidth : availableInnerHeight; <mask> const float availableInnerCrossDim = isMainAxisRow ? availableInnerHeight : availableInnerWidth; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add // We want to make sure our available width does not violate min and max constraints </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; </s> remove const bool isNodeFlexWrap = node->style.flexWrap == YGWrapWrap; </s> add const bool isNodeFlexWrap = node->style.flexWrap != YGWrapNoWrap; </s> remove if (!isCrossSizeDefinite) { childWidthMeasureMode = </s> add if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { float childMainSize = child->layout.measuredDimensions[dim[mainAxis]]; float childCrossSize = !YGFloatIsUndefined(child->style.aspectRatio) ? ((YGNodeMarginForAxis(child, crossAxis, availableInnerWidth) + (isMainAxisRow ? childMainSize / child->style.aspectRatio : childMainSize * child->style.aspectRatio))) : crossDim; childMainSize += YGNodeMarginForAxis(child, mainAxis, availableInnerWidth); YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly; YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[mainAxis]], availableInnerMainDim), &childMainMeasureMode, &childMainSize); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[crossAxis]], availableInnerCrossDim), &childCrossMeasureMode, &childCrossSize); const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode =
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> // If there is only one child with flexGrow + flexShrink it means we can set the <mask> // computedFlexBasis to 0 instead of measuring and shrinking / flexing the child to exactly <mask> // match the remaining space <mask> YGNodeRef singleFlexChild = NULL; <mask> if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || <mask> (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { <mask> for (uint32_t i = 0; i < childCount; i++) { <mask> const YGNodeRef child = YGNodeGetChild(node, i); <mask> if (singleFlexChild) { <mask> if (YGNodeIsFlex(child)) { <mask> // There is already a flexible child, abort. </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add // As we only wrapped in normal direction yet, we need to reverse the positions on wrap-reverse. if (performLayout && node->style.flexWrap == YGWrapWrapReverse) { for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeGetChild(node, i); if (child->style.positionType == YGPositionTypeRelative) { child->layout.position[pos[crossAxis]] = node->layout.measuredDimensions[dim[crossAxis]] - child->layout.position[pos[crossAxis]] - child->layout.measuredDimensions[dim[crossAxis]]; } } } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> // There is already a flexible child, abort. <mask> singleFlexChild = NULL; <mask> break; <mask> } <mask> } else if (YGNodeStyleGetFlexGrow(child) > 0.0f && YGNodeStyleGetFlexShrink(child) > 0.0f) { <mask> singleFlexChild = child; <mask> } <mask> } <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) { </s> remove crossDimLead = (remainingAlignContentDim / lineCount); </s> add crossDimLead = remainingAlignContentDim / lineCount; } break; case YGAlignSpaceAround: if (availableInnerCrossDim > totalLineCrossDim) { currentLead += remainingAlignContentDim / (2 * lineCount); if (lineCount > 1) { crossDimLead = remainingAlignContentDim / lineCount; } } else { currentLead += remainingAlignContentDim / 2; } break; case YGAlignSpaceBetween: if (availableInnerCrossDim > totalLineCrossDim && lineCount > 1) { crossDimLead = remainingAlignContentDim / (lineCount - 1); </s> remove } else if (!YGFloatIsUndefined(maxInnerMainDim) && sizeConsumedOnCurrentLine > maxInnerMainDim) { </s> add } else if (!YGFloatIsUndefined(maxInnerMainDim) && sizeConsumedOnCurrentLine > maxInnerMainDim) { </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; } </s> add } else if (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureMinFlexFix)) { // TODO: this needs to be moved out of experimental feature, as this is legitimate fix // If the measurement isn't exact, we want to use as little space as possible availableInnerMainDim = sizeConsumedOnCurrentLine; </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep
<mask> } <mask> } <mask> } <mask> <mask> // STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM <mask> for (uint32_t i = 0; i < childCount; i++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, i); <mask> if (child->style.display == YGDisplayNone) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child); </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> // STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM <mask> for (uint32_t i = 0; i < childCount; i++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, i); <mask> <mask> if (performLayout) { <mask> // Set the initial position (relative to the parent). <mask> const YGDirection childDirection = YGNodeResolveDirection(child, direction); <mask> YGNodeSetPosition(child, <mask> childDirection, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add float totalFlexBasis = 0; </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> availableInnerHeight, <mask> availableInnerWidth, <mask> availableInnerHeight, <mask> heightMeasureMode, <mask> direction); <mask> } <mask> } <mask> } <mask> <mask> // STEP 4: COLLECT FLEX ITEMS INTO FLEX LINES </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add totalFlexBasis += child->layout.computedFlexBasis; } const bool flexBasisOverflows = measureModeMainDim == YGMeasureModeUndefined ? false : totalFlexBasis > availableInnerMainDim; if (isNodeFlexWrap && flexBasisOverflows && measureModeMainDim == YGMeasureModeAtMost) { measureModeMainDim = YGMeasureModeExactly; </s> remove widthMeasureMode, </s> add isMainAxisRow ? measureModeMainDim : measureModeCrossDim, </s> remove direction); </s> add direction, config); </s> remove "flex"); </s> add "flex", config); </s> add float totalFlexBasis = 0; </s> remove "stretch"); </s> add "stretch", config);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep add keep keep keep keep keep keep
<mask> } <mask> } <mask> } <mask> <mask> // STEP 4: COLLECT FLEX ITEMS INTO FLEX LINES <mask> <mask> // Indexes of children that represent the first and last items in the line. <mask> uint32_t startOfLineIndex = 0; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove direction); </s> add direction, config); </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> add float totalFlexBasis = 0; </s> remove uint32_t startIndex = endIndex; </s> add const uint32_t startIndex = endIndex; </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child); </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep
<mask> // Add items to the current line until it's full or we run out of items. <mask> for (uint32_t i = startOfLineIndex; i < childCount; i++, endOfLineIndex++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, i); <mask> child->lineIndex = lineCount; <mask> <mask> if (child->style.positionType != YGPositionTypeAbsolute) { <mask> const float outerFlexBasis = </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> add float totalFlexBasis = 0; </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> sizeConsumedOnCurrentLine += outerFlexBasis; <mask> itemsOnLine++; <mask> <mask> if (YGNodeIsFlex(child)) { <mask> totalFlexGrowFactors += YGNodeStyleGetFlexGrow(child); <mask> <mask> // Unlike the grow factor, the shrink factor is scaled relative to the <mask> // child <mask> // dimension. <mask> totalFlexShrinkScaledFactors += </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis; </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension. </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing. </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { mainDim += remainingFreeSpace / numberOfAutoMarginsOnCurrentLine; } </s> remove } else { // YGAlignFlexEnd </s> add } else if (YGMarginTrailingValue(child, crossAxis)->unit == YGUnitAuto) { // No-Op } else if (YGMarginLeadingValue(child, crossAxis)->unit == YGUnitAuto) { leadingCrossDim += remainingCrossDim; } else if (alignItem == YGAlignFlexStart) { // No-Op } else if (alignItem == YGAlignCenter) { leadingCrossDim += remainingCrossDim / 2; } else { </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> // Unlike the grow factor, the shrink factor is scaled relative to the <mask> // child <mask> // dimension. <mask> totalFlexShrinkScaledFactors += <mask> -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; <mask> } <mask> <mask> // Store a private linked list of children that need to be layed out. <mask> if (firstRelativeChild == NULL) { <mask> firstRelativeChild = child; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove totalFlexGrowFactors += YGNodeStyleGetFlexGrow(child); </s> add totalFlexGrowFactors += YGResolveFlexGrow(child); </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing. </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension. </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace replace keep keep replace replace
<mask> // the line length, so there's no more space left to distribute. <mask> <mask> // We resolve main dimension to fit minimum and maximum values <mask> if (YGFloatIsUndefined(availableInnerMainDim)) { <mask> if (!YGFloatIsUndefined(minInnerMainDim) && sizeConsumedOnCurrentLine < minInnerMainDim) { <mask> availableInnerMainDim = minInnerMainDim; <mask> } else if (!YGFloatIsUndefined(maxInnerMainDim) && <mask> sizeConsumedOnCurrentLine > maxInnerMainDim) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add } else if (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureMinFlexFix)) { // TODO: this needs to be moved out of experimental feature, as this is legitimate fix // If the measurement isn't exact, we want to use as little space as possible availableInnerMainDim = sizeConsumedOnCurrentLine; </s> remove fmaxf(YGValueResolve(&child->style.dimensions[YGDimensionHeight], parentHeight), </s> add fmaxf(YGValueResolve(child->resolvedDimensions[YGDimensionHeight], parentHeight), </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) { </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove } else if (YGNodeStyleGetFlexGrow(child) > 0.0f && YGNodeStyleGetFlexShrink(child) > 0.0f) { </s> add } else if (YGResolveFlexGrow(child) > 0.0f && YGNodeResolveFlexShrink(child) > 0.0f) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep keep
<mask> availableInnerMainDim = minInnerMainDim; <mask> } else if (!YGFloatIsUndefined(maxInnerMainDim) && sizeConsumedOnCurrentLine > maxInnerMainDim) { <mask> availableInnerMainDim = maxInnerMainDim; <mask> } <mask> } <mask> <mask> float remainingFreeSpace = 0; <mask> if (!YGFloatIsUndefined(availableInnerMainDim)) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove } else if (!YGFloatIsUndefined(maxInnerMainDim) && sizeConsumedOnCurrentLine > maxInnerMainDim) { </s> add } else if (!YGFloatIsUndefined(maxInnerMainDim) && sizeConsumedOnCurrentLine > maxInnerMainDim) { </s> remove // We resolve main dimension to fit minimum and maximum values if (YGFloatIsUndefined(availableInnerMainDim)) { </s> add // If we don't measure with exact main dimension we want to ensure we don't violate min and max if (measureModeMainDim != YGMeasureModeExactly) { </s> remove } else if (YGNodeStyleGetFlexGrow(child) > 0.0f && YGNodeStyleGetFlexShrink(child) > 0.0f) { </s> add } else if (YGResolveFlexGrow(child) > 0.0f && YGNodeResolveFlexShrink(child) > 0.0f) { </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; } </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> // availableInnerMainDim is indefinite which means the node is being sized <mask> // based on its <mask> // content. <mask> // sizeConsumedOnCurrentLine is negative which means the node will <mask> // allocate 0 pixels for <mask> // its content. Consequently, remainingFreeSpace is 0 - <mask> // sizeConsumedOnCurrentLine. <mask> remainingFreeSpace = -sizeConsumedOnCurrentLine; <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) { </s> add } else if (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureMinFlexFix)) { // TODO: this needs to be moved out of experimental feature, as this is legitimate fix // If the measurement isn't exact, we want to use as little space as possible availableInnerMainDim = sizeConsumedOnCurrentLine; </s> remove // We resolve main dimension to fit minimum and maximum values if (YGFloatIsUndefined(availableInnerMainDim)) { </s> add // If we don't measure with exact main dimension we want to ensure we don't violate min and max if (measureModeMainDim != YGMeasureModeExactly) { </s> remove totalFlexGrowFactors += YGNodeStyleGetFlexGrow(child); </s> add totalFlexGrowFactors += YGResolveFlexGrow(child);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> while (currentRelativeChild != NULL) { <mask> childFlexBasis = currentRelativeChild->layout.computedFlexBasis; <mask> <mask> if (remainingFreeSpace < 0) { <mask> flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; <mask> <mask> // Is this child able to shrink? <mask> if (flexShrinkScaledFactor != 0) { <mask> baseMainSize = <mask> childFlexBasis + </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; </s> add flexShrinkScaledFactor = -YGNodeResolveFlexShrink(currentRelativeChild) * childFlexBasis; </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild); </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild); </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> deltaFlexShrinkScaledFactors -= flexShrinkScaledFactor; <mask> } <mask> } <mask> } else if (remainingFreeSpace > 0) { <mask> flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); <mask> <mask> // Is this child able to grow? <mask> if (flexGrowFactor != 0) { <mask> baseMainSize = <mask> childFlexBasis + remainingFreeSpace / totalFlexGrowFactors * flexGrowFactor; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild); </s> remove flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; </s> add flexShrinkScaledFactor = -YGNodeResolveFlexShrink(currentRelativeChild) * childFlexBasis; </s> remove flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; </s> add flexShrinkScaledFactor = -YGNodeResolveFlexShrink(currentRelativeChild) * childFlexBasis; </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; } </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> add } else if (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureMinFlexFix)) { // TODO: this needs to be moved out of experimental feature, as this is legitimate fix // If the measurement isn't exact, we want to use as little space as possible availableInnerMainDim = sizeConsumedOnCurrentLine;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> childFlexBasis = currentRelativeChild->layout.computedFlexBasis; <mask> float updatedMainSize = childFlexBasis; <mask> <mask> if (remainingFreeSpace < 0) { <mask> flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; <mask> // Is this child able to shrink? <mask> if (flexShrinkScaledFactor != 0) { <mask> float childSize; <mask> <mask> if (totalFlexShrinkScaledFactors == 0) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; </s> add flexShrinkScaledFactor = -YGNodeResolveFlexShrink(currentRelativeChild) * childFlexBasis; </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild); </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild); </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> availableInnerMainDim, <mask> availableInnerWidth); <mask> } <mask> } else if (remainingFreeSpace > 0) { <mask> flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); <mask> <mask> // Is this child able to grow? <mask> if (flexGrowFactor != 0) { <mask> updatedMainSize = <mask> YGNodeBoundAxis(currentRelativeChild, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild); </s> remove flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; </s> add flexShrinkScaledFactor = -YGNodeResolveFlexShrink(currentRelativeChild) * childFlexBasis; </s> remove flexShrinkScaledFactor = -YGNodeStyleGetFlexShrink(currentRelativeChild) * childFlexBasis; </s> add flexShrinkScaledFactor = -YGNodeResolveFlexShrink(currentRelativeChild) * childFlexBasis; </s> add } else if (YGConfigIsExperimentalFeatureEnabled(config, YGExperimentalFeatureMinFlexFix)) { // TODO: this needs to be moved out of experimental feature, as this is legitimate fix // If the measurement isn't exact, we want to use as little space as possible availableInnerMainDim = sizeConsumedOnCurrentLine; </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep
<mask> deltaFreeSpace -= updatedMainSize - childFlexBasis; <mask> <mask> float childWidth; <mask> float childHeight; <mask> YGMeasureMode childWidthMeasureMode; <mask> YGMeasureMode childHeightMeasureMode; <mask> <mask> const float marginRow = <mask> YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); <mask> const float marginColumn = <mask> YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); <mask> <mask> if (isMainAxisRow) { <mask> childWidth = updatedMainSize + marginRow; <mask> childWidthMeasureMode = YGMeasureModeExactly; <mask> <mask> if (!YGFloatIsUndefined(availableInnerCrossDim) && <mask> !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && <mask> heightMeasureMode == YGMeasureModeExactly && <mask> YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { <mask> childHeight = availableInnerCrossDim; <mask> childHeightMeasureMode = YGMeasureModeExactly; <mask> } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { <mask> childHeight = availableInnerCrossDim; <mask> childHeightMeasureMode = <mask> YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; <mask> } else { <mask> childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], <mask> availableInnerHeight) + <mask> marginColumn; <mask> childHeightMeasureMode = YGMeasureModeExactly; <mask> } <mask> } else { <mask> childHeight = updatedMainSize + marginColumn; <mask> childHeightMeasureMode = YGMeasureModeExactly; <mask> <mask> if (!YGFloatIsUndefined(availableInnerCrossDim) && <mask> !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && <mask> widthMeasureMode == YGMeasureModeExactly && <mask> YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { <mask> childWidth = availableInnerCrossDim; <mask> childWidthMeasureMode = YGMeasureModeExactly; <mask> } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { <mask> childWidth = availableInnerCrossDim; <mask> childWidthMeasureMode = <mask> YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; <mask> } else { <mask> childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], <mask> availableInnerWidth) + <mask> marginRow; <mask> childWidthMeasureMode = YGMeasureModeExactly; <mask> } <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth) + marginRow; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionWidth], parentWidth) + marginRow; </s> remove if (!isCrossSizeDefinite) { childWidthMeasureMode = </s> add if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { float childMainSize = child->layout.measuredDimensions[dim[mainAxis]]; float childCrossSize = !YGFloatIsUndefined(child->style.aspectRatio) ? ((YGNodeMarginForAxis(child, crossAxis, availableInnerWidth) + (isMainAxisRow ? childMainSize / child->style.aspectRatio : childMainSize * child->style.aspectRatio))) : crossDim; childMainSize += YGNodeMarginForAxis(child, mainAxis, availableInnerWidth); YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly; YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[mainAxis]], availableInnerMainDim), &childMainMeasureMode, &childMainSize); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[crossAxis]], availableInnerCrossDim), &childCrossMeasureMode, &childCrossSize); const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = </s> remove childHeightMeasureMode = </s> add const YGMeasureMode childHeightMeasureMode = </s> remove if (isMainAxisRow) { childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth)); childHeightMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childHeight = fminf((childHeight - marginColumn), availableInnerHeight); childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; } childHeight += marginColumn; } else { childWidth = fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth)); childWidthMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childWidth = fminf((childWidth - marginRow), availableInnerWidth); childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; } childWidth += marginRow; </s> add childCrossSize = fmaxf( isMainAxisRow ? (childMainSize - marginMain) / currentRelativeChild->style.aspectRatio : (childMainSize - marginMain) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, crossAxis, availableInnerWidth)); childCrossMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childCrossSize = fminf(childCrossSize - marginCross, availableInnerCrossDim); childMainSize = marginMain + (isMainAxisRow ? childCrossSize * currentRelativeChild->style.aspectRatio : childCrossSize / currentRelativeChild->style.aspectRatio);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> } <mask> <mask> if (!YGFloatIsUndefined(currentRelativeChild->style.aspectRatio)) { <mask> if (isMainAxisRow) { <mask> childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, <mask> YGNodePaddingAndBorderForAxis(currentRelativeChild, <mask> YGFlexDirectionColumn, <mask> availableInnerWidth)); <mask> childHeightMeasureMode = YGMeasureModeExactly; <mask> <mask> // Parent size constraint should have higher priority than flex <mask> if (YGNodeIsFlex(currentRelativeChild)) { <mask> childHeight = fminf((childHeight - marginColumn), availableInnerHeight); <mask> childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; <mask> } <mask> <mask> childHeight += marginColumn; <mask> } else { <mask> childWidth = <mask> fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, <mask> YGNodePaddingAndBorderForAxis(currentRelativeChild, <mask> YGFlexDirectionRow, <mask> availableInnerWidth)); <mask> childWidthMeasureMode = YGMeasureModeExactly; <mask> <mask> // Parent size constraint should have higher priority than flex <mask> if (YGNodeIsFlex(currentRelativeChild)) { <mask> childWidth = fminf((childWidth - marginRow), availableInnerWidth); <mask> childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; <mask> } <mask> <mask> childWidth += marginRow; <mask> } <mask> } <mask> <mask> YGConstrainMaxSizeForMode( <mask> YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionWidth], </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove childHeight = updatedMainSize + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && widthMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], availableInnerWidth) + marginRow; childWidthMeasureMode = YGMeasureModeExactly; } </s> add childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]], availableInnerCrossDim) + marginCross; const bool isLoosePercentageMeasurement = currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent && measureModeCrossDim != YGMeasureModeExactly; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth) + marginRow; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionWidth], parentWidth) + marginRow; </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) { </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, height)) { </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)) { childWidth = YGValueResolve(&child->style.dimensions[YGDimensionWidth], width) + marginRow; </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) { childWidth = YGValueResolve(child->resolvedDimensions[YGDimensionWidth], width) + marginRow;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep
<mask> marginMain + (isMainAxisRow <mask> ? childCrossSize * currentRelativeChild->style.aspectRatio <mask> : childCrossSize / currentRelativeChild->style.aspectRatio); <mask> } <mask> } <mask> <mask> YGConstrainMaxSizeForMode( <mask> YGValueResolve(&currentRelativeChild->style.maxDimensions[dim[mainAxis]], </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (isMainAxisRow) { childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth)); childHeightMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childHeight = fminf((childHeight - marginColumn), availableInnerHeight); childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; } childHeight += marginColumn; } else { childWidth = fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth)); childWidthMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childWidth = fminf((childWidth - marginRow), availableInnerWidth); childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; } childWidth += marginRow; </s> add childCrossSize = fmaxf( isMainAxisRow ? (childMainSize - marginMain) / currentRelativeChild->style.aspectRatio : (childMainSize - marginMain) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, crossAxis, availableInnerWidth)); childCrossMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childCrossSize = fminf(childCrossSize - marginCross, availableInnerCrossDim); childMainSize = marginMain + (isMainAxisRow ? childCrossSize * currentRelativeChild->style.aspectRatio : childCrossSize / currentRelativeChild->style.aspectRatio); </s> remove if (!isCrossSizeDefinite) { childWidthMeasureMode = </s> add if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { float childMainSize = child->layout.measuredDimensions[dim[mainAxis]]; float childCrossSize = !YGFloatIsUndefined(child->style.aspectRatio) ? ((YGNodeMarginForAxis(child, crossAxis, availableInnerWidth) + (isMainAxisRow ? childMainSize / child->style.aspectRatio : childMainSize * child->style.aspectRatio))) : crossDim; childMainSize += YGNodeMarginForAxis(child, mainAxis, availableInnerWidth); YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly; YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[mainAxis]], availableInnerMainDim), &childMainMeasureMode, &childMainSize); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[crossAxis]], availableInnerCrossDim), &childCrossMeasureMode, &childCrossSize); const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = </s> remove YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionWidth], </s> add YGValueResolve(&currentRelativeChild->style.maxDimensions[dim[mainAxis]], </s> remove childHeight = updatedMainSize + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && widthMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], availableInnerWidth) + marginRow; childWidthMeasureMode = YGMeasureModeExactly; } </s> add childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]], availableInnerCrossDim) + marginCross; const bool isLoosePercentageMeasurement = currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent && measureModeCrossDim != YGMeasureModeExactly; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep replace keep replace replace keep keep keep keep
<mask> } <mask> <mask> YGConstrainMaxSizeForMode( <mask> YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionWidth], <mask> availableInnerWidth), <mask> &childWidthMeasureMode, <mask> &childWidth); <mask> YGConstrainMaxSizeForMode( <mask> YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionHeight], <mask> availableInnerHeight), <mask> &childHeightMeasureMode, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionHeight], </s> add YGValueResolve(&currentRelativeChild->style.maxDimensions[dim[crossAxis]], </s> remove &childHeightMeasureMode, &childHeight); </s> add &childCrossMeasureMode, &childCrossSize); </s> add childCrossSize += marginCross; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove if (isMainAxisRow) { childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth)); childHeightMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childHeight = fminf((childHeight - marginColumn), availableInnerHeight); childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; } childHeight += marginColumn; } else { childWidth = fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth)); childWidthMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childWidth = fminf((childWidth - marginRow), availableInnerWidth); childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; } childWidth += marginRow; </s> add childCrossSize = fmaxf( isMainAxisRow ? (childMainSize - marginMain) / currentRelativeChild->style.aspectRatio : (childMainSize - marginMain) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, crossAxis, availableInnerWidth)); childCrossMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childCrossSize = fminf(childCrossSize - marginCross, availableInnerCrossDim); childMainSize = marginMain + (isMainAxisRow ? childCrossSize * currentRelativeChild->style.aspectRatio : childCrossSize / currentRelativeChild->style.aspectRatio);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep replace replace keep keep keep keep
<mask> availableInnerWidth), <mask> &childWidthMeasureMode, <mask> &childWidth); <mask> YGConstrainMaxSizeForMode( <mask> YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionHeight], <mask> availableInnerHeight), <mask> &childHeightMeasureMode, <mask> &childHeight); <mask> <mask> const bool requiresStretchLayout = <mask> !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis) && <mask> YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis) && </s> add !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && </s> remove &childWidthMeasureMode, &childWidth); </s> add &childMainMeasureMode, &childMainSize); </s> remove YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionWidth], </s> add YGValueResolve(&currentRelativeChild->style.maxDimensions[dim[mainAxis]], </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> &childHeightMeasureMode, <mask> &childHeight); <mask> <mask> const bool requiresStretchLayout = <mask> !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis) && <mask> YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch; <mask> <mask> // Recursively call the layout algorithm for this child with the updated <mask> // main size. <mask> YGLayoutNodeInternal(currentRelativeChild, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; </s> remove &childHeightMeasureMode, &childHeight); </s> add &childCrossMeasureMode, &childCrossSize); </s> remove YGValueResolve(&currentRelativeChild->style.maxDimensions[YGDimensionHeight], </s> add YGValueResolve(&currentRelativeChild->style.maxDimensions[dim[crossAxis]], </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep add keep keep keep keep
<mask> YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch; <mask> <mask> // Recursively call the layout algorithm for this child with the updated <mask> // main size. <mask> YGLayoutNodeInternal(currentRelativeChild, <mask> childWidth, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis) && </s> add !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove &childHeightMeasureMode, &childHeight); </s> add &childCrossMeasureMode, &childCrossSize); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) { </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> childHeightMeasureMode, <mask> availableInnerWidth, <mask> availableInnerHeight, <mask> performLayout && !requiresStretchLayout, <mask> "flex"); <mask> <mask> currentRelativeChild = currentRelativeChild->nextChild; <mask> } <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove "stretch"); </s> add "stretch", config); </s> remove direction); </s> add direction, config); </s> remove widthMeasureMode, </s> add isMainAxisRow ? measureModeMainDim : measureModeCrossDim, </s> remove direction); </s> add direction, config); </s> remove "abs-measure"); </s> add "abs-measure", config); </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep replace replace replace replace replace replace replace replace replace replace replace replace keep replace replace replace replace replace replace replace replace
<mask> <mask> switch (justifyContent) { <mask> case YGJustifyCenter: <mask> leadingMainDim = remainingFreeSpace / 2; <mask> break; <mask> case YGJustifyFlexEnd: <mask> leadingMainDim = remainingFreeSpace; <mask> break; <mask> case YGJustifySpaceBetween: <mask> if (itemsOnLine > 1) { <mask> betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); <mask> } else { <mask> betweenMainDim = 0; <mask> } <mask> break; <mask> case YGJustifySpaceAround: <mask> // Space on the edges is half of the space between elements <mask> betweenMainDim = remainingFreeSpace / itemsOnLine; <mask> leadingMainDim = betweenMainDim / 2; <mask> break; <mask> case YGJustifyFlexStart: <mask> break; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove crossDimLead = (remainingAlignContentDim / lineCount); </s> add crossDimLead = remainingAlignContentDim / lineCount; } break; case YGAlignSpaceAround: if (availableInnerCrossDim > totalLineCrossDim) { currentLead += remainingAlignContentDim / (2 * lineCount); if (lineCount > 1) { crossDimLead = remainingAlignContentDim / lineCount; } } else { currentLead += remainingAlignContentDim / 2; } break; case YGAlignSpaceBetween: if (availableInnerCrossDim > totalLineCrossDim && lineCount > 1) { crossDimLead = remainingAlignContentDim / (lineCount - 1); </s> add case YGAlignSpaceBetween: case YGAlignSpaceAround: </s> remove flexGrowFactor = YGNodeStyleGetFlexGrow(currentRelativeChild); </s> add flexGrowFactor = YGResolveFlexGrow(currentRelativeChild); </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } } </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing.
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> float crossDim = 0; <mask> <mask> for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, i); <mask> <mask> if (child->style.positionType == YGPositionTypeAbsolute && <mask> YGNodeIsLeadingPosDefined(child, mainAxis)) { <mask> if (performLayout) { <mask> // In case the child is position absolute and has left/top being <mask> // defined, we override the position to whatever the user said </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child); </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) { </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep add keep keep keep keep keep keep
<mask> // do not take part in that phase. <mask> if (child->style.positionType == YGPositionTypeRelative) { <mask> if (performLayout) { <mask> child->layout.position[pos[mainAxis]] += mainDim; <mask> } <mask> <mask> if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { <mask> mainDim += remainingFreeSpace / numberOfAutoMarginsOnCurrentLine; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { mainDim += remainingFreeSpace / numberOfAutoMarginsOnCurrentLine; } </s> remove } else { // YGAlignFlexEnd </s> add } else if (YGMarginTrailingValue(child, crossAxis)->unit == YGUnitAuto) { // No-Op } else if (YGMarginLeadingValue(child, crossAxis)->unit == YGUnitAuto) { leadingCrossDim += remainingCrossDim; } else if (alignItem == YGAlignFlexStart) { // No-Op } else if (alignItem == YGAlignCenter) { leadingCrossDim += remainingCrossDim / 2; } else { </s> remove if (alignItem == YGAlignCenter) { </s> add if (YGMarginLeadingValue(child, crossAxis)->unit == YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit == YGUnitAuto) { </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension. </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep keep keep
<mask> if (performLayout) { <mask> child->layout.position[pos[mainAxis]] += mainDim; <mask> } <mask> <mask> if (canSkipFlex) { <mask> // If we skipped the flex step, then we can't rely on the <mask> // measuredDims because <mask> // they weren't computed. This means we can't call YGNodeDimWithMargin. <mask> mainDim += betweenMainDim + YGNodeMarginForAxis(child, mainAxis, availableInnerWidth) + <mask> child->layout.computedFlexBasis; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing. </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension. </s> add if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { mainDim += remainingFreeSpace / numberOfAutoMarginsOnCurrentLine; } </s> add // TODO: findClassStatic only does the lookup once. If we can't find // QuickPerformanceLoggerProvider the first time we call this, we will always fail here. </s> remove mDrawCommands[commandIndex++].draw(mFlatViewGroup, canvas); </s> add DrawCommand command = mDrawCommands[commandIndex++]; if (command instanceof DrawView) { // We should never have more DrawView commands at this point. But in case we do, fail safely // by ignoring the DrawView command FLog.w( TAG, "Unexpected DrawView command at index " + (commandIndex-1) + " with mStop=" + mStop + ". " + Arrays.toString(mDrawCommands)); continue; } command.draw(mFlatViewGroup, canvas); </s> remove if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)) { childWidth = YGValueResolve(&child->style.dimensions[YGDimensionWidth], width) + marginRow; </s> add if (YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, width)) { childWidth = YGValueResolve(child->resolvedDimensions[YGDimensionWidth], width) + marginRow;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep replace replace keep keep
<mask> mainDim += betweenMainDim + YGNodeMarginForAxis(child, mainAxis, availableInnerWidth) + <mask> child->layout.computedFlexBasis; <mask> crossDim = availableInnerCrossDim; <mask> } else { <mask> // The main dimension is the sum of all the elements dimension plus <mask> // the spacing. <mask> mainDim += betweenMainDim + YGNodeDimWithMargin(child, mainAxis, availableInnerWidth); <mask> <mask> // The cross dimension is the max of the elements dimension since <mask> // there <mask> // can only be one element in that cross dimension. <mask> crossDim = fmaxf(crossDim, YGNodeDimWithMargin(child, crossAxis, availableInnerWidth)); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { mainDim += remainingFreeSpace / numberOfAutoMarginsOnCurrentLine; } </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; } </s> remove // We resolve main dimension to fit minimum and maximum values if (YGFloatIsUndefined(availableInnerMainDim)) { </s> add // If we don't measure with exact main dimension we want to ensure we don't violate min and max if (measureModeMainDim != YGMeasureModeExactly) { </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis; </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> // We can skip child alignment if we're just measuring the container. <mask> if (performLayout) { <mask> for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, i); <mask> <mask> if (child->style.positionType == YGPositionTypeAbsolute) { <mask> // If the child is absolutely positioned and has a <mask> // top/left/bottom/right <mask> // set, override all the previously computed positions to set it <mask> // correctly. </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) { </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child); </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add float totalFlexBasis = 0;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep replace replace keep keep keep keep
<mask> // current line. <mask> if (alignItem == YGAlignStretch) { <mask> const bool isCrossSizeDefinite = <mask> (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || <mask> (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); <mask> <mask> float childWidth; <mask> float childHeight; <mask> YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; <mask> YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; <mask> <mask> const float marginRow = <mask> YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); <mask> const float marginColumn = <mask> YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); <mask> <mask> if (isMainAxisRow) { <mask> childWidth = child->layout.measuredDimensions[YGDimensionWidth]; <mask> <mask> if (!YGFloatIsUndefined(child->style.aspectRatio)) { <mask> childHeight = marginColumn + childWidth / child->style.aspectRatio; <mask> } else { <mask> childHeight = crossDim; <mask> } <mask> <mask> childWidth += marginRow; <mask> } else { <mask> childHeight = child->layout.measuredDimensions[YGDimensionHeight]; <mask> <mask> if (!YGFloatIsUndefined(child->style.aspectRatio)) { <mask> childWidth = marginRow + childHeight * child->style.aspectRatio; <mask> } else { <mask> childWidth = crossDim; <mask> } <mask> <mask> childHeight += marginColumn; <mask> } <mask> <mask> YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], <mask> availableInnerWidth), <mask> &childWidthMeasureMode, <mask> &childWidth); <mask> YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], <mask> availableInnerHeight), <mask> &childHeightMeasureMode, <mask> &childHeight); <mask> <mask> // If the child defines a definite size for its cross axis, there's <mask> // no need to stretch. <mask> if (!isCrossSizeDefinite) { <mask> childWidthMeasureMode = <mask> YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeExactly; <mask> childHeightMeasureMode = <mask> YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeExactly; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove childHeight = updatedMainSize + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && widthMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], availableInnerWidth) + marginRow; childWidthMeasureMode = YGMeasureModeExactly; } </s> add childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]], availableInnerCrossDim) + marginCross; const bool isLoosePercentageMeasurement = currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent && measureModeCrossDim != YGMeasureModeExactly; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove if (isMainAxisRow) { childHeight = fmaxf((childWidth - marginRow) / currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth)); childHeightMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childHeight = fminf((childHeight - marginColumn), availableInnerHeight); childWidth = marginRow + childHeight * currentRelativeChild->style.aspectRatio; } childHeight += marginColumn; } else { childWidth = fmaxf((childHeight - marginColumn) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth)); childWidthMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childWidth = fminf((childWidth - marginRow), availableInnerWidth); childHeight = marginColumn + childWidth / currentRelativeChild->style.aspectRatio; } childWidth += marginRow; </s> add childCrossSize = fmaxf( isMainAxisRow ? (childMainSize - marginMain) / currentRelativeChild->style.aspectRatio : (childMainSize - marginMain) * currentRelativeChild->style.aspectRatio, YGNodePaddingAndBorderForAxis(currentRelativeChild, crossAxis, availableInnerWidth)); childCrossMeasureMode = YGMeasureModeExactly; // Parent size constraint should have higher priority than flex if (YGNodeIsFlex(currentRelativeChild)) { childCrossSize = fminf(childCrossSize - marginCross, availableInnerCrossDim); childMainSize = marginMain + (isMainAxisRow ? childCrossSize * currentRelativeChild->style.aspectRatio : childCrossSize / currentRelativeChild->style.aspectRatio); </s> remove YGValueResolve(&child->style.dimensions[YGDimensionWidth], parentWidth) + marginRow; </s> add YGValueResolve(child->resolvedDimensions[YGDimensionWidth], parentWidth) + marginRow; </s> remove childHeightMeasureMode = </s> add const YGMeasureMode childHeightMeasureMode =
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> // no need to stretch. <mask> if (!isCrossSizeDefinite) { <mask> childWidthMeasureMode = <mask> YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeExactly; <mask> childHeightMeasureMode = <mask> YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeExactly; <mask> <mask> YGLayoutNodeInternal(child, <mask> childWidth, <mask> childHeight, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (!isCrossSizeDefinite) { childWidthMeasureMode = </s> add if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { float childMainSize = child->layout.measuredDimensions[dim[mainAxis]]; float childCrossSize = !YGFloatIsUndefined(child->style.aspectRatio) ? ((YGNodeMarginForAxis(child, crossAxis, availableInnerWidth) + (isMainAxisRow ? childMainSize / child->style.aspectRatio : childMainSize * child->style.aspectRatio))) : crossDim; childMainSize += YGNodeMarginForAxis(child, mainAxis, availableInnerWidth); YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; YGMeasureMode childCrossMeasureMode = YGMeasureModeExactly; YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[mainAxis]], availableInnerMainDim), &childMainMeasureMode, &childMainSize); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[dim[crossAxis]], availableInnerCrossDim), &childCrossMeasureMode, &childCrossSize); const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = </s> remove childHeight = updatedMainSize + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow) && widthMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionRow)) { childWidth = availableInnerCrossDim; childWidthMeasureMode = YGFloatIsUndefined(childWidth) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childWidth = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionWidth], availableInnerWidth) + marginRow; childWidthMeasureMode = YGMeasureModeExactly; } </s> add childCrossSize = YGValueResolve(currentRelativeChild->resolvedDimensions[dim[crossAxis]], availableInnerCrossDim) + marginCross; const bool isLoosePercentageMeasurement = currentRelativeChild->resolvedDimensions[dim[crossAxis]]->unit == YGUnitPercent && measureModeCrossDim != YGMeasureModeExactly; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) || isLoosePercentageMeasurement ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> add } else { height = parentHeight; heightMeasureMode = YGFloatIsUndefined(height) ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> add const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; const YGMeasureMode childHeightMeasureMode = !isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep replace keep replace keep keep keep keep
<mask> true, <mask> "stretch"); <mask> } <mask> } else if (alignItem != YGAlignFlexStart) { <mask> const float remainingCrossDim = <mask> containerCrossAxis - YGNodeDimWithMargin(child, crossAxis, availableInnerWidth); <mask> <mask> if (alignItem == YGAlignCenter) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (alignItem == YGAlignCenter) { </s> add if (YGMarginLeadingValue(child, crossAxis)->unit == YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit == YGUnitAuto) { </s> remove } else { // YGAlignFlexEnd </s> add } else if (YGMarginTrailingValue(child, crossAxis)->unit == YGUnitAuto) { // No-Op } else if (YGMarginLeadingValue(child, crossAxis)->unit == YGUnitAuto) { leadingCrossDim += remainingCrossDim; } else if (alignItem == YGAlignFlexStart) { // No-Op } else if (alignItem == YGAlignCenter) { leadingCrossDim += remainingCrossDim / 2; } else { </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost; </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep replace keep keep keep
<mask> } else if (alignItem != YGAlignFlexStart) { <mask> const float remainingCrossDim = <mask> containerCrossAxis - YGNodeDimWithMargin(child, crossAxis, availableInnerWidth); <mask> <mask> if (alignItem == YGAlignCenter) { <mask> leadingCrossDim += remainingCrossDim / 2; <mask> } else { // YGAlignFlexEnd <mask> leadingCrossDim += remainingCrossDim; <mask> } <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove } else if (alignItem != YGAlignFlexStart) { </s> add } else { </s> remove "stretch"); </s> add "stretch", config); </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) { </s> remove crossDimLead = (remainingAlignContentDim / lineCount); </s> add crossDimLead = remainingAlignContentDim / lineCount; } break; case YGAlignSpaceAround: if (availableInnerCrossDim > totalLineCrossDim) { currentLead += remainingAlignContentDim / (2 * lineCount); if (lineCount > 1) { crossDimLead = remainingAlignContentDim / lineCount; } } else { currentLead += remainingAlignContentDim / 2; } break; case YGAlignSpaceBetween: if (availableInnerCrossDim > totalLineCrossDim && lineCount > 1) { crossDimLead = remainingAlignContentDim / (lineCount - 1); </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension.
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> currentLead += remainingAlignContentDim / 2; <mask> break; <mask> case YGAlignStretch: <mask> if (availableInnerCrossDim > totalLineCrossDim) { <mask> crossDimLead = (remainingAlignContentDim / lineCount); <mask> } <mask> break; <mask> case YGAlignAuto: <mask> case YGAlignFlexStart: <mask> case YGAlignBaseline: </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; } </s> add case YGAlignSpaceBetween: case YGAlignSpaceAround: </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove if (littleEndianToHost(header.BCMagic) == BCBundleMagicNumber) { </s> add switch (littleEndianToHost(header.magic)) { case RAMBundleMagicNumber: return ScriptTag::RAMBundle; case BCBundleMagicNumber:
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> uint32_t endIndex = 0; <mask> for (uint32_t i = 0; i < lineCount; i++) { <mask> uint32_t startIndex = endIndex; <mask> uint32_t ii; <mask> <mask> // compute the line's height and find the endIndex <mask> float lineHeight = 0; <mask> float maxAscentForCurrentLine = 0; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove roundToPixelGrid(YGNodeGetChild(node, i)); </s> add YGRoundToPixelGrid(YGNodeGetChild(node, i)); </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add float totalFlexBasis = 0; </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> float maxAscentForCurrentLine = 0; <mask> float maxDescentForCurrentLine = 0; <mask> for (ii = startIndex; ii < childCount; ii++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, ii); <mask> <mask> if (child->style.positionType == YGPositionTypeRelative) { <mask> if (child->lineIndex != i) { <mask> break; <mask> } <mask> if (YGNodeIsLayoutDimDefined(child, crossAxis)) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add float totalFlexBasis = 0; </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> if (performLayout) { <mask> for (ii = startIndex; ii < endIndex; ii++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, ii); <mask> <mask> if (child->style.positionType == YGPositionTypeRelative) { <mask> switch (YGNodeAlignItem(node, child)) { <mask> case YGAlignFlexStart: { <mask> child->layout.position[pos[crossAxis]] = <mask> currentLead + YGNodeLeadingMargin(child, crossAxis, availableInnerWidth); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> add // As we only wrapped in normal direction yet, we need to reverse the positions on wrap-reverse. if (performLayout && node->style.flexWrap == YGWrapWrapReverse) { for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeGetChild(node, i); if (child->style.positionType == YGPositionTypeRelative) { child->layout.position[pos[crossAxis]] = node->layout.measuredDimensions[dim[crossAxis]] - child->layout.position[pos[crossAxis]] - child->layout.measuredDimensions[dim[crossAxis]]; } } } </s> remove // TODO(prenaux): Correctly set the height of items with indefinite // (auto) crossAxis dimension. </s> add // Remeasure child with the line height as it as been only measured with the // parents height yet. if (!YGNodeIsStyleDimDefined(child, crossAxis, availableInnerCrossDim)) { const float childWidth = isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionWidth] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; const float childHeight = !isMainAxisRow ? (child->layout.measuredDimensions[YGDimensionHeight] + YGNodeMarginForAxis(child, crossAxis, availableInnerWidth)) : lineHeight; if (!(YGFloatsEqual(childWidth, child->layout.measuredDimensions[YGDimensionWidth]) && YGFloatsEqual(childHeight, child->layout.measuredDimensions[YGDimensionHeight]))) { YGLayoutNodeInternal(child, childWidth, childHeight, direction, YGMeasureModeExactly, YGMeasureModeExactly, availableInnerWidth, availableInnerHeight, true, "stretch", config); } } </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> } <mask> case YGAlignStretch: { <mask> child->layout.position[pos[crossAxis]] = <mask> currentLead + YGNodeLeadingMargin(child, crossAxis, availableInnerWidth); <mask> // TODO(prenaux): Correctly set the height of items with indefinite <mask> // (auto) crossAxis dimension. <mask> break; <mask> } <mask> case YGAlignBaseline: { <mask> child->layout.position[YGEdgeTop] = <mask> currentLead + maxAscentForCurrentLine - YGBaseline(child) + </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove crossDimLead = (remainingAlignContentDim / lineCount); </s> add crossDimLead = remainingAlignContentDim / lineCount; } break; case YGAlignSpaceAround: if (availableInnerCrossDim > totalLineCrossDim) { currentLead += remainingAlignContentDim / (2 * lineCount); if (lineCount > 1) { crossDimLead = remainingAlignContentDim / lineCount; } } else { currentLead += remainingAlignContentDim / 2; } break; case YGAlignSpaceBetween: if (availableInnerCrossDim > totalLineCrossDim && lineCount > 1) { crossDimLead = remainingAlignContentDim / (lineCount - 1); </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; } </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension. </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing. </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep
<mask> YGNodeLeadingPosition(child, YGFlexDirectionColumn, availableInnerCrossDim); <mask> break; <mask> } <mask> case YGAlignAuto: <mask> break; <mask> } <mask> } <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove crossDimLead = (remainingAlignContentDim / lineCount); </s> add crossDimLead = remainingAlignContentDim / lineCount; } break; case YGAlignSpaceAround: if (availableInnerCrossDim > totalLineCrossDim) { currentLead += remainingAlignContentDim / (2 * lineCount); if (lineCount > 1) { crossDimLead = remainingAlignContentDim / lineCount; } } else { currentLead += remainingAlignContentDim / 2; } break; case YGAlignSpaceBetween: if (availableInnerCrossDim > totalLineCrossDim && lineCount > 1) { crossDimLead = remainingAlignContentDim / (lineCount - 1); </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; } </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> remove listener.onHostResume(); </s> add try { listener.onHostResume(); } catch (RuntimeException e) { handleException(e); } </s> remove #endif </s> add #elif defined(__APPLE__) BundleHeader header; memcpy(&header, script->c_str(), std::min(script->size(), sizeof(BundleHeader))); auto scriptTag = parseTypeFromHeader(header); </s> remove } else if (YGNodeStyleGetFlexGrow(child) > 0.0f && YGNodeStyleGetFlexShrink(child) > 0.0f) { </s> add } else if (YGResolveFlexGrow(child) > 0.0f && YGNodeResolveFlexShrink(child) > 0.0f) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep keep keep
<mask> paddingAndBorderAxisCross); <mask> } <mask> <mask> if (performLayout) { <mask> // STEP 10: SIZING AND POSITIONING ABSOLUTE CHILDREN <mask> for (currentAbsoluteChild = firstAbsoluteChild; currentAbsoluteChild != NULL; <mask> currentAbsoluteChild = currentAbsoluteChild->nextChild) { <mask> YGNodeAbsoluteLayoutChild(node, <mask> currentAbsoluteChild, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove widthMeasureMode, </s> add isMainAxisRow ? measureModeMainDim : measureModeCrossDim, </s> remove direction); </s> add direction, config); </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child); </s> add float totalFlexBasis = 0; </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep replace keep replace keep
<mask> availableInnerWidth, <mask> widthMeasureMode, <mask> availableInnerHeight, <mask> direction); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove direction); </s> add direction, config); </s> remove "flex"); </s> add "flex", config); </s> remove "stretch"); </s> add "stretch", config); </s> remove YGNodeWithMeasureFuncSetMeasuredDimensions( node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode); </s> add YGNodeWithMeasureFuncSetMeasuredDimensions(node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode, parentWidth, parentHeight); </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> // Set trailing position if necessary. <mask> if (needsMainTrailingPos || needsCrossTrailingPos) { <mask> for (uint32_t i = 0; i < childCount; i++) { <mask> const YGNodeRef child = YGNodeListGet(node->children, i); <mask> <mask> if (needsMainTrailingPos) { <mask> YGNodeSetChildTrailingPosition(node, child, mainAxis); <mask> } <mask> <mask> if (needsCrossTrailingPos) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> add float totalFlexBasis = 0; </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child); </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove if ((isMainAxisRow && widthMeasureMode == YGMeasureModeExactly) || (!isMainAxisRow && heightMeasureMode == YGMeasureModeExactly)) { </s> add if (measureModeMainDim == YGMeasureModeExactly) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> const YGMeasureMode heightMeasureMode, <mask> const float parentWidth, <mask> const float parentHeight, <mask> const bool performLayout, <mask> const char *reason) { <mask> YGLayout *layout = &node->layout; <mask> <mask> gDepth++; <mask> <mask> const bool needToVisitNode = </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const char *reason); </s> add const char *reason, const YGConfigRef config); </s> remove const bool performLayout) { </s> add const bool performLayout, const YGConfigRef config) { </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) { </s> remove const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn); </s> add const float resolvedFlexBasis = YGValueResolve(YGNodeResolveFlexBasisPtr(child), mainAxisParentSize); const bool isRowStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionRow, parentWidth); const bool isColumnStyleDimDefined = YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn, parentHeight); </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> widthMeasureMode, <mask> heightMeasureMode, <mask> parentWidth, <mask> parentHeight, <mask> performLayout); <mask> <mask> if (gPrintChanges) { <mask> printf("%s%d.}%s", YGSpacer(gDepth), gDepth, needToVisitNode ? "*" : ""); <mask> if (node->print) { <mask> node->print(node); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove const bool performLayout) { </s> add const bool performLayout, const YGConfigRef config) { </s> remove availableWidth, availableHeight, </s> add parentWidth, parentHeight, </s> remove YGNodeWithMeasureFuncSetMeasuredDimensions( node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode); </s> add YGNodeWithMeasureFuncSetMeasuredDimensions(node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode, parentWidth, parentHeight); </s> remove const char *reason) { </s> add const char *reason, const YGConfigRef config) { </s> remove "initia" "l")) { YGNodeSetPosition(node, node->layout.direction, availableWidth, availableHeight, availableWidth); </s> add "initial", node->config)) { YGNodeSetPosition(node, node->layout.direction, parentWidth, parentHeight, parentWidth); </s> remove "measure"); </s> add "measure", config);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep replace replace replace replace replace replace replace replace replace keep replace replace keep
<mask> return (needToVisitNode || cachedResults == NULL); <mask> } <mask> <mask> static void roundToPixelGrid(const YGNodeRef node) { <mask> const float fractialLeft = <mask> node->layout.position[YGEdgeLeft] - floorf(node->layout.position[YGEdgeLeft]); <mask> const float fractialTop = <mask> node->layout.position[YGEdgeTop] - floorf(node->layout.position[YGEdgeTop]); <mask> node->layout.dimensions[YGDimensionWidth] = <mask> roundf(fractialLeft + node->layout.dimensions[YGDimensionWidth]) - roundf(fractialLeft); <mask> node->layout.dimensions[YGDimensionHeight] = <mask> roundf(fractialTop + node->layout.dimensions[YGDimensionHeight]) - roundf(fractialTop); <mask> <mask> node->layout.position[YGEdgeLeft] = roundf(node->layout.position[YGEdgeLeft]); <mask> node->layout.position[YGEdgeTop] = roundf(node->layout.position[YGEdgeTop]); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove roundToPixelGrid(YGNodeGetChild(node, i)); </s> add YGRoundToPixelGrid(YGNodeGetChild(node, i)); </s> add static inline void YGResolveDimensions(YGNodeRef node) { for (YGDimension dim = YGDimensionWidth; dim <= YGDimensionHeight; dim++) { if (node->style.maxDimensions[dim].unit != YGUnitUndefined && YGValueEqual(node->style.maxDimensions[dim], node->style.minDimensions[dim])) { node->resolvedDimensions[dim] = &node->style.maxDimensions[dim]; } else { node->resolvedDimensions[dim] = &node->style.dimensions[dim]; } } } </s> add // We want to make sure our available height does not violate min and max constraints </s> remove float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; const float marginRow = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(currentRelativeChild, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = updatedMainSize + marginRow; childWidthMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn) && heightMeasureMode == YGMeasureModeExactly && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, YGFlexDirectionColumn)) { childHeight = availableInnerCrossDim; childHeightMeasureMode = YGFloatIsUndefined(childHeight) ? YGMeasureModeUndefined : YGMeasureModeAtMost; } else { childHeight = YGValueResolve(&currentRelativeChild->style.dimensions[YGDimensionHeight], availableInnerHeight) + marginColumn; childHeightMeasureMode = YGMeasureModeExactly; } </s> add const float marginMain = YGNodeMarginForAxis(currentRelativeChild, mainAxis, availableInnerWidth); const float marginCross = YGNodeMarginForAxis(currentRelativeChild, crossAxis, availableInnerWidth); float childCrossSize; float childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; if (!YGFloatIsUndefined(availableInnerCrossDim) && !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && measureModeCrossDim == YGMeasureModeExactly && !(isNodeFlexWrap && flexBasisOverflows) && YGNodeAlignItem(node, currentRelativeChild) == YGAlignStretch) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGMeasureModeExactly; } else if (!YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim)) { childCrossSize = availableInnerCrossDim; childCrossMeasureMode = YGFloatIsUndefined(childCrossSize) ? YGMeasureModeUndefined : YGMeasureModeAtMost;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace keep keep keep keep replace replace keep keep keep keep
<mask> const uint32_t childCount = YGNodeListCount(node->children); <mask> for (uint32_t i = 0; i < childCount; i++) { <mask> roundToPixelGrid(YGNodeGetChild(node, i)); <mask> } <mask> } <mask> <mask> void YGNodeCalculateLayout(const YGNodeRef node, <mask> const float availableWidth, <mask> const float availableHeight, <mask> const YGDirection parentDirection) { <mask> // Increment the generation count. This will force the recursive routine to <mask> // visit <mask> // all dirty nodes at least once. Subsequent visits will be skipped if the </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove uint32_t startIndex = endIndex; </s> add const uint32_t startIndex = endIndex; </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove </s> add if (child->style.display == YGDisplayNone) { YGZeroOutLayoutRecursivly(child); child->hasNewLayout = true; child->isDirty = false; continue; } YGResolveDimensions(child);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace replace replace replace keep replace replace replace replace replace keep keep keep keep
<mask> gCurrentGenerationCount++; <mask> <mask> float width = availableWidth; <mask> float height = availableHeight; <mask> YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; <mask> YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; <mask> <mask> if (!YGFloatIsUndefined(width)) { <mask> widthMeasureMode = YGMeasureModeExactly; <mask> } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { <mask> width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + <mask> YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); <mask> widthMeasureMode = YGMeasureModeExactly; <mask> } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { <mask> width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); <mask> widthMeasureMode = YGMeasureModeAtMost; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); </s> add } else { width = parentWidth; widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove if (!YGFloatIsUndefined(height)) { heightMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn)) { height = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionColumn]], availableHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); </s> add float height = YGUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) { height = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionColumn]], parentHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth); </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight) >= </s> remove height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight); </s> add height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { <mask> width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + <mask> YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); <mask> widthMeasureMode = YGMeasureModeExactly; <mask> } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { <mask> width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); <mask> widthMeasureMode = YGMeasureModeAtMost; <mask> } <mask> <mask> if (!YGFloatIsUndefined(height)) { <mask> heightMeasureMode = YGMeasureModeExactly; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (!YGFloatIsUndefined(width)) { widthMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); </s> add float width = YGUndefined; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, parentWidth)) { width = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionRow]], parentWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth); </s> remove if (!YGFloatIsUndefined(height)) { heightMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn)) { height = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionColumn]], availableHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); </s> add float height = YGUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) { height = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionColumn]], parentHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth); </s> add } else { width = parentWidth; widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove float width = availableWidth; float height = availableHeight; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; </s> add YGResolveDimensions(node); </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight) >= </s> remove height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight); </s> add height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep keep keep
<mask> widthMeasureMode = YGMeasureModeExactly; <mask> } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { <mask> width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); <mask> widthMeasureMode = YGMeasureModeAtMost; <mask> } <mask> <mask> float height = YGUndefined; <mask> YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; <mask> if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) { <mask> height = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionColumn]], parentHeight) + </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (!YGFloatIsUndefined(height)) { heightMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn)) { height = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionColumn]], availableHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); </s> add float height = YGUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) { height = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionColumn]], parentHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth); </s> remove if (!YGFloatIsUndefined(width)) { widthMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); </s> add float width = YGUndefined; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, parentWidth)) { width = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionRow]], parentWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth); </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); </s> remove float width = availableWidth; float height = availableHeight; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; </s> add YGResolveDimensions(node); </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight) >= </s> add } else { height = parentHeight; heightMeasureMode = YGFloatIsUndefined(height) ? YGMeasureModeUndefined : YGMeasureModeExactly;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep replace replace replace replace replace keep replace keep keep
<mask> } <mask> <mask> if (!YGFloatIsUndefined(height)) { <mask> heightMeasureMode = YGMeasureModeExactly; <mask> } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn)) { <mask> height = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionColumn]], availableHeight) + <mask> YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); <mask> heightMeasureMode = YGMeasureModeExactly; <mask> } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= <mask> 0.0f) { <mask> height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight); </s> add height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight); </s> add } else { height = parentHeight; heightMeasureMode = YGFloatIsUndefined(height) ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); </s> add } else { width = parentWidth; widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove if (!YGFloatIsUndefined(width)) { widthMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); </s> add float width = YGUndefined; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, parentWidth)) { width = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionRow]], parentWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace keep keep keep keep keep
<mask> YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); <mask> heightMeasureMode = YGMeasureModeExactly; <mask> } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= <mask> 0.0f) { <mask> height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight); <mask> heightMeasureMode = YGMeasureModeAtMost; <mask> } <mask> <mask> if (YGLayoutNodeInternal(node, <mask> width, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight) >= </s> remove if (!YGFloatIsUndefined(height)) { heightMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn)) { height = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionColumn]], availableHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); </s> add float height = YGUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) { height = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionColumn]], parentHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth); </s> add } else { height = parentHeight; heightMeasureMode = YGFloatIsUndefined(height) ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); </s> remove if (!YGFloatIsUndefined(width)) { widthMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); </s> add float width = YGUndefined; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, parentWidth)) { width = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionRow]], parentWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth); </s> add } else { width = parentWidth; widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined : YGMeasureModeExactly;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep add keep keep keep keep
<mask> } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight) >= <mask> 0.0f) { <mask> height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight); <mask> heightMeasureMode = YGMeasureModeAtMost; <mask> } <mask> <mask> if (YGLayoutNodeInternal(node, <mask> width, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight); </s> add height = YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight); </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], availableHeight) >= </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionHeight], parentHeight) >= </s> remove if (!YGFloatIsUndefined(height)) { heightMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn)) { height = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionColumn]], availableHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, availableWidth); </s> add float height = YGUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, parentHeight)) { height = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionColumn]], parentHeight) + YGNodeMarginForAxis(node, YGFlexDirectionColumn, parentWidth); </s> add } else { width = parentWidth; widthMeasureMode = YGFloatIsUndefined(width) ? YGMeasureModeUndefined : YGMeasureModeExactly; </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); </s> remove if (!YGFloatIsUndefined(width)) { widthMeasureMode = YGMeasureModeExactly; } else if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow)) { width = YGValueResolve(&node->style.dimensions[dim[YGFlexDirectionRow]], availableWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, availableWidth); </s> add float width = YGUndefined; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, parentWidth)) { width = YGValueResolve(node->resolvedDimensions[dim[YGFlexDirectionRow]], parentWidth) + YGNodeMarginForAxis(node, YGFlexDirectionRow, parentWidth);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep replace replace replace keep
<mask> height, <mask> parentDirection, <mask> widthMeasureMode, <mask> heightMeasureMode, <mask> availableWidth, <mask> availableHeight, <mask> true, <mask> "initia" <mask> "l")) { <mask> YGNodeSetPosition(node, node->layout.direction, availableWidth, availableHeight, availableWidth); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureRounding)) { roundToPixelGrid(node); </s> add if (YGConfigIsExperimentalFeatureEnabled(node->config, YGExperimentalFeatureRounding)) { YGRoundToPixelGrid(node); </s> remove YGNodeWithMeasureFuncSetMeasuredDimensions( node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode); </s> add YGNodeWithMeasureFuncSetMeasuredDimensions(node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode, parentWidth, parentHeight); </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) { </s> remove node, YGFlexDirectionRow, availableWidth - marginAxisRow, availableWidth, availableWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis(node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, availableHeight, availableWidth); </s> add node, YGFlexDirectionRow, availableWidth - marginAxisRow, parentWidth, parentWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis( node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, parentHeight, parentWidth); </s> remove const float availableWidth, const float availableHeight, </s> add const float parentWidth, const float parentHeight,
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep keep replace replace keep keep keep keep keep
<mask> "initia" <mask> "l")) { <mask> YGNodeSetPosition(node, node->layout.direction, availableWidth, availableHeight, availableWidth); <mask> <mask> if (YGIsExperimentalFeatureEnabled(YGExperimentalFeatureRounding)) { <mask> roundToPixelGrid(node); <mask> } <mask> <mask> if (gPrintTree) { <mask> YGNodePrint(node, YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove "initia" "l")) { YGNodeSetPosition(node, node->layout.direction, availableWidth, availableHeight, availableWidth); </s> add "initial", node->config)) { YGNodeSetPosition(node, node->layout.direction, parentWidth, parentHeight, parentWidth); </s> remove availableWidth, availableHeight, </s> add parentWidth, parentHeight, </s> remove YGNodeWithMeasureFuncSetMeasuredDimensions( node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode); </s> add YGNodeWithMeasureFuncSetMeasuredDimensions(node, availableWidth, availableHeight, widthMeasureMode, heightMeasureMode, parentWidth, parentHeight); </s> remove node, YGFlexDirectionRow, availableWidth - marginAxisRow, availableWidth, availableWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis(node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, availableHeight, availableWidth); </s> add node, YGFlexDirectionRow, availableWidth - marginAxisRow, parentWidth, parentWidth); node->layout.measuredDimensions[YGDimensionHeight] = YGNodeBoundAxis( node, YGFlexDirectionColumn, availableHeight - marginAxisColumn, parentHeight, parentWidth); </s> remove } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], availableWidth); </s> add } else if (YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth) >= 0.0f) { width = YGValueResolve(&node->style.maxDimensions[YGDimensionWidth], parentWidth); </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep keep replace replace replace replace keep keep replace replace keep keep keep keep
<mask> va_end(args); <mask> } <mask> <mask> static bool experimentalFeatures[YGExperimentalFeatureCount + 1]; <mask> <mask> void YGSetExperimentalFeatureEnabled(YGExperimentalFeature feature, bool enabled) { <mask> experimentalFeatures[feature] = enabled; <mask> } <mask> <mask> inline bool YGIsExperimentalFeatureEnabled(YGExperimentalFeature feature) { <mask> return experimentalFeatures[feature]; <mask> } <mask> <mask> void YGSetMemoryFuncs(YGMalloc ygmalloc, YGCalloc yccalloc, YGRealloc ygrealloc, YGFree ygfree) { <mask> YG_ASSERT(gNodeInstanceCount == 0, "Cannot set memory functions: all node must be freed first"); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove WIN_EXPORT void YGSetExperimentalFeatureEnabled(YGExperimentalFeature feature, bool enabled); WIN_EXPORT bool YGIsExperimentalFeatureEnabled(YGExperimentalFeature feature); </s> add // Set this to number of pixels in 1 point to round calculation results // If you want to avoid rounding - set PointScaleFactor to 0 WIN_EXPORT void YGSetPointScaleFactor(float pixelsInPoint); // YGConfig WIN_EXPORT YGConfigRef YGConfigNew(void); WIN_EXPORT void YGConfigFree(const YGConfigRef config); WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled(const YGConfigRef config, const YGExperimentalFeature feature, const bool enabled); WIN_EXPORT bool YGConfigIsExperimentalFeatureEnabled(const YGConfigRef config, const YGExperimentalFeature feature); </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize)))); </s> remove (YGNodeStyleGetFlexGrow(node) != 0 || YGNodeStyleGetFlexShrink(node) != 0)); </s> add (YGResolveFlexGrow(node) != 0 || YGNodeResolveFlexShrink(node) != 0)); </s> remove void jni_YGSetExperimentalFeatureEnabled(alias_ref<jclass> clazz, jint feature, jboolean enabled) { YGSetExperimentalFeatureEnabled(static_cast<YGExperimentalFeature>(feature), enabled); } jboolean jni_YGIsExperimentalFeatureEnabled(alias_ref<jclass> clazz, jint feature) { return YGIsExperimentalFeatureEnabled(static_cast<YGExperimentalFeature>(feature)); } jint jni_YGNodeGetInstanceCount(alias_ref<jclass> clazz) { return YGNodeGetInstanceCount(); } </s> add </s> add static inline void YGResolveDimensions(YGNodeRef node) { for (YGDimension dim = YGDimensionWidth; dim <= YGDimensionHeight; dim++) { if (node->style.maxDimensions[dim].unit != YGUnitUndefined && YGValueEqual(node->style.maxDimensions[dim], node->style.minDimensions[dim])) { node->resolvedDimensions[dim] = &node->style.maxDimensions[dim]; } else { node->resolvedDimensions[dim] = &node->style.dimensions[dim]; } } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c
keep keep add keep keep keep keep
<mask> } YGValue; <mask> <mask> static const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined}; <mask> <mask> typedef struct YGConfig *YGConfigRef; <mask> typedef struct YGNode *YGNodeRef; <mask> typedef YGSize (*YGMeasureFunc)(YGNodeRef node, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add typedef struct YGConfig *YGConfigRef; </s> remove struct _jqpl : _jobject {}; using jqpl = _jqpl*; namespace facebook { namespace jni { template<> class JObjectWrapper<jqpl> : public JObjectWrapper<jobject> { public: static constexpr const char* kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLogger;"; using JObjectWrapper<jobject>::JObjectWrapper; </s> add struct JQuickPerformanceLogger : JavaClass<JQuickPerformanceLogger> { static auto constexpr kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLogger;"; </s> remove template<> class JObjectWrapper<jqplProvider> : public JObjectWrapper<jobject> { public: static constexpr const char* kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLoggerProvider;"; </s> add struct JQuickPerformanceLoggerProvider : JavaClass<JQuickPerformanceLoggerProvider> { static auto constexpr kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLoggerProvider;"; </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } } </s> remove struct _jqplProvider : _jobject {}; using jqplProvider = _jqplProvider*; </s> add namespace facebook { namespace react { </s> remove static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis) { return node->style.dimensions[dim[axis]].unit != YGUnitUndefined && node->style.dimensions[dim[axis]].value >= 0.0f; </s> add static inline bool YGNodeIsStyleDimDefined(const YGNodeRef node, const YGFlexDirection axis, const float parentSize) { return !(node->resolvedDimensions[dim[axis]]->unit == YGUnitAuto || node->resolvedDimensions[dim[axis]]->unit == YGUnitUndefined || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPoint && node->resolvedDimensions[dim[axis]]->value < 0.0f) || (node->resolvedDimensions[dim[axis]]->unit == YGUnitPercent && (node->resolvedDimensions[dim[axis]]->value < 0.0f || YGFloatIsUndefined(parentSize))));
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.h
keep keep add keep keep keep keep keep keep
<mask> static const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined}; <mask> static const YGValue YGValueAuto = {YGUndefined, YGUnitAuto}; <mask> <mask> typedef struct YGNode *YGNodeRef; <mask> typedef YGSize (*YGMeasureFunc)(YGNodeRef node, <mask> float width, <mask> YGMeasureMode widthMode, <mask> float height, <mask> YGMeasureMode heightMode); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add static const YGValue YGValueAuto = {YGUndefined, YGUnitAuto}; </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const YGMeasureMode heightMeasureMode) { </s> add const YGMeasureMode heightMeasureMode, const float parentWidth, const float parentHeight) { </s> remove const YGDirection direction) { </s> add const YGDirection direction, const YGConfigRef config) { </s> remove const YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; const YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add YGMeasureMode measureModeMainDim = isMainAxisRow ? widthMeasureMode : heightMeasureMode; YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; </s> add static inline YGValue *YGMarginLeadingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeStart].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeStart]; } else { return &node->style.margin[leading[axis]]; } } static inline YGValue *YGMarginTrailingValue(const YGNodeRef node, const YGFlexDirection axis) { if (YGFlexDirectionIsRow(axis) && node->style.margin[YGEdgeEnd].unit != YGUnitUndefined) { return &node->style.margin[YGEdgeEnd]; } else { return &node->style.margin[trailing[axis]]; } }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.h
keep add keep keep keep keep
<mask> // YGNode <mask> WIN_EXPORT YGNodeRef YGNodeNew(void); <mask> WIN_EXPORT void YGNodeFree(const YGNodeRef node); <mask> WIN_EXPORT void YGNodeFreeRecursive(const YGNodeRef node); <mask> WIN_EXPORT void YGNodeReset(const YGNodeRef node); <mask> WIN_EXPORT int32_t YGNodeGetInstanceCount(void); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #define YG_NODE_STYLE_PROPERTY_UNIT_AUTO(type, name, paramName) \ YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node); </s> add #define YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(type, name) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node, const YGEdge edge); </s> remove WIN_EXPORT void YGSetExperimentalFeatureEnabled(YGExperimentalFeature feature, bool enabled); WIN_EXPORT bool YGIsExperimentalFeatureEnabled(YGExperimentalFeature feature); </s> add // Set this to number of pixels in 1 point to round calculation results // If you want to avoid rounding - set PointScaleFactor to 0 WIN_EXPORT void YGSetPointScaleFactor(float pixelsInPoint); // YGConfig WIN_EXPORT YGConfigRef YGConfigNew(void); WIN_EXPORT void YGConfigFree(const YGConfigRef config); WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled(const YGConfigRef config, const YGExperimentalFeature feature, const bool enabled); WIN_EXPORT bool YGConfigIsExperimentalFeatureEnabled(const YGConfigRef config, const YGExperimentalFeature feature); </s> remove YG_NODE_STYLE_PROPERTY_UNIT(YGValue, FlexBasis, flexBasis); </s> add YG_NODE_STYLE_PROPERTY_UNIT_AUTO(YGValue, FlexBasis, flexBasis); </s> remove WIN_EXPORT void YGNodeStyleSetFlex(const YGNodeRef node, const float flex); </s> add YG_NODE_STYLE_PROPERTY(float, Flex, flex); </s> remove YGUndefined, YGUndefined, </s> add static_cast<float>(width), static_cast<float>(height),
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.h
keep add keep keep keep keep keep
<mask> WIN_EXPORT type YGNodeStyleGet##name(const YGNodeRef node); <mask> <mask> #define YG_NODE_STYLE_EDGE_PROPERTY(type, name, paramName) \ <mask> WIN_EXPORT void YGNodeStyleSet##name(const YGNodeRef node, \ <mask> const YGEdge edge, \ <mask> const type paramName); \ <mask> WIN_EXPORT type YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #define YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(type, name) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node, const YGEdge edge); </s> remove return YGComputedEdgeValue(node->style.instanceName, edge, &defaultValue)->value; \ </s> add return node->style.instanceName[edge].value; \ </s> remove node->style.instanceName[edge].unit != YGUnitPixel) { \ </s> add node->style.instanceName[edge].unit != YGUnitPoint) { \ </s> remove YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPixel; \ </s> add YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint; \ </s> add WIN_EXPORT YGNodeRef YGNodeNewWithConfig(const YGConfigRef config); </s> add #define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name) \ YG_NODE_JNI_STYLE_UNIT_PROP(name) \ void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer) { \ YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer)); \ }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.h
keep keep keep add keep keep keep keep keep keep
<mask> const YGEdge edge, \ <mask> const float paramName); \ <mask> WIN_EXPORT type YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge); <mask> <mask> #define YG_NODE_LAYOUT_PROPERTY(type, name) \ <mask> WIN_EXPORT type YGNodeLayoutGet##name(const YGNodeRef node); <mask> <mask> #define YG_NODE_LAYOUT_EDGE_PROPERTY(type, name) \ <mask> WIN_EXPORT type YGNodeLayoutGet##name(const YGNodeRef node, const YGEdge edge); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #define YG_NODE_STYLE_PROPERTY_UNIT_AUTO(type, name, paramName) \ YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node); </s> remove return YGComputedEdgeValue(node->style.instanceName, edge, &defaultValue)->value; \ </s> add return node->style.instanceName[edge].value; \ </s> remove node->style.instanceName[edge].unit != YGUnitPixel) { \ </s> add node->style.instanceName[edge].unit != YGUnitPoint) { \ </s> remove YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPixel; \ </s> add YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint; \ </s> add #define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name) \ YG_NODE_JNI_STYLE_UNIT_PROP(name) \ void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer) { \ YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer)); \ } </s> add WIN_EXPORT YGNodeRef YGNodeNewWithConfig(const YGConfigRef config);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.h