Skip to content

Commit

Permalink
Rename AbsolutePositioning errata
Browse files Browse the repository at this point in the history
Summary:
X-link: facebook/react-native#42318

AbsolutePositioning -> AbsolutePositioningCatchAll

A bit more clear. This errata is for various issues with positioning absolute nodes. There really isn't a clear description as to what specifically this enables/disables, so I just opted to say "catch all" to indicate that this controls various bugs

Differential Revision: D52820117

fbshipit-source-id: 5b0461d446e25ca5806652b89c9ef30921b8c3f5
  • Loading branch information
joevilches authored and facebook-github-bot committed Jan 17, 2024
1 parent 9004e6b commit 54cbcb4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
2 changes: 1 addition & 1 deletion enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
("StretchFlexBasis", 1 << 0),
# Positioning of absolute nodes will have various bugs related to
# justification, alignment, and insets
("AbsolutePositioning", 1 << 1),
("AbsolutePositioningCatchAll", 1 << 1),
# Absolute nodes will resolve percentages against the inner size of
# their containing node, not the padding box
("AbsolutePercentAgainstInnerSize", 1 << 2),
Expand Down
4 changes: 2 additions & 2 deletions java/com/facebook/yoga/YogaErrata.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public enum YogaErrata {
NONE(0),
STRETCH_FLEX_BASIS(1),
ABSOLUTE_POSITIONING(2),
ABSOLUTE_POSITIONING_CATCH_ALL(2),
ABSOLUTE_PERCENT_AGAINST_INNER_SIZE(4),
ALL(2147483647),
CLASSIC(2147483646);
Expand All @@ -31,7 +31,7 @@ public static YogaErrata fromInt(int value) {
switch (value) {
case 0: return NONE;
case 1: return STRETCH_FLEX_BASIS;
case 2: return ABSOLUTE_POSITIONING;
case 2: return ABSOLUTE_POSITIONING_CATCH_ALL;
case 4: return ABSOLUTE_PERCENT_AGAINST_INNER_SIZE;
case 2147483647: return ALL;
case 2147483646: return CLASSIC;
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/generated/YGEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export enum Edge {
export enum Errata {
None = 0,
StretchFlexBasis = 1,
AbsolutePositioning = 2,
AbsolutePositioningCatchAll = 2,
AbsolutePercentAgainstInnerSize = 4,
All = 2147483647,
Classic = 2147483646,
Expand Down Expand Up @@ -161,7 +161,7 @@ const constants = {
EDGE_ALL: Edge.All,
ERRATA_NONE: Errata.None,
ERRATA_STRETCH_FLEX_BASIS: Errata.StretchFlexBasis,
ERRATA_ABSOLUTE_POSITIONING: Errata.AbsolutePositioning,
ERRATA_ABSOLUTE_POSITIONING_CATCH_ALL: Errata.AbsolutePositioningCatchAll,
ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: Errata.AbsolutePercentAgainstInnerSize,
ERRATA_ALL: Errata.All,
ERRATA_CLASSIC: Errata.Classic,
Expand Down
4 changes: 2 additions & 2 deletions yoga/YGEnums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ const char* YGErrataToString(const YGErrata value) {
return "none";
case YGErrataStretchFlexBasis:
return "stretch-flex-basis";
case YGErrataAbsolutePositioning:
return "absolute-positioning";
case YGErrataAbsolutePositioningCatchAll:
return "absolute-positioning-catch-all";
case YGErrataAbsolutePercentAgainstInnerSize:
return "absolute-percent-against-inner-size";
case YGErrataAll:
Expand Down
2 changes: 1 addition & 1 deletion yoga/YGEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ YG_ENUM_DECL(
YGErrata,
YGErrataNone = 0,
YGErrataStretchFlexBasis = 1,
YGErrataAbsolutePositioning = 2,
YGErrataAbsolutePositioningCatchAll = 2,
YGErrataAbsolutePercentAgainstInnerSize = 4,
YGErrataAll = 2147483647,
YGErrataClassic = 2147483646)
Expand Down
37 changes: 19 additions & 18 deletions yoga/algorithm/AbsoluteLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,24 +261,25 @@ static void positionAbsoluteChild(
const bool isMainAxis,
const float containingBlockWidth,
const float containingBlockHeight) {
child->hasErrata(Errata::AbsolutePositioning) ? positionAbsoluteChildLegacy(
containingNode,
parent,
child,
direction,
axis,
isMainAxis,
containingBlockWidth,
containingBlockHeight)
: positionAbsoluteChildImpl(
containingNode,
parent,
child,
direction,
axis,
isMainAxis,
containingBlockWidth,
containingBlockHeight);
child->hasErrata(Errata::AbsolutePositioningCatchAll)
? positionAbsoluteChildLegacy(
containingNode,
parent,
child,
direction,
axis,
isMainAxis,
containingBlockWidth,
containingBlockHeight)
: positionAbsoluteChildImpl(
containingNode,
parent,
child,
direction,
axis,
isMainAxis,
containingBlockWidth,
containingBlockHeight);
}

void layoutAbsoluteChild(
Expand Down
2 changes: 1 addition & 1 deletion yoga/enums/Errata.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace facebook::yoga {
enum class Errata : uint32_t {
None = YGErrataNone,
StretchFlexBasis = YGErrataStretchFlexBasis,
AbsolutePositioning = YGErrataAbsolutePositioning,
AbsolutePositioningCatchAll = YGErrataAbsolutePositioningCatchAll,
AbsolutePercentAgainstInnerSize = YGErrataAbsolutePercentAgainstInnerSize,
All = YGErrataAll,
Classic = YGErrataClassic,
Expand Down

0 comments on commit 54cbcb4

Please sign in to comment.