Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1721 X-link: https://github.com/facebook/react-native/pull/46938 The private internals of how we store styles needed to change a bit to support 3 new keyword values. Right now the only other keyword that can be stored is `auto`. As a result there isn't much fancy logic to support storing this and its just stored as a specific type inside of `StyleValueHandle`. There are only 3 bits for types (8 values), so it is not sustainable to just stuff every keyword in there. So the change writes the keyword as a value with a new `keyword` `Type`. I chose not to put `auto` in there even though it is a keyword since it is a hot path, I did not want to regress perf when I did not need to. I also make a new `StyleSizeValue` class to store size values - so values for `width`, `height`, etc. This way these new keywords are kept specific to sizes and we will not be able to create, for example, a margin: `max-content`. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D63927512 fbshipit-source-id: 7285469d37ac4b05226183b56275c77f0c06996c
146 lines
2.6 KiB
C
146 lines
2.6 KiB
C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
// @generated by enums.py
|
|
// clang-format off
|
|
#pragma once
|
|
#include <yoga/YGMacros.h>
|
|
|
|
YG_EXTERN_C_BEGIN
|
|
|
|
YG_ENUM_DECL(
|
|
YGAlign,
|
|
YGAlignAuto,
|
|
YGAlignFlexStart,
|
|
YGAlignCenter,
|
|
YGAlignFlexEnd,
|
|
YGAlignStretch,
|
|
YGAlignBaseline,
|
|
YGAlignSpaceBetween,
|
|
YGAlignSpaceAround,
|
|
YGAlignSpaceEvenly)
|
|
|
|
YG_ENUM_DECL(
|
|
YGBoxSizing,
|
|
YGBoxSizingBorderBox,
|
|
YGBoxSizingContentBox)
|
|
|
|
YG_ENUM_DECL(
|
|
YGDimension,
|
|
YGDimensionWidth,
|
|
YGDimensionHeight)
|
|
|
|
YG_ENUM_DECL(
|
|
YGDirection,
|
|
YGDirectionInherit,
|
|
YGDirectionLTR,
|
|
YGDirectionRTL)
|
|
|
|
YG_ENUM_DECL(
|
|
YGDisplay,
|
|
YGDisplayFlex,
|
|
YGDisplayNone,
|
|
YGDisplayContents)
|
|
|
|
YG_ENUM_DECL(
|
|
YGEdge,
|
|
YGEdgeLeft,
|
|
YGEdgeTop,
|
|
YGEdgeRight,
|
|
YGEdgeBottom,
|
|
YGEdgeStart,
|
|
YGEdgeEnd,
|
|
YGEdgeHorizontal,
|
|
YGEdgeVertical,
|
|
YGEdgeAll)
|
|
|
|
YG_ENUM_DECL(
|
|
YGErrata,
|
|
YGErrataNone = 0,
|
|
YGErrataStretchFlexBasis = 1,
|
|
YGErrataAbsolutePositionWithoutInsetsExcludesPadding = 2,
|
|
YGErrataAbsolutePercentAgainstInnerSize = 4,
|
|
YGErrataAll = 2147483647,
|
|
YGErrataClassic = 2147483646)
|
|
YG_DEFINE_ENUM_FLAG_OPERATORS(YGErrata)
|
|
|
|
YG_ENUM_DECL(
|
|
YGExperimentalFeature,
|
|
YGExperimentalFeatureWebFlexBasis)
|
|
|
|
YG_ENUM_DECL(
|
|
YGFlexDirection,
|
|
YGFlexDirectionColumn,
|
|
YGFlexDirectionColumnReverse,
|
|
YGFlexDirectionRow,
|
|
YGFlexDirectionRowReverse)
|
|
|
|
YG_ENUM_DECL(
|
|
YGGutter,
|
|
YGGutterColumn,
|
|
YGGutterRow,
|
|
YGGutterAll)
|
|
|
|
YG_ENUM_DECL(
|
|
YGJustify,
|
|
YGJustifyFlexStart,
|
|
YGJustifyCenter,
|
|
YGJustifyFlexEnd,
|
|
YGJustifySpaceBetween,
|
|
YGJustifySpaceAround,
|
|
YGJustifySpaceEvenly)
|
|
|
|
YG_ENUM_DECL(
|
|
YGLogLevel,
|
|
YGLogLevelError,
|
|
YGLogLevelWarn,
|
|
YGLogLevelInfo,
|
|
YGLogLevelDebug,
|
|
YGLogLevelVerbose,
|
|
YGLogLevelFatal)
|
|
|
|
YG_ENUM_DECL(
|
|
YGMeasureMode,
|
|
YGMeasureModeUndefined,
|
|
YGMeasureModeExactly,
|
|
YGMeasureModeAtMost)
|
|
|
|
YG_ENUM_DECL(
|
|
YGNodeType,
|
|
YGNodeTypeDefault,
|
|
YGNodeTypeText)
|
|
|
|
YG_ENUM_DECL(
|
|
YGOverflow,
|
|
YGOverflowVisible,
|
|
YGOverflowHidden,
|
|
YGOverflowScroll)
|
|
|
|
YG_ENUM_DECL(
|
|
YGPositionType,
|
|
YGPositionTypeStatic,
|
|
YGPositionTypeRelative,
|
|
YGPositionTypeAbsolute)
|
|
|
|
YG_ENUM_DECL(
|
|
YGUnit,
|
|
YGUnitUndefined,
|
|
YGUnitPoint,
|
|
YGUnitPercent,
|
|
YGUnitAuto,
|
|
YGUnitMaxContent,
|
|
YGUnitFitContent,
|
|
YGUnitStretch)
|
|
|
|
YG_ENUM_DECL(
|
|
YGWrap,
|
|
YGWrapNoWrap,
|
|
YGWrapWrap,
|
|
YGWrapWrapReverse)
|
|
|
|
YG_EXTERN_C_END
|