react-nitro-yoga 0.0.0-stage → 0.0.1-alpha.7

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 (529) hide show
  1. package/Generated/.gitattributes +1 -0
  2. package/Generated/api.d.ts +100 -0
  3. package/Generated/ffigen_yoga_adapters.h +52 -0
  4. package/Generated/native.d.ts +84 -0
  5. package/Generated/native.ts +283 -0
  6. package/Generated/yoga.c +1087 -0
  7. package/LICENSE +21 -0
  8. package/Package.swift +57 -0
  9. package/README.md +61 -2
  10. package/Sources/ReactNitroYoga/InstallHermesBindings.cpp +11 -0
  11. package/Sources/ReactNitroYoga/SHUnit.h +16 -0
  12. package/include/ReactNitroYoga/InstallHermesBindings.hpp +12 -0
  13. package/package.json +26 -4
  14. package/yoga/.clang-format +109 -0
  15. package/yoga/.clang-tidy +217 -0
  16. package/yoga/.editorconfig +11 -0
  17. package/yoga/.eslintrc.cjs +84 -0
  18. package/yoga/.github/ISSUE_TEMPLATE.md +21 -0
  19. package/yoga/.github/actions/black/action.yml +25 -0
  20. package/yoga/.github/actions/cache-emsdk/action.yml +10 -0
  21. package/yoga/.github/actions/install-ninja/action.yml +14 -0
  22. package/yoga/.github/actions/setup-android/action.yml +12 -0
  23. package/yoga/.github/actions/setup-apple/action.yml +8 -0
  24. package/yoga/.github/actions/setup-cpp/action.yml +34 -0
  25. package/yoga/.github/actions/setup-js/action.yml +18 -0
  26. package/yoga/.github/workflows/publish-android-release.yml +38 -0
  27. package/yoga/.github/workflows/publish-android-snashot.yml +36 -0
  28. package/yoga/.github/workflows/publish-npm-release.yml +25 -0
  29. package/yoga/.github/workflows/validate-android.yml +30 -0
  30. package/yoga/.github/workflows/validate-cpp.yml +101 -0
  31. package/yoga/.github/workflows/validate-format.yml +36 -0
  32. package/yoga/.github/workflows/validate-js.yml +119 -0
  33. package/yoga/.github/workflows/validate-swiftpm.yml +29 -0
  34. package/yoga/.github/workflows/validate-tests.yml +35 -0
  35. package/yoga/.github/workflows/validate-website.yml +45 -0
  36. package/yoga/.prettierignore +3 -0
  37. package/yoga/.prettierrc.js +16 -0
  38. package/yoga/.vscode/extensions.json +7 -0
  39. package/yoga/.vscode/launch.json +25 -0
  40. package/yoga/.vscode/settings.json +20 -0
  41. package/yoga/.vscode/tasks.json +23 -0
  42. package/yoga/CMakeLists.txt +58 -0
  43. package/yoga/CODE_OF_CONDUCT.md +76 -0
  44. package/yoga/CONTRIBUTING.md +44 -0
  45. package/yoga/LICENSE +21 -0
  46. package/yoga/LICENSE-examples +9 -0
  47. package/yoga/Package.swift +32 -0
  48. package/yoga/README.md +36 -0
  49. package/yoga/benchmark/Benchmark.cpp +400 -0
  50. package/yoga/benchmark/Benchmark.h +39 -0
  51. package/yoga/benchmark/CMakeLists.txt +27 -0
  52. package/yoga/benchmark/TreeDeserialization.cpp +248 -0
  53. package/yoga/benchmark/TreeDeserialization.h +52 -0
  54. package/yoga/benchmark/YGBenchmark.c +183 -0
  55. package/yoga/benchmark/benchmark +15 -0
  56. package/yoga/benchmark/captures/chat-mac.json +24426 -0
  57. package/yoga/benchmark/captures/feed-android.json +10335 -0
  58. package/yoga/benchmark/captures/profile-ios.json +1955 -0
  59. package/yoga/benchmark/captures/rendering-sample-mac.json +1927 -0
  60. package/yoga/build.gradle +46 -0
  61. package/yoga/build_fuzz_tests +28 -0
  62. package/yoga/capture/CMakeLists.txt +23 -0
  63. package/yoga/capture/CaptureTree.cpp +100 -0
  64. package/yoga/capture/CaptureTree.h +47 -0
  65. package/yoga/capture/NodeToString.cpp +359 -0
  66. package/yoga/capture/NodeToString.h +40 -0
  67. package/yoga/cmake/project-defaults.cmake +50 -0
  68. package/yoga/cmake/yoga-config.cmake.in +10 -0
  69. package/yoga/enums.py +394 -0
  70. package/yoga/fuzz/CMakeLists.txt +21 -0
  71. package/yoga/fuzz/FuzzLayout.cpp +57 -0
  72. package/yoga/gentest/babel.config.cjs +12 -0
  73. package/yoga/gentest/fixtures/YGAbsolutePositionTest.html +168 -0
  74. package/yoga/gentest/fixtures/YGAlignContentTest.html +479 -0
  75. package/yoga/gentest/fixtures/YGAlignItemsTest.html +227 -0
  76. package/yoga/gentest/fixtures/YGAlignSelfTest.html +23 -0
  77. package/yoga/gentest/fixtures/YGAndroidNewsFeed.html +28 -0
  78. package/yoga/gentest/fixtures/YGAspectRatioTest.html +3 -0
  79. package/yoga/gentest/fixtures/YGAutoTest.html +25 -0
  80. package/yoga/gentest/fixtures/YGBorderTest.html +18 -0
  81. package/yoga/gentest/fixtures/YGBoxSizingTest.html +240 -0
  82. package/yoga/gentest/fixtures/YGDimensionTest.html +9 -0
  83. package/yoga/gentest/fixtures/YGDisplayTest.html +89 -0
  84. package/yoga/gentest/fixtures/YGFlexBasisFitContentTest.html +55 -0
  85. package/yoga/gentest/fixtures/YGFlexDirectionTest.html +391 -0
  86. package/yoga/gentest/fixtures/YGFlexTest.html +53 -0
  87. package/yoga/gentest/fixtures/YGFlexWrapTest.html +160 -0
  88. package/yoga/gentest/fixtures/YGGapTest.html +233 -0
  89. package/yoga/gentest/fixtures/YGIntrinsicSizeTest.html +295 -0
  90. package/yoga/gentest/fixtures/YGJustifyContentTest.html +164 -0
  91. package/yoga/gentest/fixtures/YGMarginTest.html +157 -0
  92. package/yoga/gentest/fixtures/YGMinMaxDimensionTest.html +116 -0
  93. package/yoga/gentest/fixtures/YGPaddingTest.html +29 -0
  94. package/yoga/gentest/fixtures/YGPercentageTest.html +125 -0
  95. package/yoga/gentest/fixtures/YGRoundingTest.html +95 -0
  96. package/yoga/gentest/fixtures/YGSizeOverflowTest.html +17 -0
  97. package/yoga/gentest/fixtures/YGStaticPositionTest.html +712 -0
  98. package/yoga/gentest/fonts/Ahem.ttf +0 -0
  99. package/yoga/gentest/gentest-driver.ts +141 -0
  100. package/yoga/gentest/gentest-validate.ts +43 -0
  101. package/yoga/gentest/package.json +24 -0
  102. package/yoga/gentest/scripts/gentest-validate.ts +43 -0
  103. package/yoga/gentest/signedsource.d.ts +10 -0
  104. package/yoga/gentest/src/ChromePool.ts +78 -0
  105. package/yoga/gentest/src/CssToYoga.ts +958 -0
  106. package/yoga/gentest/src/buildLayoutTree.ts +98 -0
  107. package/yoga/gentest/src/cli.ts +163 -0
  108. package/yoga/gentest/src/emitters/CppEmitter.ts +452 -0
  109. package/yoga/gentest/src/emitters/Emitter.ts +204 -0
  110. package/yoga/gentest/src/emitters/JavaEmitter.ts +469 -0
  111. package/yoga/gentest/src/emitters/JavascriptEmitter.ts +353 -0
  112. package/yoga/gentest/src/types.ts +41 -0
  113. package/yoga/gentest/test-template.html +42 -0
  114. package/yoga/gentest/tsconfig.json +13 -0
  115. package/yoga/gradle/wrapper/gradle-wrapper.jar +0 -0
  116. package/yoga/gradle/wrapper/gradle-wrapper.properties +7 -0
  117. package/yoga/gradle.properties +14 -0
  118. package/yoga/gradlew +251 -0
  119. package/yoga/gradlew.bat +94 -0
  120. package/yoga/java/AndroidManifest.xml +14 -0
  121. package/yoga/java/CMakeLists.txt +22 -0
  122. package/yoga/java/build.gradle.kts +127 -0
  123. package/yoga/java/com/facebook/yoga/LayoutPassReason.kt +35 -0
  124. package/yoga/java/com/facebook/yoga/YogaAlign.kt +45 -0
  125. package/yoga/java/com/facebook/yoga/YogaBaselineFunction.kt +16 -0
  126. package/yoga/java/com/facebook/yoga/YogaBoxSizing.kt +27 -0
  127. package/yoga/java/com/facebook/yoga/YogaConfig.kt +48 -0
  128. package/yoga/java/com/facebook/yoga/YogaConfigFactory.kt +12 -0
  129. package/yoga/java/com/facebook/yoga/YogaConfigJNIBase.kt +70 -0
  130. package/yoga/java/com/facebook/yoga/YogaConfigJNIFinalizer.kt +30 -0
  131. package/yoga/java/com/facebook/yoga/YogaConstants.kt +18 -0
  132. package/yoga/java/com/facebook/yoga/YogaDimension.kt +27 -0
  133. package/yoga/java/com/facebook/yoga/YogaDirection.kt +29 -0
  134. package/yoga/java/com/facebook/yoga/YogaDisplay.kt +31 -0
  135. package/yoga/java/com/facebook/yoga/YogaEdge.kt +41 -0
  136. package/yoga/java/com/facebook/yoga/YogaErrata.kt +39 -0
  137. package/yoga/java/com/facebook/yoga/YogaExperimentalFeature.kt +27 -0
  138. package/yoga/java/com/facebook/yoga/YogaFlexDirection.kt +31 -0
  139. package/yoga/java/com/facebook/yoga/YogaGridTrackType.kt +33 -0
  140. package/yoga/java/com/facebook/yoga/YogaGutter.kt +29 -0
  141. package/yoga/java/com/facebook/yoga/YogaJustify.kt +43 -0
  142. package/yoga/java/com/facebook/yoga/YogaLayoutType.kt +27 -0
  143. package/yoga/java/com/facebook/yoga/YogaLogLevel.kt +39 -0
  144. package/yoga/java/com/facebook/yoga/YogaLogger.kt +19 -0
  145. package/yoga/java/com/facebook/yoga/YogaMeasureFunction.kt +19 -0
  146. package/yoga/java/com/facebook/yoga/YogaMeasureMode.kt +29 -0
  147. package/yoga/java/com/facebook/yoga/YogaMeasureOutput.kt +29 -0
  148. package/yoga/java/com/facebook/yoga/YogaNative.kt +347 -0
  149. package/yoga/java/com/facebook/yoga/YogaNode.kt +254 -0
  150. package/yoga/java/com/facebook/yoga/YogaNodeFactory.kt +14 -0
  151. package/yoga/java/com/facebook/yoga/YogaNodeJNIBase.kt +762 -0
  152. package/yoga/java/com/facebook/yoga/YogaNodeJNIFinalizer.kt +33 -0
  153. package/yoga/java/com/facebook/yoga/YogaNodeType.kt +27 -0
  154. package/yoga/java/com/facebook/yoga/YogaOverflow.kt +29 -0
  155. package/yoga/java/com/facebook/yoga/YogaPositionType.kt +29 -0
  156. package/yoga/java/com/facebook/yoga/YogaProps.kt +205 -0
  157. package/yoga/java/com/facebook/yoga/YogaStyleInputs.kt +51 -0
  158. package/yoga/java/com/facebook/yoga/YogaUnit.kt +37 -0
  159. package/yoga/java/com/facebook/yoga/YogaValue.kt +66 -0
  160. package/yoga/java/com/facebook/yoga/YogaWrap.kt +29 -0
  161. package/yoga/java/com/facebook/yoga/annotations/DoNotStrip.kt +19 -0
  162. package/yoga/java/gen/com/facebook/yoga/BuildConfig.java +15 -0
  163. package/yoga/java/jni/LayoutContext.cpp +34 -0
  164. package/yoga/java/jni/LayoutContext.h +29 -0
  165. package/yoga/java/jni/ScopedGlobalRef.h +140 -0
  166. package/yoga/java/jni/ScopedLocalRef.h +141 -0
  167. package/yoga/java/jni/YGJNI.h +77 -0
  168. package/yoga/java/jni/YGJNIVanilla.cpp +1178 -0
  169. package/yoga/java/jni/YGJNIVanilla.h +12 -0
  170. package/yoga/java/jni/YGJTypesVanilla.h +52 -0
  171. package/yoga/java/jni/YogaJniException.cpp +49 -0
  172. package/yoga/java/jni/YogaJniException.h +35 -0
  173. package/yoga/java/jni/common.cpp +109 -0
  174. package/yoga/java/jni/common.h +73 -0
  175. package/yoga/java/jni/corefunctions.cpp +91 -0
  176. package/yoga/java/jni/corefunctions.h +50 -0
  177. package/yoga/java/jni/macros.h +23 -0
  178. package/yoga/java/jni/tests/corefunctionsTest.cpp +247 -0
  179. package/yoga/java/jni/yogajni.cpp +18 -0
  180. package/yoga/java/proguard-rules.pro +10 -0
  181. package/yoga/java/res/values/strings.xml +12 -0
  182. package/yoga/java/tests/com/facebook/yoga/TestParametrization.kt +29 -0
  183. package/yoga/java/tests/com/facebook/yoga/YGAlignBaselineTest.kt +117 -0
  184. package/yoga/java/tests/com/facebook/yoga/YogaExceptionTest.kt +140 -0
  185. package/yoga/java/tests/com/facebook/yoga/YogaLoggerTest.kt +77 -0
  186. package/yoga/java/tests/com/facebook/yoga/YogaNodeStylePropertiesTest.kt +1020 -0
  187. package/yoga/java/tests/com/facebook/yoga/YogaNodeTest.kt +319 -0
  188. package/yoga/java/tests/com/facebook/yoga/YogaValueTest.kt +23 -0
  189. package/yoga/java/tests/com/facebook/yoga/utils/TestUtils.kt +99 -0
  190. package/yoga/java/tests/generated/com/facebook/yoga/YGAbsolutePositionTest.java +1670 -0
  191. package/yoga/java/tests/generated/com/facebook/yoga/YGAlignContentTest.java +5440 -0
  192. package/yoga/java/tests/generated/com/facebook/yoga/YGAlignItemsTest.java +2132 -0
  193. package/yoga/java/tests/generated/com/facebook/yoga/YGAlignSelfTest.java +271 -0
  194. package/yoga/java/tests/generated/com/facebook/yoga/YGAndroidNewsFeed.java +313 -0
  195. package/yoga/java/tests/generated/com/facebook/yoga/YGAspectRatioTest.java +73 -0
  196. package/yoga/java/tests/generated/com/facebook/yoga/YGAutoTest.java +326 -0
  197. package/yoga/java/tests/generated/com/facebook/yoga/YGBorderTest.java +222 -0
  198. package/yoga/java/tests/generated/com/facebook/yoga/YGBoxSizingTest.java +2165 -0
  199. package/yoga/java/tests/generated/com/facebook/yoga/YGDimensionTest.java +122 -0
  200. package/yoga/java/tests/generated/com/facebook/yoga/YGDisplayContentsTest.java +107 -0
  201. package/yoga/java/tests/generated/com/facebook/yoga/YGDisplayTest.java +1021 -0
  202. package/yoga/java/tests/generated/com/facebook/yoga/YGFlexBasisFitContentTest.java +391 -0
  203. package/yoga/java/tests/generated/com/facebook/yoga/YGFlexDirectionTest.java +4118 -0
  204. package/yoga/java/tests/generated/com/facebook/yoga/YGFlexTest.java +630 -0
  205. package/yoga/java/tests/generated/com/facebook/yoga/YGFlexWrapTest.java +1863 -0
  206. package/yoga/java/tests/generated/com/facebook/yoga/YGGapTest.java +2988 -0
  207. package/yoga/java/tests/generated/com/facebook/yoga/YGIntrinsicSizeTest.java +926 -0
  208. package/yoga/java/tests/generated/com/facebook/yoga/YGJustifyContentTest.java +1865 -0
  209. package/yoga/java/tests/generated/com/facebook/yoga/YGMarginTest.java +1796 -0
  210. package/yoga/java/tests/generated/com/facebook/yoga/YGMinMaxDimensionTest.java +1210 -0
  211. package/yoga/java/tests/generated/com/facebook/yoga/YGPaddingTest.java +307 -0
  212. package/yoga/java/tests/generated/com/facebook/yoga/YGPercentageTest.java +1345 -0
  213. package/yoga/java/tests/generated/com/facebook/yoga/YGRoundingTest.java +1099 -0
  214. package/yoga/java/tests/generated/com/facebook/yoga/YGSizeOverflowTest.java +195 -0
  215. package/yoga/java/tests/generated/com/facebook/yoga/YGStaticPositionTest.java +5992 -0
  216. package/yoga/java/yogajni.version +13 -0
  217. package/yoga/javascript/CMakeLists.txt +59 -0
  218. package/yoga/javascript/README.md +27 -0
  219. package/yoga/javascript/babel.config.cjs +30 -0
  220. package/yoga/javascript/jest.config.js +14 -0
  221. package/yoga/javascript/jest.setup.js +12 -0
  222. package/yoga/javascript/just.config.cjs +258 -0
  223. package/yoga/javascript/package.json +52 -0
  224. package/yoga/javascript/src/generated/YGEnums.ts +249 -0
  225. package/yoga/javascript/src/index.ts +23 -0
  226. package/yoga/javascript/src/load.ts +25 -0
  227. package/yoga/javascript/src/wasm_bridge.c +155 -0
  228. package/yoga/javascript/src/wrapAssembly.ts +1025 -0
  229. package/yoga/javascript/tests/Benchmarks/YGBenchmark.test.ts +110 -0
  230. package/yoga/javascript/tests/YGAlignBaselineTest.test.ts +104 -0
  231. package/yoga/javascript/tests/YGComputedBorderTest.test.ts +25 -0
  232. package/yoga/javascript/tests/YGComputedMarginTest.test.ts +25 -0
  233. package/yoga/javascript/tests/YGComputedPaddingTest.test.ts +25 -0
  234. package/yoga/javascript/tests/YGDirtiedTest.test.ts +149 -0
  235. package/yoga/javascript/tests/YGErrataTest.test.ts +34 -0
  236. package/yoga/javascript/tests/YGFlexBasisAuto.test.ts +21 -0
  237. package/yoga/javascript/tests/YGHadOverflowTest.test.ts +110 -0
  238. package/yoga/javascript/tests/YGHasNewLayout.test.ts +81 -0
  239. package/yoga/javascript/tests/YGMeasureCacheTest.test.ts +29 -0
  240. package/yoga/javascript/tests/YGMeasureTest.test.ts +66 -0
  241. package/yoga/javascript/tests/bin/run-bench.ts +60 -0
  242. package/yoga/javascript/tests/generated/YGAbsolutePositionTest.test.ts +1531 -0
  243. package/yoga/javascript/tests/generated/YGAlignContentTest.test.ts +5181 -0
  244. package/yoga/javascript/tests/generated/YGAlignItemsTest.test.ts +2013 -0
  245. package/yoga/javascript/tests/generated/YGAlignSelfTest.test.ts +248 -0
  246. package/yoga/javascript/tests/generated/YGAndroidNewsFeed.test.ts +306 -0
  247. package/yoga/javascript/tests/generated/YGAspectRatioTest.test.ts +66 -0
  248. package/yoga/javascript/tests/generated/YGAutoTest.test.ts +303 -0
  249. package/yoga/javascript/tests/generated/YGBorderTest.test.ts +199 -0
  250. package/yoga/javascript/tests/generated/YGBoxSizingTest.test.ts +1978 -0
  251. package/yoga/javascript/tests/generated/YGDimensionTest.test.ts +111 -0
  252. package/yoga/javascript/tests/generated/YGDisplayContentsTest.test.ts +99 -0
  253. package/yoga/javascript/tests/generated/YGDisplayTest.test.ts +962 -0
  254. package/yoga/javascript/tests/generated/YGFlexBasisFitContentTest.test.ts +364 -0
  255. package/yoga/javascript/tests/generated/YGFlexDirectionTest.test.ts +3903 -0
  256. package/yoga/javascript/tests/generated/YGFlexTest.test.ts +587 -0
  257. package/yoga/javascript/tests/generated/YGFlexWrapTest.test.ts +1768 -0
  258. package/yoga/javascript/tests/generated/YGGapTest.test.ts +2857 -0
  259. package/yoga/javascript/tests/generated/YGIntrinsicSizeTest.test.ts +843 -0
  260. package/yoga/javascript/tests/generated/YGJustifyContentTest.test.ts +1750 -0
  261. package/yoga/javascript/tests/generated/YGMarginTest.test.ts +1657 -0
  262. package/yoga/javascript/tests/generated/YGMinMaxDimensionTest.test.ts +1111 -0
  263. package/yoga/javascript/tests/generated/YGPaddingTest.test.ts +276 -0
  264. package/yoga/javascript/tests/generated/YGPercentageTest.test.ts +1246 -0
  265. package/yoga/javascript/tests/generated/YGRoundingTest.test.ts +1044 -0
  266. package/yoga/javascript/tests/generated/YGSizeOverflowTest.test.ts +180 -0
  267. package/yoga/javascript/tests/generated/YGStaticPositionTest.test.ts +5741 -0
  268. package/yoga/javascript/tests/tools/MeasureCounter.ts +66 -0
  269. package/yoga/javascript/tests/tools/globals.ts +19 -0
  270. package/yoga/javascript/tests/tools/utils.ts +90 -0
  271. package/yoga/javascript/tsconfig.json +23 -0
  272. package/yoga/lib/jni/jni.h +13 -0
  273. package/yoga/lib/jni/real/jni.h +1141 -0
  274. package/yoga/lib/jsr-305/jsr305.jar +0 -0
  275. package/yoga/lib/nlohmann/json.hpp +24766 -0
  276. package/yoga/lib/soloader/soloader-0.5.1.aar +0 -0
  277. package/yoga/package.json +44 -0
  278. package/yoga/scripts/clang-format +52 -0
  279. package/yoga/scripts/clang-format.js +93 -0
  280. package/yoga/scripts/format-kotlin.js +88 -0
  281. package/yoga/scripts/format-python.js +150 -0
  282. package/yoga/scripts/format-utils.js +82 -0
  283. package/yoga/set-version.py +37 -0
  284. package/yoga/settings.gradle.kts +29 -0
  285. package/yoga/test/AssertFatalTest.cpp +70 -0
  286. package/yoga/tests/.clang-tidy +7 -0
  287. package/yoga/tests/CMakeLists.txt +35 -0
  288. package/yoga/tests/CacheTest.cpp +229 -0
  289. package/yoga/tests/EventPublisherTest.cpp +162 -0
  290. package/yoga/tests/EventsTest.cpp +362 -0
  291. package/yoga/tests/FlexGapTest.cpp +93 -0
  292. package/yoga/tests/FloatOptionalTest.cpp +214 -0
  293. package/yoga/tests/GridStyleTest.cpp +103 -0
  294. package/yoga/tests/OrdinalsTest.cpp +35 -0
  295. package/yoga/tests/SmallValueBufferTest.cpp +161 -0
  296. package/yoga/tests/StyleTest.cpp +48 -0
  297. package/yoga/tests/StyleValuePoolTest.cpp +146 -0
  298. package/yoga/tests/YGAlignBaselineTest.cpp +837 -0
  299. package/yoga/tests/YGAspectRatioTest.cpp +898 -0
  300. package/yoga/tests/YGAutoMinSizeTest.cpp +581 -0
  301. package/yoga/tests/YGBaselineFuncTest.cpp +62 -0
  302. package/yoga/tests/YGCloneNodeTest.cpp +131 -0
  303. package/yoga/tests/YGComputedMarginTest.cpp +117 -0
  304. package/yoga/tests/YGComputedPaddingTest.cpp +119 -0
  305. package/yoga/tests/YGConfigTest.cpp +239 -0
  306. package/yoga/tests/YGContentsNodeHasNewLayoutTest.cpp +190 -0
  307. package/yoga/tests/YGDefaultValuesTest.cpp +175 -0
  308. package/yoga/tests/YGDirtiedTest.cpp +110 -0
  309. package/yoga/tests/YGDirtyMarkingTest.cpp +341 -0
  310. package/yoga/tests/YGEdgeTest.cpp +161 -0
  311. package/yoga/tests/YGFirstChildMinWidthTest.cpp +133 -0
  312. package/yoga/tests/YGFlexBasisFitContentTest.cpp +241 -0
  313. package/yoga/tests/YGFlexShrinkBorderBugTest.cpp +48 -0
  314. package/yoga/tests/YGHadOverflowTest.cpp +135 -0
  315. package/yoga/tests/YGLayoutableChildrenTest.cpp +191 -0
  316. package/yoga/tests/YGMeasureCacheTest.cpp +178 -0
  317. package/yoga/tests/YGMeasureModeTest.cpp +332 -0
  318. package/yoga/tests/YGMeasureTest.cpp +1010 -0
  319. package/yoga/tests/YGNodeCallbackTest.cpp +80 -0
  320. package/yoga/tests/YGNodeChildTest.cpp +68 -0
  321. package/yoga/tests/YGPersistenceTest.cpp +291 -0
  322. package/yoga/tests/YGPersistentNodeCloningTest.cpp +214 -0
  323. package/yoga/tests/YGRelayoutTest.cpp +255 -0
  324. package/yoga/tests/YGRoundingFunctionTest.cpp +186 -0
  325. package/yoga/tests/YGRoundingMeasureFuncTest.cpp +139 -0
  326. package/yoga/tests/YGScaleChangeTest.cpp +176 -0
  327. package/yoga/tests/YGStyleTest.cpp +75 -0
  328. package/yoga/tests/YGTreeMutationTest.cpp +115 -0
  329. package/yoga/tests/YGValueTest.cpp +23 -0
  330. package/yoga/tests/YGZeroOutLayoutRecursivelyTest.cpp +37 -0
  331. package/yoga/tests/generated/YGAbsolutePositionTest.cpp +1685 -0
  332. package/yoga/tests/generated/YGAlignContentTest.cpp +5485 -0
  333. package/yoga/tests/generated/YGAlignItemsTest.cpp +2142 -0
  334. package/yoga/tests/generated/YGAlignSelfTest.cpp +257 -0
  335. package/yoga/tests/generated/YGAndroidNewsFeed.cpp +295 -0
  336. package/yoga/tests/generated/YGAspectRatioTest.cpp +55 -0
  337. package/yoga/tests/generated/YGAutoTest.cpp +312 -0
  338. package/yoga/tests/generated/YGBorderTest.cpp +208 -0
  339. package/yoga/tests/generated/YGBoxSizingTest.cpp +2192 -0
  340. package/yoga/tests/generated/YGDimensionTest.cpp +105 -0
  341. package/yoga/tests/generated/YGDisplayContentsTest.cpp +89 -0
  342. package/yoga/tests/generated/YGDisplayTest.cpp +1016 -0
  343. package/yoga/tests/generated/YGFlexBasisFitContentTest.cpp +378 -0
  344. package/yoga/tests/generated/YGFlexDirectionTest.cpp +4152 -0
  345. package/yoga/tests/generated/YGFlexTest.cpp +621 -0
  346. package/yoga/tests/generated/YGFlexWrapTest.cpp +1867 -0
  347. package/yoga/tests/generated/YGGapTest.cpp +3001 -0
  348. package/yoga/tests/generated/YGIntrinsicSizeTest.cpp +924 -0
  349. package/yoga/tests/generated/YGJustifyContentTest.cpp +1874 -0
  350. package/yoga/tests/generated/YGMarginTest.cpp +1811 -0
  351. package/yoga/tests/generated/YGMinMaxDimensionTest.cpp +1215 -0
  352. package/yoga/tests/generated/YGPaddingTest.cpp +295 -0
  353. package/yoga/tests/generated/YGPercentageTest.cpp +1350 -0
  354. package/yoga/tests/generated/YGRoundingTest.cpp +1093 -0
  355. package/yoga/tests/generated/YGSizeOverflowTest.cpp +179 -0
  356. package/yoga/tests/generated/YGStaticPositionTest.cpp +6035 -0
  357. package/yoga/tests/util/TestUtil.cpp +164 -0
  358. package/yoga/tests/util/TestUtil.h +43 -0
  359. package/yoga/unit_tests +25 -0
  360. package/yoga/unit_tests.bat +28 -0
  361. package/yoga/website/.eslintrc.cjs +26 -0
  362. package/yoga/website/README.md +41 -0
  363. package/yoga/website/babel.config.cjs +10 -0
  364. package/yoga/website/blog/2023-06-30-announcing-yoga-2.0.md +183 -0
  365. package/yoga/website/blog/2024-06-24-announcing-yoga-3.1.md +67 -0
  366. package/yoga/website/blog/2024-12-02-announcing-yoga-3.2.md +84 -0
  367. package/yoga/website/blog/authors.yml +10 -0
  368. package/yoga/website/blog/yoga-3-release/2024-03-14-announcing-yoga-3.0.md +586 -0
  369. package/yoga/website/blog/yoga-3-release/img/image1.png +0 -0
  370. package/yoga/website/blog/yoga-3-release/img/image10.png +0 -0
  371. package/yoga/website/blog/yoga-3-release/img/image11.png +0 -0
  372. package/yoga/website/blog/yoga-3-release/img/image12.png +0 -0
  373. package/yoga/website/blog/yoga-3-release/img/image13.png +0 -0
  374. package/yoga/website/blog/yoga-3-release/img/image14.png +0 -0
  375. package/yoga/website/blog/yoga-3-release/img/image15.png +0 -0
  376. package/yoga/website/blog/yoga-3-release/img/image16.png +0 -0
  377. package/yoga/website/blog/yoga-3-release/img/image17.png +0 -0
  378. package/yoga/website/blog/yoga-3-release/img/image2.png +0 -0
  379. package/yoga/website/blog/yoga-3-release/img/image3.png +0 -0
  380. package/yoga/website/blog/yoga-3-release/img/image4.png +0 -0
  381. package/yoga/website/blog/yoga-3-release/img/image5.png +0 -0
  382. package/yoga/website/blog/yoga-3-release/img/image6.png +0 -0
  383. package/yoga/website/blog/yoga-3-release/img/image7.png +0 -0
  384. package/yoga/website/blog/yoga-3-release/img/image8.png +0 -0
  385. package/yoga/website/blog/yoga-3-release/img/image9.png +0 -0
  386. package/yoga/website/docs/about-yoga.md +13 -0
  387. package/yoga/website/docs/advanced/_category_.json +4 -0
  388. package/yoga/website/docs/advanced/containing-block.md +89 -0
  389. package/yoga/website/docs/advanced/external-layout-systems.mdx +106 -0
  390. package/yoga/website/docs/advanced/incremental-layout.mdx +87 -0
  391. package/yoga/website/docs/getting-started/_category_.json +4 -0
  392. package/yoga/website/docs/getting-started/configuring-yoga.mdx +165 -0
  393. package/yoga/website/docs/getting-started/laying-out-a-tree.mdx +178 -0
  394. package/yoga/website/docs/img/config-contextual.svg +17 -0
  395. package/yoga/website/docs/img/config-per-node.svg +17 -0
  396. package/yoga/website/docs/img/config-uniform.svg +17 -0
  397. package/yoga/website/docs/img/invalidation-clean-tree.svg +17 -0
  398. package/yoga/website/docs/img/invalidation-dirtied-tree.svg +17 -0
  399. package/yoga/website/docs/img/invalidation-new-layout-tree.svg +17 -0
  400. package/yoga/website/docs/img/pixel-grid-after.png +0 -0
  401. package/yoga/website/docs/img/pixel-grid-before.png +0 -0
  402. package/yoga/website/docs/img/wireframe-example.svg +105 -0
  403. package/yoga/website/docs/styling/_category_.json +4 -0
  404. package/yoga/website/docs/styling/align-content.mdx +47 -0
  405. package/yoga/website/docs/styling/align-items-self.mdx +48 -0
  406. package/yoga/website/docs/styling/aspect-ratio.mdx +27 -0
  407. package/yoga/website/docs/styling/display.mdx +25 -0
  408. package/yoga/website/docs/styling/flex-basis-grow-shrink.mdx +65 -0
  409. package/yoga/website/docs/styling/flex-direction.mdx +37 -0
  410. package/yoga/website/docs/styling/flex-wrap.mdx +33 -0
  411. package/yoga/website/docs/styling/gap.mdx +49 -0
  412. package/yoga/website/docs/styling/index.md +48 -0
  413. package/yoga/website/docs/styling/insets.mdx +62 -0
  414. package/yoga/website/docs/styling/justify-content.mdx +43 -0
  415. package/yoga/website/docs/styling/layout-direction.mdx +34 -0
  416. package/yoga/website/docs/styling/margin-padding-border.mdx +41 -0
  417. package/yoga/website/docs/styling/min-max-width-height.mdx +52 -0
  418. package/yoga/website/docs/styling/position.mdx +37 -0
  419. package/yoga/website/docs/styling/width-height.mdx +37 -0
  420. package/yoga/website/docusaurus.config.js +113 -0
  421. package/yoga/website/package.json +43 -0
  422. package/yoga/website/sidebars.cjs +27 -0
  423. package/yoga/website/src/components/EditorToolbar.module.css +77 -0
  424. package/yoga/website/src/components/EditorToolbar.tsx +72 -0
  425. package/yoga/website/src/components/FlexStyle.ts +439 -0
  426. package/yoga/website/src/components/LayoutBox.module.css +68 -0
  427. package/yoga/website/src/components/LayoutBox.tsx +61 -0
  428. package/yoga/website/src/components/Playground.module.css +130 -0
  429. package/yoga/website/src/components/Playground.tsx +187 -0
  430. package/yoga/website/src/components/YogaViewer.tsx +128 -0
  431. package/yoga/website/src/css/custom.css +37 -0
  432. package/yoga/website/src/pages/index.module.css +34 -0
  433. package/yoga/website/src/pages/index.tsx +84 -0
  434. package/yoga/website/src/pages/markdown-page.md +7 -0
  435. package/yoga/website/src/pages/playground.module.css +11 -0
  436. package/yoga/website/src/pages/playground.tsx +56 -0
  437. package/yoga/website/static/.nojekyll +0 -0
  438. package/yoga/website/static/img/docusaurus.png +0 -0
  439. package/yoga/website/static/img/favicon.svg +17 -0
  440. package/yoga/website/static/img/link.svg +4 -0
  441. package/yoga/website/static/img/logo.svg +17 -0
  442. package/yoga/website/static/img/meta_oss.svg +1 -0
  443. package/yoga/website/static/img/opengraph.png +0 -0
  444. package/yoga/website/static/img/undraw_docusaurus_mountain.svg +171 -0
  445. package/yoga/website/static/img/undraw_docusaurus_react.svg +170 -0
  446. package/yoga/website/static/img/undraw_docusaurus_tree.svg +40 -0
  447. package/yoga/website/tsconfig.json +10 -0
  448. package/yoga/yarn.lock +11499 -0
  449. package/yoga/yoga/CMakeLists.txt +41 -0
  450. package/yoga/yoga/YGConfig.cpp +92 -0
  451. package/yoga/yoga/YGConfig.h +158 -0
  452. package/yoga/yoga/YGEnums.cpp +304 -0
  453. package/yoga/yoga/YGEnums.h +163 -0
  454. package/yoga/yoga/YGMacros.h +101 -0
  455. package/yoga/yoga/YGNode.cpp +407 -0
  456. package/yoga/yoga/YGNode.h +373 -0
  457. package/yoga/yoga/YGNodeLayout.cpp +100 -0
  458. package/yoga/yoga/YGNodeLayout.h +43 -0
  459. package/yoga/yoga/YGNodeStyle.cpp +774 -0
  460. package/yoga/yoga/YGNodeStyle.h +243 -0
  461. package/yoga/yoga/YGPixelGrid.cpp +22 -0
  462. package/yoga/yoga/YGPixelGrid.h +29 -0
  463. package/yoga/yoga/YGValue.cpp +20 -0
  464. package/yoga/yoga/YGValue.h +83 -0
  465. package/yoga/yoga/Yoga.h +21 -0
  466. package/yoga/yoga/algorithm/AbsoluteLayout.cpp +595 -0
  467. package/yoga/yoga/algorithm/AbsoluteLayout.h +41 -0
  468. package/yoga/yoga/algorithm/Align.h +83 -0
  469. package/yoga/yoga/algorithm/Baseline.cpp +78 -0
  470. package/yoga/yoga/algorithm/Baseline.h +21 -0
  471. package/yoga/yoga/algorithm/BoundAxis.h +79 -0
  472. package/yoga/yoga/algorithm/Cache.cpp +121 -0
  473. package/yoga/yoga/algorithm/Cache.h +30 -0
  474. package/yoga/yoga/algorithm/CalculateLayout.cpp +2968 -0
  475. package/yoga/yoga/algorithm/CalculateLayout.h +60 -0
  476. package/yoga/yoga/algorithm/FlexDirection.h +120 -0
  477. package/yoga/yoga/algorithm/FlexLine.cpp +124 -0
  478. package/yoga/yoga/algorithm/FlexLine.h +75 -0
  479. package/yoga/yoga/algorithm/PixelGrid.cpp +138 -0
  480. package/yoga/yoga/algorithm/PixelGrid.h +29 -0
  481. package/yoga/yoga/algorithm/SizingMode.h +73 -0
  482. package/yoga/yoga/algorithm/TrailingPosition.h +44 -0
  483. package/yoga/yoga/config/Config.cpp +135 -0
  484. package/yoga/yoga/config/Config.h +93 -0
  485. package/yoga/yoga/debug/AssertFatal.cpp +54 -0
  486. package/yoga/yoga/debug/AssertFatal.h +29 -0
  487. package/yoga/yoga/debug/Log.cpp +107 -0
  488. package/yoga/yoga/debug/Log.h +34 -0
  489. package/yoga/yoga/enums/Align.h +49 -0
  490. package/yoga/yoga/enums/BoxSizing.h +40 -0
  491. package/yoga/yoga/enums/Dimension.h +40 -0
  492. package/yoga/yoga/enums/Direction.h +41 -0
  493. package/yoga/yoga/enums/Display.h +42 -0
  494. package/yoga/yoga/enums/Edge.h +47 -0
  495. package/yoga/yoga/enums/Errata.h +43 -0
  496. package/yoga/yoga/enums/ExperimentalFeature.h +40 -0
  497. package/yoga/yoga/enums/FlexDirection.h +42 -0
  498. package/yoga/yoga/enums/GridTrackType.h +43 -0
  499. package/yoga/yoga/enums/Gutter.h +41 -0
  500. package/yoga/yoga/enums/Justify.h +48 -0
  501. package/yoga/yoga/enums/LogLevel.h +44 -0
  502. package/yoga/yoga/enums/MeasureMode.h +41 -0
  503. package/yoga/yoga/enums/NodeType.h +40 -0
  504. package/yoga/yoga/enums/Overflow.h +41 -0
  505. package/yoga/yoga/enums/PhysicalEdge.h +21 -0
  506. package/yoga/yoga/enums/PositionType.h +41 -0
  507. package/yoga/yoga/enums/Unit.h +45 -0
  508. package/yoga/yoga/enums/Wrap.h +41 -0
  509. package/yoga/yoga/enums/YogaEnums.h +84 -0
  510. package/yoga/yoga/event/event.cpp +89 -0
  511. package/yoga/yoga/event/event.h +131 -0
  512. package/yoga/yoga/module.modulemap +21 -0
  513. package/yoga/yoga/node/CachedMeasurement.h +53 -0
  514. package/yoga/yoga/node/LayoutResults.cpp +48 -0
  515. package/yoga/yoga/node/LayoutResults.h +136 -0
  516. package/yoga/yoga/node/LayoutableChildren.h +148 -0
  517. package/yoga/yoga/node/Node.cpp +509 -0
  518. package/yoga/yoga/node/Node.h +372 -0
  519. package/yoga/yoga/numeric/Comparison.h +81 -0
  520. package/yoga/yoga/numeric/FloatOptional.h +84 -0
  521. package/yoga/yoga/style/GridLine.h +53 -0
  522. package/yoga/yoga/style/GridStyle.h +80 -0
  523. package/yoga/yoga/style/GridTrack.h +63 -0
  524. package/yoga/yoga/style/SmallValueBuffer.h +133 -0
  525. package/yoga/yoga/style/Style.h +932 -0
  526. package/yoga/yoga/style/StyleLength.h +121 -0
  527. package/yoga/yoga/style/StyleSizeLength.h +152 -0
  528. package/yoga/yoga/style/StyleValueHandle.h +114 -0
  529. package/yoga/yoga/style/StyleValuePool.h +194 -0
@@ -0,0 +1,1021 @@
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
+ * @generated SignedSource<<b328c922a3229d52d3cbe8932627dc62>>
8
+ * generated by gentest/src/GentestDriver.ts from gentest/fixtures/YGDisplayTest.html
9
+ */
10
+
11
+ package com.facebook.yoga;
12
+
13
+ import static org.junit.Assert.assertEquals;
14
+
15
+ import org.junit.Ignore;
16
+ import org.junit.Test;
17
+ import org.junit.runner.RunWith;
18
+ import org.junit.runners.Parameterized;
19
+ import com.facebook.yoga.utils.TestUtils;
20
+
21
+ @RunWith(Parameterized.class)
22
+ public class YGDisplayTest {
23
+ @Parameterized.Parameters(name = "{0}")
24
+ public static Iterable<TestParametrization.NodeFactory> nodeFactories() {
25
+ return TestParametrization.nodeFactories();
26
+ }
27
+
28
+ @Parameterized.Parameter public TestParametrization.NodeFactory mNodeFactory;
29
+
30
+ @Test
31
+ public void test_display_none() {
32
+ YogaConfig config = YogaConfigFactory.create();
33
+
34
+ final YogaNode root = createNode(config);
35
+ root.setPositionType(YogaPositionType.ABSOLUTE);
36
+ root.setWidth(100f);
37
+ root.setHeight(100f);
38
+ root.setFlexDirection(YogaFlexDirection.ROW);
39
+
40
+ final YogaNode root_child0 = createNode(config);
41
+ root_child0.setFlexGrow(1f);
42
+ root.addChildAt(root_child0, 0);
43
+
44
+ final YogaNode root_child1 = createNode(config);
45
+ root_child1.setFlexGrow(1f);
46
+ root_child1.setDisplay(YogaDisplay.NONE);
47
+ root.addChildAt(root_child1, 1);
48
+ root.setDirection(YogaDirection.LTR);
49
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
50
+
51
+ assertEquals(0f, root.getLayoutX(), 0.0f);
52
+ assertEquals(0f, root.getLayoutY(), 0.0f);
53
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
54
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
55
+
56
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
57
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
58
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
59
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
60
+
61
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
62
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
63
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
64
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
65
+
66
+ root.setDirection(YogaDirection.RTL);
67
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
68
+
69
+ assertEquals(0f, root.getLayoutX(), 0.0f);
70
+ assertEquals(0f, root.getLayoutY(), 0.0f);
71
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
72
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
73
+
74
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
75
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
76
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
77
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
78
+
79
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
80
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
81
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
82
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
83
+ }
84
+
85
+ @Test
86
+ public void test_display_none_fixed_size() {
87
+ YogaConfig config = YogaConfigFactory.create();
88
+
89
+ final YogaNode root = createNode(config);
90
+ root.setPositionType(YogaPositionType.ABSOLUTE);
91
+ root.setWidth(100f);
92
+ root.setHeight(100f);
93
+ root.setFlexDirection(YogaFlexDirection.ROW);
94
+
95
+ final YogaNode root_child0 = createNode(config);
96
+ root_child0.setFlexGrow(1f);
97
+ root.addChildAt(root_child0, 0);
98
+
99
+ final YogaNode root_child1 = createNode(config);
100
+ root_child1.setWidth(20f);
101
+ root_child1.setHeight(20f);
102
+ root_child1.setDisplay(YogaDisplay.NONE);
103
+ root.addChildAt(root_child1, 1);
104
+ root.setDirection(YogaDirection.LTR);
105
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
106
+
107
+ assertEquals(0f, root.getLayoutX(), 0.0f);
108
+ assertEquals(0f, root.getLayoutY(), 0.0f);
109
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
110
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
111
+
112
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
113
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
114
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
115
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
116
+
117
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
118
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
119
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
120
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
121
+
122
+ root.setDirection(YogaDirection.RTL);
123
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
124
+
125
+ assertEquals(0f, root.getLayoutX(), 0.0f);
126
+ assertEquals(0f, root.getLayoutY(), 0.0f);
127
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
128
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
129
+
130
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
131
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
132
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
133
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
134
+
135
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
136
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
137
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
138
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
139
+ }
140
+
141
+ @Test
142
+ public void test_display_none_with_margin() {
143
+ YogaConfig config = YogaConfigFactory.create();
144
+
145
+ final YogaNode root = createNode(config);
146
+ root.setPositionType(YogaPositionType.ABSOLUTE);
147
+ root.setWidth(100f);
148
+ root.setHeight(100f);
149
+ root.setFlexDirection(YogaFlexDirection.ROW);
150
+
151
+ final YogaNode root_child0 = createNode(config);
152
+ root_child0.setWidth(20f);
153
+ root_child0.setHeight(20f);
154
+ root_child0.setDisplay(YogaDisplay.NONE);
155
+ root_child0.setMargin(YogaEdge.ALL, 10f);
156
+ root.addChildAt(root_child0, 0);
157
+
158
+ final YogaNode root_child1 = createNode(config);
159
+ root_child1.setFlexGrow(1f);
160
+ root.addChildAt(root_child1, 1);
161
+ root.setDirection(YogaDirection.LTR);
162
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
163
+
164
+ assertEquals(0f, root.getLayoutX(), 0.0f);
165
+ assertEquals(0f, root.getLayoutY(), 0.0f);
166
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
167
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
168
+
169
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
170
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
171
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
172
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
173
+
174
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
175
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
176
+ assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
177
+ assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
178
+
179
+ root.setDirection(YogaDirection.RTL);
180
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
181
+
182
+ assertEquals(0f, root.getLayoutX(), 0.0f);
183
+ assertEquals(0f, root.getLayoutY(), 0.0f);
184
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
185
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
186
+
187
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
188
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
189
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
190
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
191
+
192
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
193
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
194
+ assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
195
+ assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
196
+ }
197
+
198
+ @Test
199
+ public void test_display_none_with_child() {
200
+ YogaConfig config = YogaConfigFactory.create();
201
+
202
+ final YogaNode root = createNode(config);
203
+ root.setPositionType(YogaPositionType.ABSOLUTE);
204
+ root.setWidth(100f);
205
+ root.setHeight(100f);
206
+ root.setFlexDirection(YogaFlexDirection.ROW);
207
+
208
+ final YogaNode root_child0 = createNode(config);
209
+ root_child0.setFlexGrow(1f);
210
+ root_child0.setFlexShrink(1f);
211
+ root_child0.setFlexBasisPercent(0f);
212
+ root.addChildAt(root_child0, 0);
213
+
214
+ final YogaNode root_child1 = createNode(config);
215
+ root_child1.setFlexGrow(1f);
216
+ root_child1.setFlexShrink(1f);
217
+ root_child1.setFlexBasisPercent(0f);
218
+ root_child1.setDisplay(YogaDisplay.NONE);
219
+ root.addChildAt(root_child1, 1);
220
+
221
+ final YogaNode root_child1_child0 = createNode(config);
222
+ root_child1_child0.setFlexGrow(1f);
223
+ root_child1_child0.setFlexShrink(1f);
224
+ root_child1_child0.setFlexBasisPercent(0f);
225
+ root_child1_child0.setWidth(20f);
226
+ root_child1.addChildAt(root_child1_child0, 0);
227
+
228
+ final YogaNode root_child2 = createNode(config);
229
+ root_child2.setFlexGrow(1f);
230
+ root_child2.setFlexShrink(1f);
231
+ root_child2.setFlexBasisPercent(0f);
232
+ root.addChildAt(root_child2, 2);
233
+ root.setDirection(YogaDirection.LTR);
234
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
235
+
236
+ assertEquals(0f, root.getLayoutX(), 0.0f);
237
+ assertEquals(0f, root.getLayoutY(), 0.0f);
238
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
239
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
240
+
241
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
242
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
243
+ assertEquals(50f, root_child0.getLayoutWidth(), 0.0f);
244
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
245
+
246
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
247
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
248
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
249
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
250
+
251
+ assertEquals(0f, root_child1_child0.getLayoutX(), 0.0f);
252
+ assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f);
253
+ assertEquals(0f, root_child1_child0.getLayoutWidth(), 0.0f);
254
+ assertEquals(0f, root_child1_child0.getLayoutHeight(), 0.0f);
255
+
256
+ assertEquals(50f, root_child2.getLayoutX(), 0.0f);
257
+ assertEquals(0f, root_child2.getLayoutY(), 0.0f);
258
+ assertEquals(50f, root_child2.getLayoutWidth(), 0.0f);
259
+ assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
260
+
261
+ root.setDirection(YogaDirection.RTL);
262
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
263
+
264
+ assertEquals(0f, root.getLayoutX(), 0.0f);
265
+ assertEquals(0f, root.getLayoutY(), 0.0f);
266
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
267
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
268
+
269
+ assertEquals(50f, root_child0.getLayoutX(), 0.0f);
270
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
271
+ assertEquals(50f, root_child0.getLayoutWidth(), 0.0f);
272
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
273
+
274
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
275
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
276
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
277
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
278
+
279
+ assertEquals(0f, root_child1_child0.getLayoutX(), 0.0f);
280
+ assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f);
281
+ assertEquals(0f, root_child1_child0.getLayoutWidth(), 0.0f);
282
+ assertEquals(0f, root_child1_child0.getLayoutHeight(), 0.0f);
283
+
284
+ assertEquals(0f, root_child2.getLayoutX(), 0.0f);
285
+ assertEquals(0f, root_child2.getLayoutY(), 0.0f);
286
+ assertEquals(50f, root_child2.getLayoutWidth(), 0.0f);
287
+ assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
288
+ }
289
+
290
+ @Test
291
+ public void test_display_none_with_position() {
292
+ YogaConfig config = YogaConfigFactory.create();
293
+
294
+ final YogaNode root = createNode(config);
295
+ root.setPositionType(YogaPositionType.ABSOLUTE);
296
+ root.setWidth(100f);
297
+ root.setHeight(100f);
298
+ root.setFlexDirection(YogaFlexDirection.ROW);
299
+
300
+ final YogaNode root_child0 = createNode(config);
301
+ root_child0.setFlexGrow(1f);
302
+ root.addChildAt(root_child0, 0);
303
+
304
+ final YogaNode root_child1 = createNode(config);
305
+ root_child1.setFlexGrow(1f);
306
+ root_child1.setDisplay(YogaDisplay.NONE);
307
+ root_child1.setPosition(YogaEdge.TOP, 10f);
308
+ root.addChildAt(root_child1, 1);
309
+ root.setDirection(YogaDirection.LTR);
310
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
311
+
312
+ assertEquals(0f, root.getLayoutX(), 0.0f);
313
+ assertEquals(0f, root.getLayoutY(), 0.0f);
314
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
315
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
316
+
317
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
318
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
319
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
320
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
321
+
322
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
323
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
324
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
325
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
326
+
327
+ root.setDirection(YogaDirection.RTL);
328
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
329
+
330
+ assertEquals(0f, root.getLayoutX(), 0.0f);
331
+ assertEquals(0f, root.getLayoutY(), 0.0f);
332
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
333
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
334
+
335
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
336
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
337
+ assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
338
+ assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
339
+
340
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
341
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
342
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
343
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
344
+ }
345
+
346
+ @Test
347
+ public void test_display_none_with_position_absolute() {
348
+ YogaConfig config = YogaConfigFactory.create();
349
+
350
+ final YogaNode root = createNode(config);
351
+ root.setPositionType(YogaPositionType.ABSOLUTE);
352
+ root.setWidth(100f);
353
+ root.setHeight(100f);
354
+
355
+ final YogaNode root_child0 = createNode(config);
356
+ root_child0.setDisplay(YogaDisplay.NONE);
357
+ root_child0.setPositionType(YogaPositionType.ABSOLUTE);
358
+ root_child0.setWidth(100f);
359
+ root_child0.setHeight(100f);
360
+ root.addChildAt(root_child0, 0);
361
+ root.setDirection(YogaDirection.LTR);
362
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
363
+
364
+ assertEquals(0f, root.getLayoutX(), 0.0f);
365
+ assertEquals(0f, root.getLayoutY(), 0.0f);
366
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
367
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
368
+
369
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
370
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
371
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
372
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
373
+
374
+ root.setDirection(YogaDirection.RTL);
375
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
376
+
377
+ assertEquals(0f, root.getLayoutX(), 0.0f);
378
+ assertEquals(0f, root.getLayoutY(), 0.0f);
379
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
380
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
381
+
382
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
383
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
384
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
385
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
386
+ }
387
+
388
+ @Test
389
+ public void test_display_contents() {
390
+ YogaConfig config = YogaConfigFactory.create();
391
+
392
+ final YogaNode root = createNode(config);
393
+ root.setPositionType(YogaPositionType.ABSOLUTE);
394
+ root.setWidth(100f);
395
+ root.setHeight(100f);
396
+ root.setFlexDirection(YogaFlexDirection.ROW);
397
+
398
+ final YogaNode root_child0 = createNode(config);
399
+ root_child0.setDisplay(YogaDisplay.CONTENTS);
400
+ root.addChildAt(root_child0, 0);
401
+
402
+ final YogaNode root_child0_child0 = createNode(config);
403
+ root_child0_child0.setFlexGrow(1f);
404
+ root_child0_child0.setFlexShrink(1f);
405
+ root_child0_child0.setFlexBasisPercent(0f);
406
+ root_child0_child0.setHeight(10f);
407
+ root_child0.addChildAt(root_child0_child0, 0);
408
+
409
+ final YogaNode root_child0_child1 = createNode(config);
410
+ root_child0_child1.setFlexGrow(1f);
411
+ root_child0_child1.setFlexShrink(1f);
412
+ root_child0_child1.setFlexBasisPercent(0f);
413
+ root_child0_child1.setHeight(20f);
414
+ root_child0.addChildAt(root_child0_child1, 1);
415
+ root.setDirection(YogaDirection.LTR);
416
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
417
+
418
+ assertEquals(0f, root.getLayoutX(), 0.0f);
419
+ assertEquals(0f, root.getLayoutY(), 0.0f);
420
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
421
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
422
+
423
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
424
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
425
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
426
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
427
+
428
+ assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
429
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
430
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
431
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
432
+
433
+ assertEquals(50f, root_child0_child1.getLayoutX(), 0.0f);
434
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
435
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
436
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
437
+
438
+ root.setDirection(YogaDirection.RTL);
439
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
440
+
441
+ assertEquals(0f, root.getLayoutX(), 0.0f);
442
+ assertEquals(0f, root.getLayoutY(), 0.0f);
443
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
444
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
445
+
446
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
447
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
448
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
449
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
450
+
451
+ assertEquals(50f, root_child0_child0.getLayoutX(), 0.0f);
452
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
453
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
454
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
455
+
456
+ assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
457
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
458
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
459
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
460
+ }
461
+
462
+ @Test
463
+ public void test_display_contents_fixed_size() {
464
+ YogaConfig config = YogaConfigFactory.create();
465
+
466
+ final YogaNode root = createNode(config);
467
+ root.setPositionType(YogaPositionType.ABSOLUTE);
468
+ root.setWidth(100f);
469
+ root.setHeight(100f);
470
+ root.setFlexDirection(YogaFlexDirection.ROW);
471
+
472
+ final YogaNode root_child0 = createNode(config);
473
+ root_child0.setDisplay(YogaDisplay.CONTENTS);
474
+ root_child0.setWidth(50f);
475
+ root_child0.setHeight(50f);
476
+ root.addChildAt(root_child0, 0);
477
+
478
+ final YogaNode root_child0_child0 = createNode(config);
479
+ root_child0_child0.setFlexGrow(1f);
480
+ root_child0_child0.setFlexShrink(1f);
481
+ root_child0_child0.setFlexBasisPercent(0f);
482
+ root_child0_child0.setHeight(10f);
483
+ root_child0.addChildAt(root_child0_child0, 0);
484
+
485
+ final YogaNode root_child0_child1 = createNode(config);
486
+ root_child0_child1.setFlexGrow(1f);
487
+ root_child0_child1.setFlexShrink(1f);
488
+ root_child0_child1.setFlexBasisPercent(0f);
489
+ root_child0_child1.setHeight(20f);
490
+ root_child0.addChildAt(root_child0_child1, 1);
491
+ root.setDirection(YogaDirection.LTR);
492
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
493
+
494
+ assertEquals(0f, root.getLayoutX(), 0.0f);
495
+ assertEquals(0f, root.getLayoutY(), 0.0f);
496
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
497
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
498
+
499
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
500
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
501
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
502
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
503
+
504
+ assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
505
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
506
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
507
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
508
+
509
+ assertEquals(50f, root_child0_child1.getLayoutX(), 0.0f);
510
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
511
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
512
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
513
+
514
+ root.setDirection(YogaDirection.RTL);
515
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
516
+
517
+ assertEquals(0f, root.getLayoutX(), 0.0f);
518
+ assertEquals(0f, root.getLayoutY(), 0.0f);
519
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
520
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
521
+
522
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
523
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
524
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
525
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
526
+
527
+ assertEquals(50f, root_child0_child0.getLayoutX(), 0.0f);
528
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
529
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
530
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
531
+
532
+ assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
533
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
534
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
535
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
536
+ }
537
+
538
+ @Test
539
+ public void test_display_contents_with_margin() {
540
+ YogaConfig config = YogaConfigFactory.create();
541
+
542
+ final YogaNode root = createNode(config);
543
+ root.setPositionType(YogaPositionType.ABSOLUTE);
544
+ root.setWidth(100f);
545
+ root.setHeight(100f);
546
+ root.setFlexDirection(YogaFlexDirection.ROW);
547
+
548
+ final YogaNode root_child0 = createNode(config);
549
+ root_child0.setWidth(20f);
550
+ root_child0.setHeight(20f);
551
+ root_child0.setDisplay(YogaDisplay.CONTENTS);
552
+ root_child0.setMargin(YogaEdge.ALL, 10f);
553
+ root.addChildAt(root_child0, 0);
554
+
555
+ final YogaNode root_child1 = createNode(config);
556
+ root_child1.setFlexGrow(1f);
557
+ root.addChildAt(root_child1, 1);
558
+ root.setDirection(YogaDirection.LTR);
559
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
560
+
561
+ assertEquals(0f, root.getLayoutX(), 0.0f);
562
+ assertEquals(0f, root.getLayoutY(), 0.0f);
563
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
564
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
565
+
566
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
567
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
568
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
569
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
570
+
571
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
572
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
573
+ assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
574
+ assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
575
+
576
+ root.setDirection(YogaDirection.RTL);
577
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
578
+
579
+ assertEquals(0f, root.getLayoutX(), 0.0f);
580
+ assertEquals(0f, root.getLayoutY(), 0.0f);
581
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
582
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
583
+
584
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
585
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
586
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
587
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
588
+
589
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
590
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
591
+ assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
592
+ assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
593
+ }
594
+
595
+ @Test
596
+ public void test_display_contents_with_padding() {
597
+ YogaConfig config = YogaConfigFactory.create();
598
+
599
+ final YogaNode root = createNode(config);
600
+ root.setPositionType(YogaPositionType.ABSOLUTE);
601
+ root.setWidth(100f);
602
+ root.setHeight(100f);
603
+ root.setFlexDirection(YogaFlexDirection.ROW);
604
+
605
+ final YogaNode root_child0 = createNode(config);
606
+ root_child0.setDisplay(YogaDisplay.CONTENTS);
607
+ root_child0.setPadding(YogaEdge.ALL, 10);
608
+ root.addChildAt(root_child0, 0);
609
+
610
+ final YogaNode root_child0_child0 = createNode(config);
611
+ root_child0_child0.setFlexGrow(1f);
612
+ root_child0_child0.setFlexShrink(1f);
613
+ root_child0_child0.setFlexBasisPercent(0f);
614
+ root_child0_child0.setHeight(10f);
615
+ root_child0.addChildAt(root_child0_child0, 0);
616
+
617
+ final YogaNode root_child0_child1 = createNode(config);
618
+ root_child0_child1.setFlexGrow(1f);
619
+ root_child0_child1.setFlexShrink(1f);
620
+ root_child0_child1.setFlexBasisPercent(0f);
621
+ root_child0_child1.setHeight(20f);
622
+ root_child0.addChildAt(root_child0_child1, 1);
623
+ root.setDirection(YogaDirection.LTR);
624
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
625
+
626
+ assertEquals(0f, root.getLayoutX(), 0.0f);
627
+ assertEquals(0f, root.getLayoutY(), 0.0f);
628
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
629
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
630
+
631
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
632
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
633
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
634
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
635
+
636
+ assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
637
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
638
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
639
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
640
+
641
+ assertEquals(50f, root_child0_child1.getLayoutX(), 0.0f);
642
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
643
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
644
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
645
+
646
+ root.setDirection(YogaDirection.RTL);
647
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
648
+
649
+ assertEquals(0f, root.getLayoutX(), 0.0f);
650
+ assertEquals(0f, root.getLayoutY(), 0.0f);
651
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
652
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
653
+
654
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
655
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
656
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
657
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
658
+
659
+ assertEquals(50f, root_child0_child0.getLayoutX(), 0.0f);
660
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
661
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
662
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
663
+
664
+ assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
665
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
666
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
667
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
668
+ }
669
+
670
+ @Test
671
+ public void test_display_contents_with_position() {
672
+ YogaConfig config = YogaConfigFactory.create();
673
+
674
+ final YogaNode root = createNode(config);
675
+ root.setPositionType(YogaPositionType.ABSOLUTE);
676
+ root.setWidth(100f);
677
+ root.setHeight(100f);
678
+ root.setFlexDirection(YogaFlexDirection.ROW);
679
+
680
+ final YogaNode root_child0 = createNode(config);
681
+ root_child0.setDisplay(YogaDisplay.CONTENTS);
682
+ root_child0.setPosition(YogaEdge.TOP, 10f);
683
+ root.addChildAt(root_child0, 0);
684
+
685
+ final YogaNode root_child0_child0 = createNode(config);
686
+ root_child0_child0.setFlexGrow(1f);
687
+ root_child0_child0.setFlexShrink(1f);
688
+ root_child0_child0.setFlexBasisPercent(0f);
689
+ root_child0_child0.setHeight(10f);
690
+ root_child0.addChildAt(root_child0_child0, 0);
691
+
692
+ final YogaNode root_child0_child1 = createNode(config);
693
+ root_child0_child1.setFlexGrow(1f);
694
+ root_child0_child1.setFlexShrink(1f);
695
+ root_child0_child1.setFlexBasisPercent(0f);
696
+ root_child0_child1.setHeight(20f);
697
+ root_child0.addChildAt(root_child0_child1, 1);
698
+ root.setDirection(YogaDirection.LTR);
699
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
700
+
701
+ assertEquals(0f, root.getLayoutX(), 0.0f);
702
+ assertEquals(0f, root.getLayoutY(), 0.0f);
703
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
704
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
705
+
706
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
707
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
708
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
709
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
710
+
711
+ assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
712
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
713
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
714
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
715
+
716
+ assertEquals(50f, root_child0_child1.getLayoutX(), 0.0f);
717
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
718
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
719
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
720
+
721
+ root.setDirection(YogaDirection.RTL);
722
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
723
+
724
+ assertEquals(0f, root.getLayoutX(), 0.0f);
725
+ assertEquals(0f, root.getLayoutY(), 0.0f);
726
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
727
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
728
+
729
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
730
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
731
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
732
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
733
+
734
+ assertEquals(50f, root_child0_child0.getLayoutX(), 0.0f);
735
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
736
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
737
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
738
+
739
+ assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
740
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
741
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
742
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
743
+ }
744
+
745
+ @Test
746
+ public void test_display_contents_with_position_absolute() {
747
+ YogaConfig config = YogaConfigFactory.create();
748
+
749
+ final YogaNode root = createNode(config);
750
+ root.setPositionType(YogaPositionType.ABSOLUTE);
751
+ root.setWidth(100f);
752
+ root.setHeight(100f);
753
+ root.setFlexDirection(YogaFlexDirection.ROW);
754
+
755
+ final YogaNode root_child0 = createNode(config);
756
+ root_child0.setDisplay(YogaDisplay.CONTENTS);
757
+ root_child0.setPositionType(YogaPositionType.ABSOLUTE);
758
+ root_child0.setWidth(50f);
759
+ root_child0.setHeight(50f);
760
+ root.addChildAt(root_child0, 0);
761
+
762
+ final YogaNode root_child0_child0 = createNode(config);
763
+ root_child0_child0.setFlexGrow(1f);
764
+ root_child0_child0.setFlexShrink(1f);
765
+ root_child0_child0.setFlexBasisPercent(0f);
766
+ root_child0_child0.setHeight(10f);
767
+ root_child0.addChildAt(root_child0_child0, 0);
768
+
769
+ final YogaNode root_child0_child1 = createNode(config);
770
+ root_child0_child1.setFlexGrow(1f);
771
+ root_child0_child1.setFlexShrink(1f);
772
+ root_child0_child1.setFlexBasisPercent(0f);
773
+ root_child0_child1.setHeight(20f);
774
+ root_child0.addChildAt(root_child0_child1, 1);
775
+ root.setDirection(YogaDirection.LTR);
776
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
777
+
778
+ assertEquals(0f, root.getLayoutX(), 0.0f);
779
+ assertEquals(0f, root.getLayoutY(), 0.0f);
780
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
781
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
782
+
783
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
784
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
785
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
786
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
787
+
788
+ assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
789
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
790
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
791
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
792
+
793
+ assertEquals(50f, root_child0_child1.getLayoutX(), 0.0f);
794
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
795
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
796
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
797
+
798
+ root.setDirection(YogaDirection.RTL);
799
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
800
+
801
+ assertEquals(0f, root.getLayoutX(), 0.0f);
802
+ assertEquals(0f, root.getLayoutY(), 0.0f);
803
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
804
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
805
+
806
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
807
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
808
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
809
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
810
+
811
+ assertEquals(50f, root_child0_child0.getLayoutX(), 0.0f);
812
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
813
+ assertEquals(50f, root_child0_child0.getLayoutWidth(), 0.0f);
814
+ assertEquals(10f, root_child0_child0.getLayoutHeight(), 0.0f);
815
+
816
+ assertEquals(0f, root_child0_child1.getLayoutX(), 0.0f);
817
+ assertEquals(0f, root_child0_child1.getLayoutY(), 0.0f);
818
+ assertEquals(50f, root_child0_child1.getLayoutWidth(), 0.0f);
819
+ assertEquals(20f, root_child0_child1.getLayoutHeight(), 0.0f);
820
+ }
821
+
822
+ @Test
823
+ public void test_display_contents_nested() {
824
+ YogaConfig config = YogaConfigFactory.create();
825
+
826
+ final YogaNode root = createNode(config);
827
+ root.setPositionType(YogaPositionType.ABSOLUTE);
828
+ root.setWidth(100f);
829
+ root.setHeight(100f);
830
+ root.setFlexDirection(YogaFlexDirection.ROW);
831
+
832
+ final YogaNode root_child0 = createNode(config);
833
+ root_child0.setDisplay(YogaDisplay.CONTENTS);
834
+ root.addChildAt(root_child0, 0);
835
+
836
+ final YogaNode root_child0_child0 = createNode(config);
837
+ root_child0_child0.setDisplay(YogaDisplay.CONTENTS);
838
+ root_child0.addChildAt(root_child0_child0, 0);
839
+
840
+ final YogaNode root_child0_child0_child0 = createNode(config);
841
+ root_child0_child0_child0.setFlexGrow(1f);
842
+ root_child0_child0_child0.setFlexShrink(1f);
843
+ root_child0_child0_child0.setFlexBasisPercent(0f);
844
+ root_child0_child0_child0.setHeight(10f);
845
+ root_child0_child0.addChildAt(root_child0_child0_child0, 0);
846
+
847
+ final YogaNode root_child0_child0_child1 = createNode(config);
848
+ root_child0_child0_child1.setFlexGrow(1f);
849
+ root_child0_child0_child1.setFlexShrink(1f);
850
+ root_child0_child0_child1.setFlexBasisPercent(0f);
851
+ root_child0_child0_child1.setHeight(20f);
852
+ root_child0_child0.addChildAt(root_child0_child0_child1, 1);
853
+ root.setDirection(YogaDirection.LTR);
854
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
855
+
856
+ assertEquals(0f, root.getLayoutX(), 0.0f);
857
+ assertEquals(0f, root.getLayoutY(), 0.0f);
858
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
859
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
860
+
861
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
862
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
863
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
864
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
865
+
866
+ assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
867
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
868
+ assertEquals(0f, root_child0_child0.getLayoutWidth(), 0.0f);
869
+ assertEquals(0f, root_child0_child0.getLayoutHeight(), 0.0f);
870
+
871
+ assertEquals(0f, root_child0_child0_child0.getLayoutX(), 0.0f);
872
+ assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
873
+ assertEquals(50f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
874
+ assertEquals(10f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
875
+
876
+ assertEquals(50f, root_child0_child0_child1.getLayoutX(), 0.0f);
877
+ assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
878
+ assertEquals(50f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
879
+ assertEquals(20f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
880
+
881
+ root.setDirection(YogaDirection.RTL);
882
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
883
+
884
+ assertEquals(0f, root.getLayoutX(), 0.0f);
885
+ assertEquals(0f, root.getLayoutY(), 0.0f);
886
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
887
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
888
+
889
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
890
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
891
+ assertEquals(0f, root_child0.getLayoutWidth(), 0.0f);
892
+ assertEquals(0f, root_child0.getLayoutHeight(), 0.0f);
893
+
894
+ assertEquals(0f, root_child0_child0.getLayoutX(), 0.0f);
895
+ assertEquals(0f, root_child0_child0.getLayoutY(), 0.0f);
896
+ assertEquals(0f, root_child0_child0.getLayoutWidth(), 0.0f);
897
+ assertEquals(0f, root_child0_child0.getLayoutHeight(), 0.0f);
898
+
899
+ assertEquals(50f, root_child0_child0_child0.getLayoutX(), 0.0f);
900
+ assertEquals(0f, root_child0_child0_child0.getLayoutY(), 0.0f);
901
+ assertEquals(50f, root_child0_child0_child0.getLayoutWidth(), 0.0f);
902
+ assertEquals(10f, root_child0_child0_child0.getLayoutHeight(), 0.0f);
903
+
904
+ assertEquals(0f, root_child0_child0_child1.getLayoutX(), 0.0f);
905
+ assertEquals(0f, root_child0_child0_child1.getLayoutY(), 0.0f);
906
+ assertEquals(50f, root_child0_child0_child1.getLayoutWidth(), 0.0f);
907
+ assertEquals(20f, root_child0_child0_child1.getLayoutHeight(), 0.0f);
908
+ }
909
+
910
+ @Test
911
+ public void test_display_contents_with_siblings() {
912
+ YogaConfig config = YogaConfigFactory.create();
913
+
914
+ final YogaNode root = createNode(config);
915
+ root.setPositionType(YogaPositionType.ABSOLUTE);
916
+ root.setWidth(100f);
917
+ root.setHeight(100f);
918
+ root.setFlexDirection(YogaFlexDirection.ROW);
919
+
920
+ final YogaNode root_child0 = createNode(config);
921
+ root_child0.setFlexGrow(1f);
922
+ root_child0.setFlexShrink(1f);
923
+ root_child0.setFlexBasisPercent(0f);
924
+ root_child0.setHeight(30f);
925
+ root.addChildAt(root_child0, 0);
926
+
927
+ final YogaNode root_child1 = createNode(config);
928
+ root_child1.setDisplay(YogaDisplay.CONTENTS);
929
+ root.addChildAt(root_child1, 1);
930
+
931
+ final YogaNode root_child1_child0 = createNode(config);
932
+ root_child1_child0.setFlexGrow(1f);
933
+ root_child1_child0.setFlexShrink(1f);
934
+ root_child1_child0.setFlexBasisPercent(0f);
935
+ root_child1_child0.setHeight(10f);
936
+ root_child1.addChildAt(root_child1_child0, 0);
937
+
938
+ final YogaNode root_child1_child1 = createNode(config);
939
+ root_child1_child1.setFlexGrow(1f);
940
+ root_child1_child1.setFlexShrink(1f);
941
+ root_child1_child1.setFlexBasisPercent(0f);
942
+ root_child1_child1.setHeight(20f);
943
+ root_child1.addChildAt(root_child1_child1, 1);
944
+
945
+ final YogaNode root_child2 = createNode(config);
946
+ root_child2.setFlexGrow(1f);
947
+ root_child2.setFlexShrink(1f);
948
+ root_child2.setFlexBasisPercent(0f);
949
+ root_child2.setHeight(30f);
950
+ root.addChildAt(root_child2, 2);
951
+ root.setDirection(YogaDirection.LTR);
952
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
953
+
954
+ assertEquals(0f, root.getLayoutX(), 0.0f);
955
+ assertEquals(0f, root.getLayoutY(), 0.0f);
956
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
957
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
958
+
959
+ assertEquals(0f, root_child0.getLayoutX(), 0.0f);
960
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
961
+ assertEquals(25f, root_child0.getLayoutWidth(), 0.0f);
962
+ assertEquals(30f, root_child0.getLayoutHeight(), 0.0f);
963
+
964
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
965
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
966
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
967
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
968
+
969
+ assertEquals(25f, root_child1_child0.getLayoutX(), 0.0f);
970
+ assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f);
971
+ assertEquals(25f, root_child1_child0.getLayoutWidth(), 0.0f);
972
+ assertEquals(10f, root_child1_child0.getLayoutHeight(), 0.0f);
973
+
974
+ assertEquals(50f, root_child1_child1.getLayoutX(), 0.0f);
975
+ assertEquals(0f, root_child1_child1.getLayoutY(), 0.0f);
976
+ assertEquals(25f, root_child1_child1.getLayoutWidth(), 0.0f);
977
+ assertEquals(20f, root_child1_child1.getLayoutHeight(), 0.0f);
978
+
979
+ assertEquals(75f, root_child2.getLayoutX(), 0.0f);
980
+ assertEquals(0f, root_child2.getLayoutY(), 0.0f);
981
+ assertEquals(25f, root_child2.getLayoutWidth(), 0.0f);
982
+ assertEquals(30f, root_child2.getLayoutHeight(), 0.0f);
983
+
984
+ root.setDirection(YogaDirection.RTL);
985
+ root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
986
+
987
+ assertEquals(0f, root.getLayoutX(), 0.0f);
988
+ assertEquals(0f, root.getLayoutY(), 0.0f);
989
+ assertEquals(100f, root.getLayoutWidth(), 0.0f);
990
+ assertEquals(100f, root.getLayoutHeight(), 0.0f);
991
+
992
+ assertEquals(75f, root_child0.getLayoutX(), 0.0f);
993
+ assertEquals(0f, root_child0.getLayoutY(), 0.0f);
994
+ assertEquals(25f, root_child0.getLayoutWidth(), 0.0f);
995
+ assertEquals(30f, root_child0.getLayoutHeight(), 0.0f);
996
+
997
+ assertEquals(0f, root_child1.getLayoutX(), 0.0f);
998
+ assertEquals(0f, root_child1.getLayoutY(), 0.0f);
999
+ assertEquals(0f, root_child1.getLayoutWidth(), 0.0f);
1000
+ assertEquals(0f, root_child1.getLayoutHeight(), 0.0f);
1001
+
1002
+ assertEquals(50f, root_child1_child0.getLayoutX(), 0.0f);
1003
+ assertEquals(0f, root_child1_child0.getLayoutY(), 0.0f);
1004
+ assertEquals(25f, root_child1_child0.getLayoutWidth(), 0.0f);
1005
+ assertEquals(10f, root_child1_child0.getLayoutHeight(), 0.0f);
1006
+
1007
+ assertEquals(25f, root_child1_child1.getLayoutX(), 0.0f);
1008
+ assertEquals(0f, root_child1_child1.getLayoutY(), 0.0f);
1009
+ assertEquals(25f, root_child1_child1.getLayoutWidth(), 0.0f);
1010
+ assertEquals(20f, root_child1_child1.getLayoutHeight(), 0.0f);
1011
+
1012
+ assertEquals(0f, root_child2.getLayoutX(), 0.0f);
1013
+ assertEquals(0f, root_child2.getLayoutY(), 0.0f);
1014
+ assertEquals(25f, root_child2.getLayoutWidth(), 0.0f);
1015
+ assertEquals(30f, root_child2.getLayoutHeight(), 0.0f);
1016
+ }
1017
+
1018
+ private YogaNode createNode(YogaConfig config) {
1019
+ return mNodeFactory.create(config);
1020
+ }
1021
+ }