react-native-windows 0.74.10 → 0.74.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/Common/Common.vcxproj +8 -0
  2. package/Directory.Build.targets +5 -0
  3. package/Folly/Folly.vcxproj +10 -2
  4. package/Folly/Folly.vcxproj.filters +0 -7
  5. package/Libraries/Components/TextInput/TextInput.js +6 -3
  6. package/Libraries/Components/TextInput/TextInput.windows.js +6 -3
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/Text/Text.windows.js +1 -0
  9. package/Microsoft.ReactNative/Composition.Input.idl +3 -3
  10. package/Microsoft.ReactNative/CompositionSwitcher.idl +1 -0
  11. package/Microsoft.ReactNative/Fabric/Composition/ComponentViewRegistry.cpp +3 -0
  12. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +2 -2
  13. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +4 -4
  14. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +10 -0
  15. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +16 -27
  16. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -1
  17. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +85 -48
  18. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +4 -0
  19. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +19 -15
  20. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +4 -2
  21. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +10 -0
  22. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +3 -0
  23. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +42 -17
  24. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +3 -1
  25. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +42 -5
  26. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +22 -16
  27. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +30 -6
  28. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.h +2 -0
  29. package/Microsoft.ReactNative/Fabric/WindowsImageManager.cpp +5 -0
  30. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +3 -2
  31. package/Microsoft.ReactNative/packages.lock.json +10 -0
  32. package/PropertySheets/ARM64EC.props +13 -0
  33. package/PropertySheets/Application/ARM64EC.props +13 -0
  34. package/PropertySheets/DynamicLibrary/ARM64EC.props +13 -0
  35. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  36. package/PropertySheets/JSEngine.props +2 -0
  37. package/PropertySheets/StaticLibrary/ARM64EC.props +13 -0
  38. package/ReactCommon/ReactCommon.vcxproj +9 -1
  39. package/ReactCommon/ReactCommon.vcxproj.filters +16 -12
  40. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/algorithm/CalculateLayout.cpp +2 -0
  41. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.cpp +140 -0
  42. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/config/Config.h +92 -0
  43. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.cpp +48 -0
  44. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/LayoutResults.h +122 -0
  45. package/ReactCommon/TEMP_UntilReactCommonUpdate/yoga/yoga/node/Node.cpp +366 -0
  46. package/Scripts/OfficeReact.Win32.nuspec +16 -18
  47. package/Scripts/StripAdditionalPlatformsFromNuspec.ps1 +1 -1
  48. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +6 -6
  49. package/fmt/fmt.vcxproj +9 -1
  50. package/package.json +13 -13
@@ -117,18 +117,12 @@
117
117
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsiexecutor\jsireact\JSINativeModules.cpp">
118
118
  <Filter>jsiexecutor\jsireact</Filter>
119
119
  </ClCompile>
120
- <ClCompile Include="$(YogaDir)\yoga\Utils.cpp">
121
- <Filter>yoga</Filter>
122
- </ClCompile>
123
120
  <ClCompile Include="$(YogaDir)\yoga\YGConfig.cpp">
124
121
  <Filter>yoga</Filter>
125
122
  </ClCompile>
126
123
  <ClCompile Include="$(YogaDir)\yoga\YGEnums.cpp">
127
124
  <Filter>yoga</Filter>
128
125
  </ClCompile>
129
- <ClCompile Include="$(YogaDir)\yoga\YGLayout.cpp">
130
- <Filter>yoga</Filter>
131
- </ClCompile>
132
126
  <ClCompile Include="$(YogaDir)\yoga\YGNode.cpp">
133
127
  <Filter>yoga</Filter>
134
128
  </ClCompile>
@@ -138,9 +132,6 @@
138
132
  <ClCompile Include="$(YogaDir)\yoga\YGNodeStyle.cpp">
139
133
  <Filter>yoga</Filter>
140
134
  </ClCompile>
141
- <ClCompile Include="$(YogaDir)\yoga\YGNodePrint.cpp">
142
- <Filter>yoga</Filter>
143
- </ClCompile>
144
135
  <ClCompile Include="$(YogaDir)\yoga\YGPixelGrid.cpp">
145
136
  <Filter>yoga</Filter>
146
137
  </ClCompile>
@@ -156,9 +147,6 @@
156
147
  <ClCompile Include="$(YogaDir)\yoga\YGValue.cpp">
157
148
  <Filter>yoga</Filter>
158
149
  </ClCompile>
159
- <ClCompile Include="$(YogaDir)\yoga\log.cpp">
160
- <Filter>yoga</Filter>
161
- </ClCompile>
162
150
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\nativemodule\core\ReactCommon\TurboModuleBinding.cpp">
163
151
  <Filter>turbomodule\core</Filter>
164
152
  </ClCompile>
@@ -208,6 +196,18 @@
208
196
  <ClCompile Include="$(ReactNativeDir)\ReactCommon\react\renderer\telemetry\TransactionTelemetry.cpp">
209
197
  <Filter>react\renderer\telemetry</Filter>
210
198
  </ClCompile>
199
+ <ClCompile Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorInterfaces.cpp" />
200
+ <ClCompile Include="$(YogaDir)\yoga\algorithm\AbsoluteLayout.cpp" />
201
+ <ClCompile Include="$(YogaDir)\yoga\algorithm\Baseline.cpp" />
202
+ <ClCompile Include="$(YogaDir)\yoga\algorithm\Cache.cpp" />
203
+ <ClCompile Include="$(YogaDir)\yoga\algorithm\CalculateLayout.cpp" />
204
+ <ClCompile Include="$(YogaDir)\yoga\algorithm\FlexLine.cpp" />
205
+ <ClCompile Include="$(YogaDir)\yoga\algorithm\PixelGrid.cpp" />
206
+ <ClCompile Include="$(YogaDir)\yoga\config\Config.cpp" />
207
+ <ClCompile Include="$(YogaDir)\yoga\debug\AssertFatal.cpp" />
208
+ <ClCompile Include="$(YogaDir)\yoga\debug\Log.cpp" />
209
+ <ClCompile Include="$(YogaDir)\yoga\node\LayoutResults.cpp" />
210
+ <ClCompile Include="$(YogaDir)\yoga\node\Node.cpp" />
211
211
  </ItemGroup>
212
212
  <ItemGroup>
213
213
  <ClInclude Include="..\stubs\sys\mman.h">
@@ -325,5 +325,9 @@
325
325
  <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\bridging\CallbackWrapper.h">
326
326
  <Filter>react\bridging</Filter>
327
327
  </ClInclude>
328
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\jsinspector-modern\InspectorInterfaces.h" />
329
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\RuntimeScheduler_Legacy.h" />
330
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\runtimescheduler\RuntimeScheduler_Modern.h" />
331
+ <ClInclude Include="$(ReactNativeDir)\ReactCommon\react\renderer\core\PropsParserContext.h" />
328
332
  </ItemGroup>
329
333
  </Project>
@@ -2120,6 +2120,7 @@ bool calculateLayoutInternal(
2120
2120
 
2121
2121
  const bool needToVisitNode =
2122
2122
  (node->isDirty() && layout->generationCount != generationCount) ||
2123
+ layout->configVersion != node->getConfig()->getVersion() || // [Windows]
2123
2124
  layout->lastOwnerDirection != ownerDirection;
2124
2125
 
2125
2126
  if (needToVisitNode) {
@@ -2235,6 +2236,7 @@ bool calculateLayoutInternal(
2235
2236
  reason);
2236
2237
 
2237
2238
  layout->lastOwnerDirection = ownerDirection;
2239
+ layout->configVersion = node->getConfig()->getVersion(); // [Windows]
2238
2240
 
2239
2241
  if (cachedResults == nullptr) {
2240
2242
  layoutMarkerData.maxMeasureCache = std::max(
@@ -0,0 +1,140 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #include <yoga/config/Config.h>
9
+ #include <yoga/debug/Log.h>
10
+ #include <yoga/node/Node.h>
11
+
12
+ namespace facebook::yoga {
13
+
14
+ bool configUpdateInvalidatesLayout(
15
+ const Config& oldConfig,
16
+ const Config& newConfig) {
17
+ return oldConfig.getErrata() != newConfig.getErrata() ||
18
+ oldConfig.getEnabledExperiments() != newConfig.getEnabledExperiments() ||
19
+ oldConfig.getPointScaleFactor() != newConfig.getPointScaleFactor() ||
20
+ oldConfig.useWebDefaults() != newConfig.useWebDefaults();
21
+ }
22
+
23
+ Config::Config(YGLogger logger) : cloneNodeCallback_{nullptr} {
24
+ setLogger(logger);
25
+ }
26
+
27
+ void Config::setUseWebDefaults(bool useWebDefaults) {
28
+ useWebDefaults_ = useWebDefaults;
29
+ }
30
+
31
+ bool Config::useWebDefaults() const {
32
+ return useWebDefaults_;
33
+ }
34
+
35
+ void Config::setExperimentalFeatureEnabled(
36
+ ExperimentalFeature feature,
37
+ bool enabled) {
38
+ if (isExperimentalFeatureEnabled(feature) != enabled) {
39
+ experimentalFeatures_.set(static_cast<size_t>(feature), enabled);
40
+ version_++;
41
+ }
42
+ }
43
+
44
+ bool Config::isExperimentalFeatureEnabled(ExperimentalFeature feature) const {
45
+ return experimentalFeatures_.test(static_cast<size_t>(feature));
46
+ }
47
+
48
+ ExperimentalFeatureSet Config::getEnabledExperiments() const {
49
+ return experimentalFeatures_;
50
+ }
51
+
52
+ void Config::setErrata(Errata errata) {
53
+ if (errata_ != errata) {
54
+ errata_ = errata;
55
+ version_++;
56
+ }
57
+ }
58
+
59
+ void Config::addErrata(Errata errata) {
60
+ if (!hasErrata(errata)) {
61
+ errata_ |= errata;
62
+ version_++;
63
+ }
64
+ }
65
+
66
+ void Config::removeErrata(Errata errata) {
67
+ if (hasErrata(errata)) {
68
+ errata_ &= (~errata);
69
+ version_++;
70
+ }
71
+ }
72
+
73
+ Errata Config::getErrata() const {
74
+ return errata_;
75
+ }
76
+
77
+ bool Config::hasErrata(Errata errata) const {
78
+ return (errata_ & errata) != Errata::None;
79
+ }
80
+
81
+ void Config::setPointScaleFactor(float pointScaleFactor) {
82
+ if (pointScaleFactor_ != pointScaleFactor) {
83
+ pointScaleFactor_ = pointScaleFactor;
84
+ version_++;
85
+ }
86
+ }
87
+
88
+ float Config::getPointScaleFactor() const {
89
+ return pointScaleFactor_;
90
+ }
91
+
92
+ void Config::setContext(void* context) {
93
+ context_ = context;
94
+ }
95
+
96
+ void* Config::getContext() const {
97
+ return context_;
98
+ }
99
+
100
+ // [Windows #13409]
101
+ uint32_t Config::getVersion() const noexcept {
102
+ return version_;
103
+ }
104
+
105
+ void Config::setLogger(YGLogger logger) {
106
+ logger_ = logger;
107
+ }
108
+
109
+ void Config::log(
110
+ const yoga::Node* node,
111
+ LogLevel logLevel,
112
+ const char* format,
113
+ va_list args) const {
114
+ logger_(this, node, unscopedEnum(logLevel), format, args);
115
+ }
116
+
117
+ void Config::setCloneNodeCallback(YGCloneNodeFunc cloneNode) {
118
+ cloneNodeCallback_ = cloneNode;
119
+ }
120
+
121
+ YGNodeRef Config::cloneNode(
122
+ YGNodeConstRef node,
123
+ YGNodeConstRef owner,
124
+ size_t childIndex) const {
125
+ YGNodeRef clone = nullptr;
126
+ if (cloneNodeCallback_ != nullptr) {
127
+ clone = cloneNodeCallback_(node, owner, childIndex);
128
+ }
129
+ if (clone == nullptr) {
130
+ clone = YGNodeClone(node);
131
+ }
132
+ return clone;
133
+ }
134
+
135
+ /*static*/ const Config& Config::getDefault() {
136
+ static Config config{getDefaultLogger()};
137
+ return config;
138
+ }
139
+
140
+ } // namespace facebook::yoga
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include <bitset>
11
+
12
+ #include <yoga/Yoga.h>
13
+ #include <yoga/enums/Errata.h>
14
+ #include <yoga/enums/ExperimentalFeature.h>
15
+ #include <yoga/enums/LogLevel.h>
16
+
17
+ // Tag struct used to form the opaque YGConfigRef for the public C API
18
+ struct YGConfig {};
19
+
20
+ namespace facebook::yoga {
21
+
22
+ class Config;
23
+ class Node;
24
+
25
+ using ExperimentalFeatureSet = std::bitset<ordinalCount<ExperimentalFeature>()>;
26
+
27
+ // Whether moving a node from an old to new config should dirty previously
28
+ // calculated layout results.
29
+ bool configUpdateInvalidatesLayout(
30
+ const Config& oldConfig,
31
+ const Config& newConfig);
32
+
33
+ class YG_EXPORT Config : public ::YGConfig {
34
+ public:
35
+ Config(YGLogger logger);
36
+
37
+ void setUseWebDefaults(bool useWebDefaults);
38
+ bool useWebDefaults() const;
39
+
40
+ void setExperimentalFeatureEnabled(ExperimentalFeature feature, bool enabled);
41
+ bool isExperimentalFeatureEnabled(ExperimentalFeature feature) const;
42
+ ExperimentalFeatureSet getEnabledExperiments() const;
43
+
44
+ void setErrata(Errata errata);
45
+ void addErrata(Errata errata);
46
+ void removeErrata(Errata errata);
47
+ Errata getErrata() const;
48
+ bool hasErrata(Errata errata) const;
49
+
50
+ void setPointScaleFactor(float pointScaleFactor);
51
+ float getPointScaleFactor() const;
52
+
53
+ void setContext(void* context);
54
+ void* getContext() const;
55
+
56
+ uint32_t getVersion() const noexcept; // [Windows #13409]
57
+
58
+ void setLogger(YGLogger logger);
59
+ void log(
60
+ const yoga::Node* node,
61
+ LogLevel logLevel,
62
+ const char* format,
63
+ va_list args) const;
64
+
65
+ void setCloneNodeCallback(YGCloneNodeFunc cloneNode);
66
+ YGNodeRef
67
+ cloneNode(YGNodeConstRef node, YGNodeConstRef owner, size_t childIndex) const;
68
+
69
+ static const Config& getDefault();
70
+
71
+ private:
72
+ YGCloneNodeFunc cloneNodeCallback_;
73
+ YGLogger logger_;
74
+
75
+ bool useWebDefaults_ : 1 = false;
76
+
77
+ uint32_t version_ = 0; // [Windows #13409]
78
+ ExperimentalFeatureSet experimentalFeatures_{};
79
+ Errata errata_ = Errata::None;
80
+ float pointScaleFactor_ = 1.0f;
81
+ void* context_ = nullptr;
82
+ };
83
+
84
+ inline Config* resolveRef(const YGConfigRef ref) {
85
+ return static_cast<Config*>(ref);
86
+ }
87
+
88
+ inline const Config* resolveRef(const YGConfigConstRef ref) {
89
+ return static_cast<const Config*>(ref);
90
+ }
91
+
92
+ } // namespace facebook::yoga
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #include <cmath>
9
+
10
+ #include <yoga/node/LayoutResults.h>
11
+ #include <yoga/numeric/Comparison.h>
12
+
13
+ namespace facebook::yoga {
14
+
15
+ bool LayoutResults::operator==(LayoutResults layout) const {
16
+ bool isEqual = yoga::inexactEquals(position_, layout.position_) &&
17
+ yoga::inexactEquals(dimensions_, layout.dimensions_) &&
18
+ yoga::inexactEquals(margin_, layout.margin_) &&
19
+ yoga::inexactEquals(border_, layout.border_) &&
20
+ yoga::inexactEquals(padding_, layout.padding_) &&
21
+ direction() == layout.direction() &&
22
+ hadOverflow() == layout.hadOverflow() &&
23
+ lastOwnerDirection == layout.lastOwnerDirection &&
24
+ configVersion == layout.configVersion && // [Windows #13409]
25
+ nextCachedMeasurementsIndex == layout.nextCachedMeasurementsIndex &&
26
+ cachedLayout == layout.cachedLayout &&
27
+ computedFlexBasis == layout.computedFlexBasis;
28
+
29
+ for (uint32_t i = 0; i < LayoutResults::MaxCachedMeasurements && isEqual;
30
+ ++i) {
31
+ isEqual = isEqual && cachedMeasurements[i] == layout.cachedMeasurements[i];
32
+ }
33
+
34
+ if (!yoga::isUndefined(measuredDimensions_[0]) ||
35
+ !yoga::isUndefined(layout.measuredDimensions_[0])) {
36
+ isEqual =
37
+ isEqual && (measuredDimensions_[0] == layout.measuredDimensions_[0]);
38
+ }
39
+ if (!yoga::isUndefined(measuredDimensions_[1]) ||
40
+ !yoga::isUndefined(layout.measuredDimensions_[1])) {
41
+ isEqual =
42
+ isEqual && (measuredDimensions_[1] == layout.measuredDimensions_[1]);
43
+ }
44
+
45
+ return isEqual;
46
+ }
47
+
48
+ } // namespace facebook::yoga
@@ -0,0 +1,122 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include <array>
11
+
12
+ #include <yoga/debug/AssertFatal.h>
13
+ #include <yoga/enums/Dimension.h>
14
+ #include <yoga/enums/Direction.h>
15
+ #include <yoga/enums/Edge.h>
16
+ #include <yoga/enums/PhysicalEdge.h>
17
+ #include <yoga/node/CachedMeasurement.h>
18
+ #include <yoga/numeric/FloatOptional.h>
19
+
20
+ namespace facebook::yoga {
21
+
22
+ struct LayoutResults {
23
+ // This value was chosen based on empirical data:
24
+ // 98% of analyzed layouts require less than 8 entries.
25
+ static constexpr int32_t MaxCachedMeasurements = 8;
26
+
27
+ uint32_t computedFlexBasisGeneration = 0;
28
+ FloatOptional computedFlexBasis = {};
29
+
30
+ // Instead of recomputing the entire layout every single time, we cache some
31
+ // information to break early when nothing changed
32
+ uint32_t generationCount = 0;
33
+ uint32_t configVersion = 0; // [Windows #13409]
34
+ Direction lastOwnerDirection = Direction::Inherit;
35
+
36
+ uint32_t nextCachedMeasurementsIndex = 0;
37
+ std::array<CachedMeasurement, MaxCachedMeasurements> cachedMeasurements = {};
38
+
39
+ CachedMeasurement cachedLayout{};
40
+
41
+ Direction direction() const {
42
+ return direction_;
43
+ }
44
+
45
+ void setDirection(Direction direction) {
46
+ direction_ = direction;
47
+ }
48
+
49
+ bool hadOverflow() const {
50
+ return hadOverflow_;
51
+ }
52
+
53
+ void setHadOverflow(bool hadOverflow) {
54
+ hadOverflow_ = hadOverflow;
55
+ }
56
+
57
+ float dimension(Dimension axis) const {
58
+ return dimensions_[yoga::to_underlying(axis)];
59
+ }
60
+
61
+ void setDimension(Dimension axis, float dimension) {
62
+ dimensions_[yoga::to_underlying(axis)] = dimension;
63
+ }
64
+
65
+ float measuredDimension(Dimension axis) const {
66
+ return measuredDimensions_[yoga::to_underlying(axis)];
67
+ }
68
+
69
+ void setMeasuredDimension(Dimension axis, float dimension) {
70
+ measuredDimensions_[yoga::to_underlying(axis)] = dimension;
71
+ }
72
+
73
+ float position(PhysicalEdge physicalEdge) const {
74
+ return position_[yoga::to_underlying(physicalEdge)];
75
+ }
76
+
77
+ void setPosition(PhysicalEdge physicalEdge, float dimension) {
78
+ position_[yoga::to_underlying(physicalEdge)] = dimension;
79
+ }
80
+
81
+ float margin(PhysicalEdge physicalEdge) const {
82
+ return margin_[yoga::to_underlying(physicalEdge)];
83
+ }
84
+
85
+ void setMargin(PhysicalEdge physicalEdge, float dimension) {
86
+ margin_[yoga::to_underlying(physicalEdge)] = dimension;
87
+ }
88
+
89
+ float border(PhysicalEdge physicalEdge) const {
90
+ return border_[yoga::to_underlying(physicalEdge)];
91
+ }
92
+
93
+ void setBorder(PhysicalEdge physicalEdge, float dimension) {
94
+ border_[yoga::to_underlying(physicalEdge)] = dimension;
95
+ }
96
+
97
+ float padding(PhysicalEdge physicalEdge) const {
98
+ return padding_[yoga::to_underlying(physicalEdge)];
99
+ }
100
+
101
+ void setPadding(PhysicalEdge physicalEdge, float dimension) {
102
+ padding_[yoga::to_underlying(physicalEdge)] = dimension;
103
+ }
104
+
105
+ bool operator==(LayoutResults layout) const;
106
+ bool operator!=(LayoutResults layout) const {
107
+ return !(*this == layout);
108
+ }
109
+
110
+ private:
111
+ Direction direction_ : bitCount<Direction>() = Direction::Inherit;
112
+ bool hadOverflow_ : 1 = false;
113
+
114
+ std::array<float, 2> dimensions_ = {{YGUndefined, YGUndefined}};
115
+ std::array<float, 2> measuredDimensions_ = {{YGUndefined, YGUndefined}};
116
+ std::array<float, 4> position_ = {};
117
+ std::array<float, 4> margin_ = {};
118
+ std::array<float, 4> border_ = {};
119
+ std::array<float, 4> padding_ = {};
120
+ };
121
+
122
+ } // namespace facebook::yoga