Add YGErrata Enum (#1256)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1256 X-link: https://github.com/facebook/react-native/pull/37076 This adds a `YGErrata` bitset enum matching the API and guarantees described in https://github.com/facebook/yoga/issues/1247. It is hooked up in later diffs. There are a couple of `YGExperimentalFeature` values that belong here, but keeping the current options means that the default `YGErrataNone` corresponds to existing default behavior, letting us stage the series of changes as: 1. Implement errata API 2. Update internal Yoga users we want to de-risk to `YGErrataClassic` or `YGErrataAll` (if setting `UseLegacyStretchBehaviour`) 3. Add new errata, changing Yoga defaults to be conformant, while letting internal apps opt into compatibility modes pending experimentation. I also added a macro to let C++ users of Yoga perform bitwise operations on the enum without casting (already available for C users). Reviewed By: rshest Differential Revision: D45254098 fbshipit-source-id: d4b61271a8018f548f2d9d8c953db4b121a502d1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fc68765314
commit
01c0c4ed3b
19
javascript/src_js/generated/YGEnums.d.ts
vendored
19
javascript/src_js/generated/YGEnums.d.ts
vendored
@@ -84,6 +84,19 @@ type EDGE_ALL = 8 & ['EDGE']
|
||||
export const EDGE_ALL: EDGE_ALL;
|
||||
|
||||
|
||||
type ERRATA_NONE = 0 & ['ERRATA']
|
||||
export const ERRATA_NONE: ERRATA_NONE;
|
||||
|
||||
type ERRATA_STRETCH_FLEX_BASIS = 1 & ['ERRATA']
|
||||
export const ERRATA_STRETCH_FLEX_BASIS: ERRATA_STRETCH_FLEX_BASIS;
|
||||
|
||||
type ERRATA_ALL = 2147483647 & ['ERRATA']
|
||||
export const ERRATA_ALL: ERRATA_ALL;
|
||||
|
||||
type ERRATA_CLASSIC = 2147483646 & ['ERRATA']
|
||||
export const ERRATA_CLASSIC: ERRATA_CLASSIC;
|
||||
|
||||
|
||||
type EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0 & ['EXPERIMENTAL_FEATURE']
|
||||
export const EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS;
|
||||
|
||||
@@ -259,6 +272,12 @@ export type Edge =
|
||||
| typeof EDGE_VERTICAL
|
||||
| typeof EDGE_ALL;
|
||||
|
||||
export type Errata =
|
||||
| typeof ERRATA_NONE
|
||||
| typeof ERRATA_STRETCH_FLEX_BASIS
|
||||
| typeof ERRATA_ALL
|
||||
| typeof ERRATA_CLASSIC;
|
||||
|
||||
export type ExperimentalFeature =
|
||||
| typeof EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS
|
||||
| typeof EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE
|
||||
|
@@ -36,6 +36,11 @@ exports.EDGE_HORIZONTAL = 6;
|
||||
exports.EDGE_VERTICAL = 7;
|
||||
exports.EDGE_ALL = 8;
|
||||
|
||||
exports.ERRATA_NONE = 0;
|
||||
exports.ERRATA_STRETCH_FLEX_BASIS = 1;
|
||||
exports.ERRATA_ALL = 2147483647;
|
||||
exports.ERRATA_CLASSIC = 2147483646;
|
||||
|
||||
exports.EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS = 0;
|
||||
exports.EXPERIMENTAL_FEATURE_ABSOLUTE_PERCENTAGE_AGAINST_PADDING_EDGE = 1;
|
||||
exports.EXPERIMENTAL_FEATURE_FIX_ABSOLUTE_TRAILING_COLUMN_MARGIN = 2;
|
||||
|
Reference in New Issue
Block a user