@xincli/opentui-core 0.4.6 → 0.4.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 (619) hide show
  1. package/LICENSE +21 -0
  2. package/NativeSpanFeed.d.ts +52 -0
  3. package/README.md +0 -0
  4. package/Renderable.d.ts +346 -0
  5. package/animation/Timeline.d.ts +126 -0
  6. package/ansi.d.ts +17 -0
  7. package/audio.d.ts +89 -0
  8. package/buffer.d.ts +113 -0
  9. package/console.d.ts +146 -0
  10. package/edit-buffer.d.ts +97 -0
  11. package/editor-view.d.ts +72 -0
  12. package/index-m1y9e40w.js +10045 -0
  13. package/index-m1y9e40w.js.map +32 -0
  14. package/index-sqk4ajdf.js +16121 -0
  15. package/index-sqk4ajdf.js.map +58 -0
  16. package/index.d.ts +24 -0
  17. package/index.js +11709 -0
  18. package/index.js.map +35 -0
  19. package/lib/KeyHandler.d.ts +61 -0
  20. package/lib/RGBA.d.ts +42 -0
  21. package/lib/ascii.font.d.ts +508 -0
  22. package/lib/border.d.ts +51 -0
  23. package/lib/bunfs.d.ts +7 -0
  24. package/lib/clipboard.d.ts +15 -0
  25. package/lib/clock.d.ts +15 -0
  26. package/lib/data-paths.d.ts +26 -0
  27. package/lib/debounce.d.ts +42 -0
  28. package/lib/detect-links.d.ts +6 -0
  29. package/lib/env.d.ts +42 -0
  30. package/lib/extmarks-history.d.ts +17 -0
  31. package/lib/extmarks.d.ts +90 -0
  32. package/lib/hast-styled-text.d.ts +17 -0
  33. package/lib/index.d.ts +22 -0
  34. package/lib/keybinding.internal.d.ts +33 -0
  35. package/lib/objects-in-viewport.d.ts +24 -0
  36. package/lib/output.capture.d.ts +24 -0
  37. package/lib/parse.keypress-kitty.d.ts +3 -0
  38. package/lib/parse.keypress.d.ts +27 -0
  39. package/lib/parse.mouse.d.ts +30 -0
  40. package/lib/paste.d.ts +7 -0
  41. package/lib/queue.d.ts +15 -0
  42. package/lib/render-geometry.d.ts +8 -0
  43. package/lib/renderable.validations.d.ts +12 -0
  44. package/lib/scroll-acceleration.d.ts +43 -0
  45. package/lib/selection.d.ts +64 -0
  46. package/lib/singleton.d.ts +8 -0
  47. package/lib/stdin-parser.d.ts +90 -0
  48. package/lib/styled-text.d.ts +63 -0
  49. package/lib/terminal-capability-detection.d.ts +32 -0
  50. package/lib/terminal-palette.d.ts +65 -0
  51. package/lib/tree-sitter/assets/update.d.ts +12 -0
  52. package/lib/tree-sitter/client.d.ts +65 -0
  53. package/lib/tree-sitter/default-parsers.d.ts +2 -0
  54. package/lib/tree-sitter/download-utils.d.ts +21 -0
  55. package/lib/tree-sitter/index.d.ts +7 -0
  56. package/lib/tree-sitter/parser.worker.d.ts +1 -0
  57. package/lib/tree-sitter/parsers-config.d.ts +53 -0
  58. package/lib/tree-sitter/resolve-ft.d.ts +5 -0
  59. package/lib/tree-sitter/types.d.ts +185 -0
  60. package/lib/tree-sitter/update-assets.d.ts +3 -0
  61. package/lib/tree-sitter/update-assets.js +379 -0
  62. package/lib/tree-sitter/update-assets.js.map +12 -0
  63. package/lib/tree-sitter-styled-text.d.ts +16 -0
  64. package/lib/validate-dir-name.d.ts +1 -0
  65. package/lib/yoga.options.d.ts +32 -0
  66. package/native-event-worker-repro.worker.d.ts +1 -0
  67. package/package.json +52 -74
  68. package/parser.worker.js +1399 -0
  69. package/parser.worker.js.map +20 -0
  70. package/platform/ffi.d.ts +129 -0
  71. package/platform/runtime.d.ts +14 -0
  72. package/platform/test.d.ts +12 -0
  73. package/platform/worker.d.ts +26 -0
  74. package/platform/worker.node-test.d.ts +1 -0
  75. package/plugins/core-slot.d.ts +72 -0
  76. package/plugins/registry.d.ts +42 -0
  77. package/plugins/types.d.ts +34 -0
  78. package/post/effects.d.ts +147 -0
  79. package/post/filters.d.ts +65 -0
  80. package/post/matrices.d.ts +20 -0
  81. package/renderables/ASCIIFont.d.ts +52 -0
  82. package/renderables/Box.d.ts +85 -0
  83. package/renderables/Code.d.ts +97 -0
  84. package/renderables/Diff.d.ts +147 -0
  85. package/renderables/EditBufferRenderable.d.ts +238 -0
  86. package/renderables/FrameBuffer.d.ts +16 -0
  87. package/renderables/Input.d.ts +72 -0
  88. package/renderables/LineNumberRenderable.d.ts +78 -0
  89. package/renderables/Markdown.d.ts +255 -0
  90. package/renderables/ScrollBar.d.ts +77 -0
  91. package/renderables/ScrollBox.d.ts +128 -0
  92. package/renderables/Select.d.ts +122 -0
  93. package/renderables/Slider.d.ts +47 -0
  94. package/renderables/TabSelect.d.ts +98 -0
  95. package/renderables/Text.d.ts +36 -0
  96. package/renderables/TextBufferRenderable.d.ts +107 -0
  97. package/renderables/TextNode.d.ts +92 -0
  98. package/renderables/TextTable.d.ts +154 -0
  99. package/renderables/Textarea.d.ts +65 -0
  100. package/renderables/TimeToFirstDraw.d.ts +24 -0
  101. package/renderables/__tests__/renderable-test-utils.d.ts +12 -0
  102. package/renderables/composition/VRenderable.d.ts +16 -0
  103. package/renderables/composition/constructs.d.ts +35 -0
  104. package/renderables/composition/vnode.d.ts +46 -0
  105. package/renderables/index.d.ts +23 -0
  106. package/renderables/markdown-parser.d.ts +11 -0
  107. package/renderer-theme-mode.d.ts +29 -0
  108. package/renderer.d.ts +601 -0
  109. package/runtime-plugin-support-configure.d.ts +4 -0
  110. package/runtime-plugin-support-configure.js +36 -0
  111. package/runtime-plugin-support-configure.js.map +1 -0
  112. package/runtime-plugin-support-configure.node.js +15 -0
  113. package/runtime-plugin-support.d.ts +3 -0
  114. package/runtime-plugin-support.js +5 -0
  115. package/runtime-plugin-support.js.map +1 -0
  116. package/runtime-plugin-support.node.js +15 -0
  117. package/runtime-plugin.d.ts +16 -0
  118. package/runtime-plugin.js +473 -0
  119. package/runtime-plugin.js.map +1 -0
  120. package/runtime-plugin.node.js +15 -0
  121. package/syntax-style.d.ts +61 -0
  122. package/testing/bun-test-node.d.ts +87 -0
  123. package/testing/manual-clock.d.ts +17 -0
  124. package/testing/mock-keys.d.ts +81 -0
  125. package/testing/mock-mouse.d.ts +38 -0
  126. package/testing/mock-tree-sitter-client.d.ts +27 -0
  127. package/testing/spy.d.ts +7 -0
  128. package/testing/terminal-capabilities.d.ts +7 -0
  129. package/testing/test-recorder.d.ts +61 -0
  130. package/testing/test-renderer.d.ts +54 -0
  131. package/testing/test-streams.d.ts +12 -0
  132. package/testing.d.ts +8 -0
  133. package/testing.js +1004 -0
  134. package/testing.js.map +18 -0
  135. package/tests/yoga-upstream/tools/MeasureCounter.d.ts +16 -0
  136. package/tests/yoga-upstream/tools/utils.d.ts +11 -0
  137. package/text-buffer-view.d.ts +42 -0
  138. package/text-buffer.d.ts +66 -0
  139. package/types.d.ts +175 -0
  140. package/utils.d.ts +14 -0
  141. package/yoga.d.ts +437 -0
  142. package/yoga.js +193 -0
  143. package/yoga.js.map +9 -0
  144. package/zig-structs.d.ts +256 -0
  145. package/zig.d.ts +496 -0
  146. package/dev/keypress-debug-renderer.ts +0 -148
  147. package/dev/keypress-debug.ts +0 -43
  148. package/dev/print-env-vars.ts +0 -32
  149. package/dev/test-tmux-graphics-334.sh +0 -68
  150. package/dev/test-tmux-theme-queries.sh +0 -151
  151. package/dev/thai-debug-test.ts +0 -68
  152. package/dev/theme-mode.ts +0 -290
  153. package/docs/development.md +0 -144
  154. package/prebuilt/aarch64-android/libopentui.so +0 -0
  155. package/scripts/build-android.ts +0 -226
  156. package/scripts/build-native-termux.sh +0 -525
  157. package/scripts/build.ts +0 -530
  158. package/scripts/dist-test.ts +0 -312
  159. package/scripts/package-prebuilt.ts +0 -110
  160. package/scripts/publish.ts +0 -60
  161. package/scripts/test-node-hook.mjs +0 -16
  162. package/scripts/test-node.ts +0 -241
  163. package/scripts/vendor-deps.sh +0 -73
  164. package/src/NativeSpanFeed.ts +0 -375
  165. package/src/Renderable.ts +0 -1878
  166. package/src/__snapshots__/buffer.test.ts.snap +0 -28
  167. package/src/animation/Timeline.test.ts +0 -2709
  168. package/src/animation/Timeline.ts +0 -598
  169. package/src/ansi.ts +0 -22
  170. package/src/audio.ts +0 -479
  171. package/src/benchmark/attenuation-benchmark.ts +0 -81
  172. package/src/benchmark/audio-playback-benchmark.ts +0 -344
  173. package/src/benchmark/box-draw-benchmark.ts +0 -1042
  174. package/src/benchmark/colormatrix-benchmark.ts +0 -123
  175. package/src/benchmark/gain-benchmark.ts +0 -80
  176. package/src/benchmark/latest-all-bench-run.json +0 -707
  177. package/src/benchmark/latest-async-bench-run.json +0 -336
  178. package/src/benchmark/latest-default-bench-run.json +0 -657
  179. package/src/benchmark/latest-large-bench-run.json +0 -707
  180. package/src/benchmark/latest-quick-bench-run.json +0 -207
  181. package/src/benchmark/layout-benchmark.ts +0 -2547
  182. package/src/benchmark/markdown-benchmark.ts +0 -1796
  183. package/src/benchmark/native-span-feed-async-benchmark.ts +0 -355
  184. package/src/benchmark/native-span-feed-benchmark.md +0 -56
  185. package/src/benchmark/native-span-feed-benchmark.ts +0 -596
  186. package/src/benchmark/native-span-feed-compare.ts +0 -280
  187. package/src/benchmark/render-traversal-benchmark.ts +0 -928
  188. package/src/benchmark/text-buffer-render-benchmark.ts +0 -874
  189. package/src/benchmark/text-table-benchmark.ts +0 -948
  190. package/src/buffer.test.ts +0 -292
  191. package/src/buffer.ts +0 -564
  192. package/src/console.test.ts +0 -629
  193. package/src/console.ts +0 -1253
  194. package/src/edit-buffer.test.ts +0 -1852
  195. package/src/edit-buffer.ts +0 -417
  196. package/src/editor-view.test.ts +0 -1056
  197. package/src/editor-view.ts +0 -290
  198. package/src/index.ts +0 -25
  199. package/src/lib/KeyHandler.integration.test.ts +0 -292
  200. package/src/lib/KeyHandler.stopPropagation.test.ts +0 -289
  201. package/src/lib/KeyHandler.test.ts +0 -662
  202. package/src/lib/KeyHandler.ts +0 -222
  203. package/src/lib/RGBA.test.ts +0 -60
  204. package/src/lib/RGBA.ts +0 -343
  205. package/src/lib/ascii.font.ts +0 -330
  206. package/src/lib/border.test.ts +0 -83
  207. package/src/lib/border.ts +0 -170
  208. package/src/lib/bunfs.test.ts +0 -27
  209. package/src/lib/bunfs.ts +0 -18
  210. package/src/lib/clipboard.test.ts +0 -63
  211. package/src/lib/clipboard.ts +0 -41
  212. package/src/lib/clock.ts +0 -35
  213. package/src/lib/data-paths.test.ts +0 -133
  214. package/src/lib/data-paths.ts +0 -109
  215. package/src/lib/debounce.ts +0 -106
  216. package/src/lib/detect-links.test.ts +0 -98
  217. package/src/lib/detect-links.ts +0 -56
  218. package/src/lib/env.test.ts +0 -228
  219. package/src/lib/env.ts +0 -209
  220. package/src/lib/extmarks-history.ts +0 -51
  221. package/src/lib/extmarks-multiwidth.test.ts +0 -324
  222. package/src/lib/extmarks.test.ts +0 -3547
  223. package/src/lib/extmarks.ts +0 -861
  224. package/src/lib/fonts/block.json +0 -405
  225. package/src/lib/fonts/grid.json +0 -265
  226. package/src/lib/fonts/huge.json +0 -741
  227. package/src/lib/fonts/pallet.json +0 -314
  228. package/src/lib/fonts/shade.json +0 -591
  229. package/src/lib/fonts/slick.json +0 -321
  230. package/src/lib/fonts/tiny.json +0 -69
  231. package/src/lib/hast-styled-text.ts +0 -59
  232. package/src/lib/index.ts +0 -22
  233. package/src/lib/keybinding.internal.test.ts +0 -342
  234. package/src/lib/keybinding.internal.ts +0 -182
  235. package/src/lib/objects-in-viewport.test.ts +0 -789
  236. package/src/lib/objects-in-viewport.ts +0 -153
  237. package/src/lib/output.capture.ts +0 -58
  238. package/src/lib/parse.keypress-kitty.protocol.test.ts +0 -347
  239. package/src/lib/parse.keypress-kitty.test.ts +0 -712
  240. package/src/lib/parse.keypress-kitty.ts +0 -470
  241. package/src/lib/parse.keypress.test.ts +0 -2020
  242. package/src/lib/parse.keypress.ts +0 -480
  243. package/src/lib/parse.mouse.test.ts +0 -552
  244. package/src/lib/parse.mouse.ts +0 -232
  245. package/src/lib/paste.ts +0 -18
  246. package/src/lib/queue.ts +0 -65
  247. package/src/lib/render-geometry.ts +0 -36
  248. package/src/lib/renderable.validations.test.ts +0 -87
  249. package/src/lib/renderable.validations.ts +0 -83
  250. package/src/lib/scroll-acceleration.ts +0 -98
  251. package/src/lib/selection.ts +0 -261
  252. package/src/lib/singleton.ts +0 -34
  253. package/src/lib/stdin-parser.test.ts +0 -2439
  254. package/src/lib/stdin-parser.ts +0 -2007
  255. package/src/lib/styled-text.ts +0 -178
  256. package/src/lib/terminal-capability-detection.test.ts +0 -226
  257. package/src/lib/terminal-capability-detection.ts +0 -98
  258. package/src/lib/terminal-palette.test.ts +0 -954
  259. package/src/lib/terminal-palette.ts +0 -441
  260. package/src/lib/tree-sitter/assets/README.md +0 -119
  261. package/src/lib/tree-sitter/assets/update.ts +0 -360
  262. package/src/lib/tree-sitter/assets.d.ts +0 -9
  263. package/src/lib/tree-sitter/cache.test.ts +0 -291
  264. package/src/lib/tree-sitter/client.test.ts +0 -1434
  265. package/src/lib/tree-sitter/client.ts +0 -847
  266. package/src/lib/tree-sitter/default-parsers.ts +0 -133
  267. package/src/lib/tree-sitter/download-utils.ts +0 -148
  268. package/src/lib/tree-sitter/index.ts +0 -75
  269. package/src/lib/tree-sitter/parser.worker.ts +0 -1098
  270. package/src/lib/tree-sitter/parsers-config.ts +0 -81
  271. package/src/lib/tree-sitter/resolve-ft.test.ts +0 -55
  272. package/src/lib/tree-sitter/resolve-ft.ts +0 -189
  273. package/src/lib/tree-sitter/types.ts +0 -132
  274. package/src/lib/tree-sitter/update-assets.ts +0 -10
  275. package/src/lib/tree-sitter-styled-text.test.ts +0 -1253
  276. package/src/lib/tree-sitter-styled-text.ts +0 -314
  277. package/src/lib/validate-dir-name.ts +0 -55
  278. package/src/lib/yoga.options.test.ts +0 -628
  279. package/src/lib/yoga.options.ts +0 -346
  280. package/src/native-event-worker-repro.test.ts +0 -48
  281. package/src/native-event-worker-repro.worker.ts +0 -9
  282. package/src/native-handle.test.ts +0 -221
  283. package/src/platform/ffi.test.ts +0 -516
  284. package/src/platform/ffi.ts +0 -653
  285. package/src/platform/runtime.test.ts +0 -52
  286. package/src/platform/runtime.ts +0 -121
  287. package/src/platform/test.ts +0 -45
  288. package/src/platform/worker-handler-cleanup.fixture.ts +0 -12
  289. package/src/platform/worker-onmessage-startup.fixture.ts +0 -10
  290. package/src/platform/worker-startup.fixture.ts +0 -9
  291. package/src/platform/worker.node-test.ts +0 -153
  292. package/src/platform/worker.ts +0 -425
  293. package/src/plugins/core-slot.ts +0 -579
  294. package/src/plugins/registry.ts +0 -402
  295. package/src/plugins/types.ts +0 -46
  296. package/src/post/effects.ts +0 -948
  297. package/src/post/filters.ts +0 -512
  298. package/src/post/matrices.ts +0 -288
  299. package/src/renderables/ASCIIFont.ts +0 -219
  300. package/src/renderables/Box.test.ts +0 -474
  301. package/src/renderables/Box.ts +0 -353
  302. package/src/renderables/Code.test.ts +0 -2388
  303. package/src/renderables/Code.ts +0 -555
  304. package/src/renderables/Diff.regression.test.ts +0 -381
  305. package/src/renderables/Diff.test.ts +0 -3212
  306. package/src/renderables/Diff.ts +0 -1278
  307. package/src/renderables/EditBufferRenderable.test.ts +0 -288
  308. package/src/renderables/EditBufferRenderable.ts +0 -1152
  309. package/src/renderables/FrameBuffer.ts +0 -47
  310. package/src/renderables/Input.test.ts +0 -1310
  311. package/src/renderables/Input.ts +0 -273
  312. package/src/renderables/LineNumberRenderable.ts +0 -725
  313. package/src/renderables/Markdown.ts +0 -2144
  314. package/src/renderables/ScrollBar.ts +0 -423
  315. package/src/renderables/ScrollBox.ts +0 -903
  316. package/src/renderables/Select.test.ts +0 -1134
  317. package/src/renderables/Select.ts +0 -535
  318. package/src/renderables/Slider.test.ts +0 -456
  319. package/src/renderables/Slider.ts +0 -342
  320. package/src/renderables/TabSelect.test.ts +0 -238
  321. package/src/renderables/TabSelect.ts +0 -447
  322. package/src/renderables/Text.selection-buffer.test.ts +0 -118
  323. package/src/renderables/Text.test.ts +0 -2662
  324. package/src/renderables/Text.ts +0 -147
  325. package/src/renderables/TextBufferRenderable.ts +0 -504
  326. package/src/renderables/TextNode.test.ts +0 -1137
  327. package/src/renderables/TextNode.ts +0 -379
  328. package/src/renderables/TextTable.test.ts +0 -1411
  329. package/src/renderables/TextTable.ts +0 -1434
  330. package/src/renderables/Textarea.ts +0 -425
  331. package/src/renderables/TimeToFirstDraw.ts +0 -89
  332. package/src/renderables/__snapshots__/Code.test.ts.snap +0 -13
  333. package/src/renderables/__snapshots__/Diff.test.ts.snap +0 -785
  334. package/src/renderables/__snapshots__/Text.test.ts.snap +0 -421
  335. package/src/renderables/__snapshots__/TextTable.test.ts.snap +0 -215
  336. package/src/renderables/__tests__/Code.test.ts +0 -55
  337. package/src/renderables/__tests__/LineNumberRenderable.scrollbox-simple.test.ts +0 -144
  338. package/src/renderables/__tests__/LineNumberRenderable.scrollbox.test.ts +0 -827
  339. package/src/renderables/__tests__/LineNumberRenderable.test.ts +0 -1906
  340. package/src/renderables/__tests__/LineNumberRenderable.wrapping.test.ts +0 -85
  341. package/src/renderables/__tests__/Markdown.code-colors.test.ts +0 -288
  342. package/src/renderables/__tests__/Markdown.test.ts +0 -4175
  343. package/src/renderables/__tests__/MultiRenderable.selection.test.ts +0 -87
  344. package/src/renderables/__tests__/Textarea.buffer.test.ts +0 -683
  345. package/src/renderables/__tests__/Textarea.destroyed-events.test.ts +0 -675
  346. package/src/renderables/__tests__/Textarea.editing.test.ts +0 -2120
  347. package/src/renderables/__tests__/Textarea.error-handling.test.ts +0 -35
  348. package/src/renderables/__tests__/Textarea.events.test.ts +0 -738
  349. package/src/renderables/__tests__/Textarea.highlights.test.ts +0 -590
  350. package/src/renderables/__tests__/Textarea.keybinding.test.ts +0 -3275
  351. package/src/renderables/__tests__/Textarea.paste.test.ts +0 -357
  352. package/src/renderables/__tests__/Textarea.rendering.test.ts +0 -1927
  353. package/src/renderables/__tests__/Textarea.scroll.test.ts +0 -733
  354. package/src/renderables/__tests__/Textarea.selection.test.ts +0 -1589
  355. package/src/renderables/__tests__/Textarea.stress.test.ts +0 -670
  356. package/src/renderables/__tests__/Textarea.undo-redo.test.ts +0 -383
  357. package/src/renderables/__tests__/Textarea.visual-lines.test.ts +0 -310
  358. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.code.test.ts.snap +0 -221
  359. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.scrollbox-simple.test.ts.snap +0 -89
  360. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.scrollbox.test.ts.snap +0 -457
  361. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.test.ts.snap +0 -158
  362. package/src/renderables/__tests__/__snapshots__/Textarea.rendering.test.ts.snap +0 -387
  363. package/src/renderables/__tests__/markdown-parser.test.ts +0 -241
  364. package/src/renderables/__tests__/renderable-test-utils.ts +0 -60
  365. package/src/renderables/composition/README.md +0 -8
  366. package/src/renderables/composition/VRenderable.ts +0 -32
  367. package/src/renderables/composition/constructs.ts +0 -127
  368. package/src/renderables/composition/vnode.ts +0 -277
  369. package/src/renderables/index.ts +0 -23
  370. package/src/renderables/markdown-parser.ts +0 -79
  371. package/src/renderer-theme-mode.ts +0 -199
  372. package/src/renderer.ts +0 -4975
  373. package/src/runtime-plugin-support-configure.ts +0 -63
  374. package/src/runtime-plugin-support.ts +0 -13
  375. package/src/runtime-plugin.ts +0 -626
  376. package/src/specs/terminal-startup.md +0 -64
  377. package/src/syntax-style.test.ts +0 -841
  378. package/src/syntax-style.ts +0 -274
  379. package/src/testing/README.md +0 -219
  380. package/src/testing/bun-test-node.ts +0 -880
  381. package/src/testing/capture-spans.test.ts +0 -216
  382. package/src/testing/integration.test.ts +0 -276
  383. package/src/testing/manual-clock.ts +0 -117
  384. package/src/testing/mock-keys.test.ts +0 -1378
  385. package/src/testing/mock-keys.ts +0 -457
  386. package/src/testing/mock-mouse.test.ts +0 -218
  387. package/src/testing/mock-mouse.ts +0 -247
  388. package/src/testing/mock-tree-sitter-client.ts +0 -81
  389. package/src/testing/spy.ts +0 -13
  390. package/src/testing/terminal-capabilities.ts +0 -47
  391. package/src/testing/test-recorder.test.ts +0 -410
  392. package/src/testing/test-recorder.ts +0 -133
  393. package/src/testing/test-renderer.ts +0 -375
  394. package/src/testing/test-renderer.wait.test.ts +0 -278
  395. package/src/testing/test-streams.ts +0 -31
  396. package/src/testing.ts +0 -9
  397. package/src/tests/__snapshots__/absolute-positioning.snapshot.test.ts.snap +0 -481
  398. package/src/tests/__snapshots__/renderable.snapshot.test.ts.snap +0 -19
  399. package/src/tests/__snapshots__/scrollbox.test.ts.snap +0 -29
  400. package/src/tests/absolute-positioning.snapshot.test.ts +0 -638
  401. package/src/tests/allocator-stats.test.ts +0 -53
  402. package/src/tests/audio.test.ts +0 -303
  403. package/src/tests/destroy-during-render.test.ts +0 -200
  404. package/src/tests/destroy-on-exit.fixture.ts +0 -36
  405. package/src/tests/destroy-on-exit.test.ts +0 -62
  406. package/src/tests/ffi-borrowed-pointer-callsites.test.ts +0 -153
  407. package/src/tests/hover-cursor.test.ts +0 -98
  408. package/src/tests/native-backed-measurement-lifecycle.test.ts +0 -133
  409. package/src/tests/native-backed-measurement-parity.test.ts +0 -322
  410. package/src/tests/native-span-feed-async.test.ts +0 -173
  411. package/src/tests/native-span-feed-close.test.ts +0 -120
  412. package/src/tests/native-span-feed-coverage.test.ts +0 -227
  413. package/src/tests/native-span-feed-edge-cases.test.ts +0 -384
  414. package/src/tests/native-span-feed-use-after-free.test.ts +0 -45
  415. package/src/tests/opacity.test.ts +0 -123
  416. package/src/tests/renderable.snapshot.test.ts +0 -524
  417. package/src/tests/renderable.test.ts +0 -1851
  418. package/src/tests/renderer.clock.test.ts +0 -270
  419. package/src/tests/renderer.console-startup.test.ts +0 -2151
  420. package/src/tests/renderer.control.test.ts +0 -458
  421. package/src/tests/renderer.core-slot-binding.test.ts +0 -962
  422. package/src/tests/renderer.cursor.test.ts +0 -26
  423. package/src/tests/renderer.custom-stdout.test.ts +0 -1112
  424. package/src/tests/renderer.destroy-during-render.test.ts +0 -147
  425. package/src/tests/renderer.focus-restore.test.ts +0 -257
  426. package/src/tests/renderer.focus.test.ts +0 -329
  427. package/src/tests/renderer.idle.test.ts +0 -219
  428. package/src/tests/renderer.input.test.ts +0 -2615
  429. package/src/tests/renderer.kitty-flags.test.ts +0 -195
  430. package/src/tests/renderer.lifecycle.test.ts +0 -34
  431. package/src/tests/renderer.mouse.test.ts +0 -1315
  432. package/src/tests/renderer.notifications.test.ts +0 -27
  433. package/src/tests/renderer.palette.test.ts +0 -1199
  434. package/src/tests/renderer.remote.test.ts +0 -247
  435. package/src/tests/renderer.render-stats.test.ts +0 -146
  436. package/src/tests/renderer.scrollback-surface.test.ts +0 -474
  437. package/src/tests/renderer.selection.test.ts +0 -138
  438. package/src/tests/renderer.slot-registry.test.ts +0 -684
  439. package/src/tests/renderer.tracker.test.ts +0 -202
  440. package/src/tests/renderer.useMouse.test.ts +0 -83
  441. package/src/tests/runtime-plugin-node-modules-cycle.fixture.ts +0 -76
  442. package/src/tests/runtime-plugin-node-modules-import-like-string.fixture.ts +0 -48
  443. package/src/tests/runtime-plugin-node-modules-mjs.fixture.ts +0 -43
  444. package/src/tests/runtime-plugin-node-modules-no-bare-rewrite.fixture.ts +0 -67
  445. package/src/tests/runtime-plugin-node-modules-package-type-cache.fixture.ts +0 -72
  446. package/src/tests/runtime-plugin-node-modules-runtime-specifier.fixture.ts +0 -44
  447. package/src/tests/runtime-plugin-node-modules-scoped-package-bare-rewrite.fixture.ts +0 -85
  448. package/src/tests/runtime-plugin-path-alias.fixture.ts +0 -43
  449. package/src/tests/runtime-plugin-resolve-roots.fixture.ts +0 -65
  450. package/src/tests/runtime-plugin-support-configure.fixture.ts +0 -31
  451. package/src/tests/runtime-plugin-support-late-addition.fixture.ts +0 -17
  452. package/src/tests/runtime-plugin-support.fixture.ts +0 -11
  453. package/src/tests/runtime-plugin-support.test.ts +0 -54
  454. package/src/tests/runtime-plugin-windows-file-url.fixture.ts +0 -30
  455. package/src/tests/runtime-plugin.fixture.ts +0 -40
  456. package/src/tests/runtime-plugin.test.ts +0 -369
  457. package/src/tests/scrollbox-culling-bug.test.ts +0 -114
  458. package/src/tests/scrollbox-hitgrid-resize.test.ts +0 -136
  459. package/src/tests/scrollbox-hitgrid.test.ts +0 -909
  460. package/src/tests/scrollbox.test.ts +0 -1895
  461. package/src/tests/wrap-resize-perf.test.ts +0 -276
  462. package/src/tests/yoga-api-coverage.test.ts +0 -409
  463. package/src/tests/yoga-callback-stress.test.ts +0 -122
  464. package/src/tests/yoga-ffi.test.ts +0 -117
  465. package/src/tests/yoga-setters.test.ts +0 -921
  466. package/src/tests/yoga-upstream/YGAlignBaselineTest.test.ts +0 -124
  467. package/src/tests/yoga-upstream/YGComputedBorderTest.test.ts +0 -27
  468. package/src/tests/yoga-upstream/YGComputedMarginTest.test.ts +0 -27
  469. package/src/tests/yoga-upstream/YGComputedPaddingTest.test.ts +0 -27
  470. package/src/tests/yoga-upstream/YGDirtiedTest.test.ts +0 -157
  471. package/src/tests/yoga-upstream/YGErrataTest.test.ts +0 -40
  472. package/src/tests/yoga-upstream/YGFlexBasisAuto.test.ts +0 -23
  473. package/src/tests/yoga-upstream/YGHasNewLayout.test.ts +0 -81
  474. package/src/tests/yoga-upstream/YGMeasureCacheTest.test.ts +0 -31
  475. package/src/tests/yoga-upstream/YGMeasureTest.test.ts +0 -70
  476. package/src/tests/yoga-upstream/generated/YGAbsolutePositionTest.test.ts +0 -1864
  477. package/src/tests/yoga-upstream/generated/YGAlignContentTest.test.ts +0 -5829
  478. package/src/tests/yoga-upstream/generated/YGAlignItemsTest.test.ts +0 -2444
  479. package/src/tests/yoga-upstream/generated/YGAlignSelfTest.test.ts +0 -293
  480. package/src/tests/yoga-upstream/generated/YGAndroidNewsFeed.test.ts +0 -315
  481. package/src/tests/yoga-upstream/generated/YGAspectRatioTest.test.ts +0 -231
  482. package/src/tests/yoga-upstream/generated/YGAutoTest.test.ts +0 -347
  483. package/src/tests/yoga-upstream/generated/YGBorderTest.test.ts +0 -256
  484. package/src/tests/yoga-upstream/generated/YGBoxSizingTest.test.ts +0 -2747
  485. package/src/tests/yoga-upstream/generated/YGDimensionTest.test.ts +0 -129
  486. package/src/tests/yoga-upstream/generated/YGDisplayContentsTest.test.ts +0 -109
  487. package/src/tests/yoga-upstream/generated/YGDisplayTest.test.ts +0 -1097
  488. package/src/tests/yoga-upstream/generated/YGFlexDirectionTest.test.ts +0 -4562
  489. package/src/tests/yoga-upstream/generated/YGFlexTest.test.ts +0 -677
  490. package/src/tests/yoga-upstream/generated/YGFlexWrapTest.test.ts +0 -2071
  491. package/src/tests/yoga-upstream/generated/YGGapTest.test.ts +0 -3303
  492. package/src/tests/yoga-upstream/generated/YGIntrinsicSizeTest.test.ts +0 -582
  493. package/src/tests/yoga-upstream/generated/YGJustifyContentTest.test.ts +0 -2150
  494. package/src/tests/yoga-upstream/generated/YGMarginTest.test.ts +0 -1963
  495. package/src/tests/yoga-upstream/generated/YGMinMaxDimensionTest.test.ts +0 -1446
  496. package/src/tests/yoga-upstream/generated/YGPaddingTest.test.ts +0 -354
  497. package/src/tests/yoga-upstream/generated/YGPercentageTest.test.ts +0 -1760
  498. package/src/tests/yoga-upstream/generated/YGRoundingTest.test.ts +0 -1161
  499. package/src/tests/yoga-upstream/generated/YGSizeOverflowTest.test.ts +0 -207
  500. package/src/tests/yoga-upstream/generated/YGStaticPositionTest.test.ts +0 -6338
  501. package/src/tests/yoga-upstream/tools/MeasureCounter.ts +0 -54
  502. package/src/tests/yoga-upstream/tools/utils.ts +0 -81
  503. package/src/text-buffer-view.test.ts +0 -722
  504. package/src/text-buffer-view.ts +0 -193
  505. package/src/text-buffer.test.ts +0 -512
  506. package/src/text-buffer.ts +0 -250
  507. package/src/types.ts +0 -199
  508. package/src/utils.ts +0 -88
  509. package/src/yoga.ts +0 -1146
  510. package/src/zig/ansi.zig +0 -502
  511. package/src/zig/audio.zig +0 -1206
  512. package/src/zig/bench/README.md +0 -50
  513. package/src/zig/bench/buffer-color-blending_bench.zig +0 -350
  514. package/src/zig/bench/buffer-draw-box_bench.zig +0 -786
  515. package/src/zig/bench/buffer-draw-text-buffer_bench.zig +0 -894
  516. package/src/zig/bench/edit-buffer_bench.zig +0 -476
  517. package/src/zig/bench/editor-view_bench.zig +0 -169
  518. package/src/zig/bench/native-span-feed_bench.zig +0 -107
  519. package/src/zig/bench/rope-markers_bench.zig +0 -713
  520. package/src/zig/bench/rope_bench.zig +0 -514
  521. package/src/zig/bench/styled-text_bench.zig +0 -476
  522. package/src/zig/bench/text-buffer-coords_bench.zig +0 -362
  523. package/src/zig/bench/text-buffer-view_bench.zig +0 -459
  524. package/src/zig/bench/text-chunk-graphemes_bench.zig +0 -272
  525. package/src/zig/bench/utf8_bench.zig +0 -799
  526. package/src/zig/bench-utils.zig +0 -431
  527. package/src/zig/bench.zig +0 -223
  528. package/src/zig/buffer-methods.zig +0 -215
  529. package/src/zig/buffer.zig +0 -2515
  530. package/src/zig/build.zig +0 -700
  531. package/src/zig/build.zig.zon +0 -19
  532. package/src/zig/edit-buffer.zig +0 -900
  533. package/src/zig/editor-view.zig +0 -812
  534. package/src/zig/event-bus.zig +0 -28
  535. package/src/zig/event-emitter.zig +0 -65
  536. package/src/zig/file-logger.zig +0 -92
  537. package/src/zig/grapheme.zig +0 -838
  538. package/src/zig/handles.zig +0 -267
  539. package/src/zig/lib.zig +0 -2813
  540. package/src/zig/link.zig +0 -349
  541. package/src/zig/logger.zig +0 -43
  542. package/src/zig/mem-registry.zig +0 -126
  543. package/src/zig/miniaudio_shim.c +0 -21
  544. package/src/zig/native-renderable.zig +0 -112
  545. package/src/zig/native-span-feed-bench-lib.zig +0 -7
  546. package/src/zig/native-span-feed.zig +0 -747
  547. package/src/zig/renderer-output.zig +0 -677
  548. package/src/zig/renderer.zig +0 -2106
  549. package/src/zig/rope.zig +0 -1220
  550. package/src/zig/split-scrollback.zig +0 -88
  551. package/src/zig/syntax-style.zig +0 -174
  552. package/src/zig/terminal.zig +0 -1652
  553. package/src/zig/test.zig +0 -82
  554. package/src/zig/tests/README.md +0 -18
  555. package/src/zig/tests/ansi_test.zig +0 -18
  556. package/src/zig/tests/audio_test.zig +0 -439
  557. package/src/zig/tests/buffer-methods_test.zig +0 -1111
  558. package/src/zig/tests/buffer_test.zig +0 -2926
  559. package/src/zig/tests/edit-buffer-history_test.zig +0 -299
  560. package/src/zig/tests/edit-buffer_test.zig +0 -1688
  561. package/src/zig/tests/editor-view_test.zig +0 -3454
  562. package/src/zig/tests/event-emitter_test.zig +0 -249
  563. package/src/zig/tests/grapheme_test.zig +0 -1329
  564. package/src/zig/tests/handles_test.zig +0 -123
  565. package/src/zig/tests/link_test.zig +0 -220
  566. package/src/zig/tests/mem-registry_test.zig +0 -473
  567. package/src/zig/tests/memory_leak_regression_test.zig +0 -234
  568. package/src/zig/tests/native-renderable_test.zig +0 -16
  569. package/src/zig/tests/native-span-feed_test.zig +0 -1266
  570. package/src/zig/tests/renderer_test.zig +0 -2604
  571. package/src/zig/tests/rope-nested_test.zig +0 -712
  572. package/src/zig/tests/rope_fuzz_test.zig +0 -238
  573. package/src/zig/tests/rope_test.zig +0 -2362
  574. package/src/zig/tests/segment-merge.test.zig +0 -148
  575. package/src/zig/tests/split-scrollback_test.zig +0 -70
  576. package/src/zig/tests/syntax-style_test.zig +0 -558
  577. package/src/zig/tests/terminal_test.zig +0 -1489
  578. package/src/zig/tests/test-renderer.zig +0 -126
  579. package/src/zig/tests/text-buffer-drawing_test.zig +0 -3291
  580. package/src/zig/tests/text-buffer-highlights_test.zig +0 -706
  581. package/src/zig/tests/text-buffer-iterators_test.zig +0 -776
  582. package/src/zig/tests/text-buffer-segment_test.zig +0 -320
  583. package/src/zig/tests/text-buffer-selection_test.zig +0 -1056
  584. package/src/zig/tests/text-buffer-selection_viewport_test.zig +0 -358
  585. package/src/zig/tests/text-buffer-view_test.zig +0 -3672
  586. package/src/zig/tests/text-buffer_test.zig +0 -2191
  587. package/src/zig/tests/unicode-width-map.zon +0 -3909
  588. package/src/zig/tests/utf8_no_zwj_test.zig +0 -260
  589. package/src/zig/tests/utf8_test.zig +0 -4060
  590. package/src/zig/tests/utf8_wcwidth_cursor_test.zig +0 -267
  591. package/src/zig/tests/utf8_wcwidth_test.zig +0 -357
  592. package/src/zig/tests/word-wrap-editing_test.zig +0 -498
  593. package/src/zig/tests/wrap-cache-perf_test.zig +0 -113
  594. package/src/zig/tests/yoga_test.zig +0 -65
  595. package/src/zig/text-buffer-iterators.zig +0 -496
  596. package/src/zig/text-buffer-segment.zig +0 -403
  597. package/src/zig/text-buffer-view.zig +0 -1428
  598. package/src/zig/text-buffer.zig +0 -1272
  599. package/src/zig/utf8.zig +0 -1954
  600. package/src/zig/utils.zig +0 -12
  601. package/src/zig/uucode-stub.zig +0 -76
  602. package/src/zig/vendor/miniaudio/miniaudio.h +0 -93468
  603. package/src/zig/yoga.zig +0 -658
  604. package/src/zig-structs.ts +0 -381
  605. package/src/zig.ts +0 -5260
  606. package/tsconfig.build.json +0 -17
  607. package/tsconfig.json +0 -27
  608. package/tsconfig.node-test.json +0 -138
  609. /package/{src/lib/tree-sitter/assets → assets}/javascript/highlights.scm +0 -0
  610. /package/{src/lib/tree-sitter/assets → assets}/javascript/tree-sitter-javascript.wasm +0 -0
  611. /package/{src/lib/tree-sitter/assets → assets}/markdown/highlights.scm +0 -0
  612. /package/{src/lib/tree-sitter/assets → assets}/markdown/injections.scm +0 -0
  613. /package/{src/lib/tree-sitter/assets → assets}/markdown/tree-sitter-markdown.wasm +0 -0
  614. /package/{src/lib/tree-sitter/assets → assets}/markdown_inline/highlights.scm +0 -0
  615. /package/{src/lib/tree-sitter/assets → assets}/markdown_inline/tree-sitter-markdown_inline.wasm +0 -0
  616. /package/{src/lib/tree-sitter/assets → assets}/typescript/highlights.scm +0 -0
  617. /package/{src/lib/tree-sitter/assets → assets}/typescript/tree-sitter-typescript.wasm +0 -0
  618. /package/{src/lib/tree-sitter/assets → assets}/zig/highlights.scm +0 -0
  619. /package/{src/lib/tree-sitter/assets → assets}/zig/tree-sitter-zig.wasm +0 -0
@@ -1,1864 +0,0 @@
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<<9deb466dfc94bb340137a9e6b5d5c63d>>
8
- * generated by gentest/gentest-driver.ts from gentest/fixtures/YGAbsolutePositionTest.html
9
- */
10
-
11
- import { instrinsicSizeMeasureFunc } from "../tools/utils.ts"
12
- import Yoga from "../../../yoga.js"
13
- import {
14
- Align,
15
- BoxSizing,
16
- Direction,
17
- Display,
18
- Edge,
19
- Errata,
20
- ExperimentalFeature,
21
- FlexDirection,
22
- Gutter,
23
- Justify,
24
- MeasureMode,
25
- Overflow,
26
- PositionType,
27
- Unit,
28
- Wrap,
29
- } from "../../../yoga.js"
30
-
31
- test("absolute_layout_width_height_start_top", () => {
32
- const config = Yoga.Config.create()
33
- let root
34
-
35
- try {
36
- root = Yoga.Node.create(config)
37
- root.setPositionType(PositionType.Absolute)
38
- root.setWidth(100)
39
- root.setHeight(100)
40
-
41
- const root_child0 = Yoga.Node.create(config)
42
- root_child0.setPositionType(PositionType.Absolute)
43
- root_child0.setPosition(Edge.Start, 10)
44
- root_child0.setPosition(Edge.Top, 10)
45
- root_child0.setWidth(10)
46
- root_child0.setHeight(10)
47
- root.insertChild(root_child0, 0)
48
- root.calculateLayout(undefined, undefined, Direction.LTR)
49
-
50
- expect(root.getComputedLeft()).toBe(0)
51
- expect(root.getComputedTop()).toBe(0)
52
- expect(root.getComputedWidth()).toBe(100)
53
- expect(root.getComputedHeight()).toBe(100)
54
-
55
- expect(root_child0.getComputedLeft()).toBe(10)
56
- expect(root_child0.getComputedTop()).toBe(10)
57
- expect(root_child0.getComputedWidth()).toBe(10)
58
- expect(root_child0.getComputedHeight()).toBe(10)
59
-
60
- root.calculateLayout(undefined, undefined, Direction.RTL)
61
-
62
- expect(root.getComputedLeft()).toBe(0)
63
- expect(root.getComputedTop()).toBe(0)
64
- expect(root.getComputedWidth()).toBe(100)
65
- expect(root.getComputedHeight()).toBe(100)
66
-
67
- expect(root_child0.getComputedLeft()).toBe(80)
68
- expect(root_child0.getComputedTop()).toBe(10)
69
- expect(root_child0.getComputedWidth()).toBe(10)
70
- expect(root_child0.getComputedHeight()).toBe(10)
71
- } finally {
72
- if (typeof root !== "undefined") {
73
- root.freeRecursive()
74
- }
75
-
76
- config.free()
77
- }
78
- })
79
- test("absolute_layout_width_height_left_auto_right", () => {
80
- const config = Yoga.Config.create()
81
- let root
82
-
83
- try {
84
- root = Yoga.Node.create(config)
85
- root.setPositionType(PositionType.Absolute)
86
- root.setWidth(100)
87
- root.setHeight(100)
88
-
89
- const root_child0 = Yoga.Node.create(config)
90
- root_child0.setPositionType(PositionType.Absolute)
91
- root_child0.setPositionAuto(Edge.Left)
92
- root_child0.setPosition(Edge.Right, 10)
93
- root_child0.setWidth(10)
94
- root_child0.setHeight(10)
95
- root.insertChild(root_child0, 0)
96
- root.calculateLayout(undefined, undefined, Direction.LTR)
97
-
98
- expect(root.getComputedLeft()).toBe(0)
99
- expect(root.getComputedTop()).toBe(0)
100
- expect(root.getComputedWidth()).toBe(100)
101
- expect(root.getComputedHeight()).toBe(100)
102
-
103
- expect(root_child0.getComputedLeft()).toBe(80)
104
- expect(root_child0.getComputedTop()).toBe(0)
105
- expect(root_child0.getComputedWidth()).toBe(10)
106
- expect(root_child0.getComputedHeight()).toBe(10)
107
-
108
- root.calculateLayout(undefined, undefined, Direction.RTL)
109
-
110
- expect(root.getComputedLeft()).toBe(0)
111
- expect(root.getComputedTop()).toBe(0)
112
- expect(root.getComputedWidth()).toBe(100)
113
- expect(root.getComputedHeight()).toBe(100)
114
-
115
- expect(root_child0.getComputedLeft()).toBe(80)
116
- expect(root_child0.getComputedTop()).toBe(0)
117
- expect(root_child0.getComputedWidth()).toBe(10)
118
- expect(root_child0.getComputedHeight()).toBe(10)
119
- } finally {
120
- if (typeof root !== "undefined") {
121
- root.freeRecursive()
122
- }
123
-
124
- config.free()
125
- }
126
- })
127
- test("absolute_layout_width_height_left_right_auto", () => {
128
- const config = Yoga.Config.create()
129
- let root
130
-
131
- try {
132
- root = Yoga.Node.create(config)
133
- root.setPositionType(PositionType.Absolute)
134
- root.setWidth(100)
135
- root.setHeight(100)
136
-
137
- const root_child0 = Yoga.Node.create(config)
138
- root_child0.setPositionType(PositionType.Absolute)
139
- root_child0.setPosition(Edge.Left, 10)
140
- root_child0.setPositionAuto(Edge.Right)
141
- root_child0.setWidth(10)
142
- root_child0.setHeight(10)
143
- root.insertChild(root_child0, 0)
144
- root.calculateLayout(undefined, undefined, Direction.LTR)
145
-
146
- expect(root.getComputedLeft()).toBe(0)
147
- expect(root.getComputedTop()).toBe(0)
148
- expect(root.getComputedWidth()).toBe(100)
149
- expect(root.getComputedHeight()).toBe(100)
150
-
151
- expect(root_child0.getComputedLeft()).toBe(10)
152
- expect(root_child0.getComputedTop()).toBe(0)
153
- expect(root_child0.getComputedWidth()).toBe(10)
154
- expect(root_child0.getComputedHeight()).toBe(10)
155
-
156
- root.calculateLayout(undefined, undefined, Direction.RTL)
157
-
158
- expect(root.getComputedLeft()).toBe(0)
159
- expect(root.getComputedTop()).toBe(0)
160
- expect(root.getComputedWidth()).toBe(100)
161
- expect(root.getComputedHeight()).toBe(100)
162
-
163
- expect(root_child0.getComputedLeft()).toBe(10)
164
- expect(root_child0.getComputedTop()).toBe(0)
165
- expect(root_child0.getComputedWidth()).toBe(10)
166
- expect(root_child0.getComputedHeight()).toBe(10)
167
- } finally {
168
- if (typeof root !== "undefined") {
169
- root.freeRecursive()
170
- }
171
-
172
- config.free()
173
- }
174
- })
175
- test("absolute_layout_width_height_left_auto_right_auto", () => {
176
- const config = Yoga.Config.create()
177
- let root
178
-
179
- try {
180
- root = Yoga.Node.create(config)
181
- root.setPositionType(PositionType.Absolute)
182
- root.setWidth(100)
183
- root.setHeight(100)
184
-
185
- const root_child0 = Yoga.Node.create(config)
186
- root_child0.setPositionType(PositionType.Absolute)
187
- root_child0.setPositionAuto(Edge.Left)
188
- root_child0.setPositionAuto(Edge.Right)
189
- root_child0.setWidth(10)
190
- root_child0.setHeight(10)
191
- root.insertChild(root_child0, 0)
192
- root.calculateLayout(undefined, undefined, Direction.LTR)
193
-
194
- expect(root.getComputedLeft()).toBe(0)
195
- expect(root.getComputedTop()).toBe(0)
196
- expect(root.getComputedWidth()).toBe(100)
197
- expect(root.getComputedHeight()).toBe(100)
198
-
199
- expect(root_child0.getComputedLeft()).toBe(0)
200
- expect(root_child0.getComputedTop()).toBe(0)
201
- expect(root_child0.getComputedWidth()).toBe(10)
202
- expect(root_child0.getComputedHeight()).toBe(10)
203
-
204
- root.calculateLayout(undefined, undefined, Direction.RTL)
205
-
206
- expect(root.getComputedLeft()).toBe(0)
207
- expect(root.getComputedTop()).toBe(0)
208
- expect(root.getComputedWidth()).toBe(100)
209
- expect(root.getComputedHeight()).toBe(100)
210
-
211
- expect(root_child0.getComputedLeft()).toBe(90)
212
- expect(root_child0.getComputedTop()).toBe(0)
213
- expect(root_child0.getComputedWidth()).toBe(10)
214
- expect(root_child0.getComputedHeight()).toBe(10)
215
- } finally {
216
- if (typeof root !== "undefined") {
217
- root.freeRecursive()
218
- }
219
-
220
- config.free()
221
- }
222
- })
223
- test("absolute_layout_width_height_end_bottom", () => {
224
- const config = Yoga.Config.create()
225
- let root
226
-
227
- try {
228
- root = Yoga.Node.create(config)
229
- root.setPositionType(PositionType.Absolute)
230
- root.setWidth(100)
231
- root.setHeight(100)
232
-
233
- const root_child0 = Yoga.Node.create(config)
234
- root_child0.setPositionType(PositionType.Absolute)
235
- root_child0.setPosition(Edge.End, 10)
236
- root_child0.setPosition(Edge.Bottom, 10)
237
- root_child0.setWidth(10)
238
- root_child0.setHeight(10)
239
- root.insertChild(root_child0, 0)
240
- root.calculateLayout(undefined, undefined, Direction.LTR)
241
-
242
- expect(root.getComputedLeft()).toBe(0)
243
- expect(root.getComputedTop()).toBe(0)
244
- expect(root.getComputedWidth()).toBe(100)
245
- expect(root.getComputedHeight()).toBe(100)
246
-
247
- expect(root_child0.getComputedLeft()).toBe(80)
248
- expect(root_child0.getComputedTop()).toBe(80)
249
- expect(root_child0.getComputedWidth()).toBe(10)
250
- expect(root_child0.getComputedHeight()).toBe(10)
251
-
252
- root.calculateLayout(undefined, undefined, Direction.RTL)
253
-
254
- expect(root.getComputedLeft()).toBe(0)
255
- expect(root.getComputedTop()).toBe(0)
256
- expect(root.getComputedWidth()).toBe(100)
257
- expect(root.getComputedHeight()).toBe(100)
258
-
259
- expect(root_child0.getComputedLeft()).toBe(10)
260
- expect(root_child0.getComputedTop()).toBe(80)
261
- expect(root_child0.getComputedWidth()).toBe(10)
262
- expect(root_child0.getComputedHeight()).toBe(10)
263
- } finally {
264
- if (typeof root !== "undefined") {
265
- root.freeRecursive()
266
- }
267
-
268
- config.free()
269
- }
270
- })
271
- test("absolute_layout_start_top_end_bottom", () => {
272
- const config = Yoga.Config.create()
273
- let root
274
-
275
- try {
276
- root = Yoga.Node.create(config)
277
- root.setPositionType(PositionType.Absolute)
278
- root.setWidth(100)
279
- root.setHeight(100)
280
-
281
- const root_child0 = Yoga.Node.create(config)
282
- root_child0.setPositionType(PositionType.Absolute)
283
- root_child0.setPosition(Edge.Start, 10)
284
- root_child0.setPosition(Edge.Top, 10)
285
- root_child0.setPosition(Edge.End, 10)
286
- root_child0.setPosition(Edge.Bottom, 10)
287
- root.insertChild(root_child0, 0)
288
- root.calculateLayout(undefined, undefined, Direction.LTR)
289
-
290
- expect(root.getComputedLeft()).toBe(0)
291
- expect(root.getComputedTop()).toBe(0)
292
- expect(root.getComputedWidth()).toBe(100)
293
- expect(root.getComputedHeight()).toBe(100)
294
-
295
- expect(root_child0.getComputedLeft()).toBe(10)
296
- expect(root_child0.getComputedTop()).toBe(10)
297
- expect(root_child0.getComputedWidth()).toBe(80)
298
- expect(root_child0.getComputedHeight()).toBe(80)
299
-
300
- root.calculateLayout(undefined, undefined, Direction.RTL)
301
-
302
- expect(root.getComputedLeft()).toBe(0)
303
- expect(root.getComputedTop()).toBe(0)
304
- expect(root.getComputedWidth()).toBe(100)
305
- expect(root.getComputedHeight()).toBe(100)
306
-
307
- expect(root_child0.getComputedLeft()).toBe(10)
308
- expect(root_child0.getComputedTop()).toBe(10)
309
- expect(root_child0.getComputedWidth()).toBe(80)
310
- expect(root_child0.getComputedHeight()).toBe(80)
311
- } finally {
312
- if (typeof root !== "undefined") {
313
- root.freeRecursive()
314
- }
315
-
316
- config.free()
317
- }
318
- })
319
- test("absolute_layout_width_height_start_top_end_bottom", () => {
320
- const config = Yoga.Config.create()
321
- let root
322
-
323
- try {
324
- root = Yoga.Node.create(config)
325
- root.setPositionType(PositionType.Absolute)
326
- root.setWidth(100)
327
- root.setHeight(100)
328
-
329
- const root_child0 = Yoga.Node.create(config)
330
- root_child0.setPositionType(PositionType.Absolute)
331
- root_child0.setPosition(Edge.Start, 10)
332
- root_child0.setPosition(Edge.Top, 10)
333
- root_child0.setPosition(Edge.End, 10)
334
- root_child0.setPosition(Edge.Bottom, 10)
335
- root_child0.setWidth(10)
336
- root_child0.setHeight(10)
337
- root.insertChild(root_child0, 0)
338
- root.calculateLayout(undefined, undefined, Direction.LTR)
339
-
340
- expect(root.getComputedLeft()).toBe(0)
341
- expect(root.getComputedTop()).toBe(0)
342
- expect(root.getComputedWidth()).toBe(100)
343
- expect(root.getComputedHeight()).toBe(100)
344
-
345
- expect(root_child0.getComputedLeft()).toBe(10)
346
- expect(root_child0.getComputedTop()).toBe(10)
347
- expect(root_child0.getComputedWidth()).toBe(10)
348
- expect(root_child0.getComputedHeight()).toBe(10)
349
-
350
- root.calculateLayout(undefined, undefined, Direction.RTL)
351
-
352
- expect(root.getComputedLeft()).toBe(0)
353
- expect(root.getComputedTop()).toBe(0)
354
- expect(root.getComputedWidth()).toBe(100)
355
- expect(root.getComputedHeight()).toBe(100)
356
-
357
- expect(root_child0.getComputedLeft()).toBe(80)
358
- expect(root_child0.getComputedTop()).toBe(10)
359
- expect(root_child0.getComputedWidth()).toBe(10)
360
- expect(root_child0.getComputedHeight()).toBe(10)
361
- } finally {
362
- if (typeof root !== "undefined") {
363
- root.freeRecursive()
364
- }
365
-
366
- config.free()
367
- }
368
- })
369
- test("do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent", () => {
370
- const config = Yoga.Config.create()
371
- let root
372
-
373
- try {
374
- root = Yoga.Node.create(config)
375
- root.setFlexDirection(FlexDirection.Row)
376
- root.setPositionType(PositionType.Absolute)
377
- root.setOverflow(Overflow.Hidden)
378
- root.setWidth(50)
379
- root.setHeight(50)
380
-
381
- const root_child0 = Yoga.Node.create(config)
382
- root_child0.setPositionType(PositionType.Absolute)
383
- root_child0.setPosition(Edge.Start, 0)
384
- root_child0.setPosition(Edge.Top, 0)
385
- root.insertChild(root_child0, 0)
386
-
387
- const root_child0_child0 = Yoga.Node.create(config)
388
- root_child0_child0.setWidth(100)
389
- root_child0_child0.setHeight(100)
390
- root_child0.insertChild(root_child0_child0, 0)
391
- root.calculateLayout(undefined, undefined, Direction.LTR)
392
-
393
- expect(root.getComputedLeft()).toBe(0)
394
- expect(root.getComputedTop()).toBe(0)
395
- expect(root.getComputedWidth()).toBe(50)
396
- expect(root.getComputedHeight()).toBe(50)
397
-
398
- expect(root_child0.getComputedLeft()).toBe(0)
399
- expect(root_child0.getComputedTop()).toBe(0)
400
- expect(root_child0.getComputedWidth()).toBe(100)
401
- expect(root_child0.getComputedHeight()).toBe(100)
402
-
403
- expect(root_child0_child0.getComputedLeft()).toBe(0)
404
- expect(root_child0_child0.getComputedTop()).toBe(0)
405
- expect(root_child0_child0.getComputedWidth()).toBe(100)
406
- expect(root_child0_child0.getComputedHeight()).toBe(100)
407
-
408
- root.calculateLayout(undefined, undefined, Direction.RTL)
409
-
410
- expect(root.getComputedLeft()).toBe(0)
411
- expect(root.getComputedTop()).toBe(0)
412
- expect(root.getComputedWidth()).toBe(50)
413
- expect(root.getComputedHeight()).toBe(50)
414
-
415
- expect(root_child0.getComputedLeft()).toBe(-50)
416
- expect(root_child0.getComputedTop()).toBe(0)
417
- expect(root_child0.getComputedWidth()).toBe(100)
418
- expect(root_child0.getComputedHeight()).toBe(100)
419
-
420
- expect(root_child0_child0.getComputedLeft()).toBe(0)
421
- expect(root_child0_child0.getComputedTop()).toBe(0)
422
- expect(root_child0_child0.getComputedWidth()).toBe(100)
423
- expect(root_child0_child0.getComputedHeight()).toBe(100)
424
- } finally {
425
- if (typeof root !== "undefined") {
426
- root.freeRecursive()
427
- }
428
-
429
- config.free()
430
- }
431
- })
432
- test("absolute_layout_within_border", () => {
433
- const config = Yoga.Config.create()
434
- let root
435
-
436
- try {
437
- root = Yoga.Node.create(config)
438
- root.setPositionType(PositionType.Absolute)
439
- root.setMargin(Edge.Left, 10)
440
- root.setMargin(Edge.Top, 10)
441
- root.setMargin(Edge.Right, 10)
442
- root.setMargin(Edge.Bottom, 10)
443
- root.setPadding(Edge.Left, 10)
444
- root.setPadding(Edge.Top, 10)
445
- root.setPadding(Edge.Right, 10)
446
- root.setPadding(Edge.Bottom, 10)
447
- root.setBorder(Edge.Left, 10)
448
- root.setBorder(Edge.Top, 10)
449
- root.setBorder(Edge.Right, 10)
450
- root.setBorder(Edge.Bottom, 10)
451
- root.setWidth(100)
452
- root.setHeight(100)
453
-
454
- const root_child0 = Yoga.Node.create(config)
455
- root_child0.setPositionType(PositionType.Absolute)
456
- root_child0.setPosition(Edge.Left, 0)
457
- root_child0.setPosition(Edge.Top, 0)
458
- root_child0.setWidth(50)
459
- root_child0.setHeight(50)
460
- root.insertChild(root_child0, 0)
461
-
462
- const root_child1 = Yoga.Node.create(config)
463
- root_child1.setPositionType(PositionType.Absolute)
464
- root_child1.setPosition(Edge.Right, 0)
465
- root_child1.setPosition(Edge.Bottom, 0)
466
- root_child1.setWidth(50)
467
- root_child1.setHeight(50)
468
- root.insertChild(root_child1, 1)
469
-
470
- const root_child2 = Yoga.Node.create(config)
471
- root_child2.setPositionType(PositionType.Absolute)
472
- root_child2.setPosition(Edge.Left, 0)
473
- root_child2.setPosition(Edge.Top, 0)
474
- root_child2.setMargin(Edge.Left, 10)
475
- root_child2.setMargin(Edge.Top, 10)
476
- root_child2.setMargin(Edge.Right, 10)
477
- root_child2.setMargin(Edge.Bottom, 10)
478
- root_child2.setWidth(50)
479
- root_child2.setHeight(50)
480
- root.insertChild(root_child2, 2)
481
-
482
- const root_child3 = Yoga.Node.create(config)
483
- root_child3.setPositionType(PositionType.Absolute)
484
- root_child3.setPosition(Edge.Right, 0)
485
- root_child3.setPosition(Edge.Bottom, 0)
486
- root_child3.setMargin(Edge.Left, 10)
487
- root_child3.setMargin(Edge.Top, 10)
488
- root_child3.setMargin(Edge.Right, 10)
489
- root_child3.setMargin(Edge.Bottom, 10)
490
- root_child3.setWidth(50)
491
- root_child3.setHeight(50)
492
- root.insertChild(root_child3, 3)
493
- root.calculateLayout(undefined, undefined, Direction.LTR)
494
-
495
- expect(root.getComputedLeft()).toBe(10)
496
- expect(root.getComputedTop()).toBe(10)
497
- expect(root.getComputedWidth()).toBe(100)
498
- expect(root.getComputedHeight()).toBe(100)
499
-
500
- expect(root_child0.getComputedLeft()).toBe(10)
501
- expect(root_child0.getComputedTop()).toBe(10)
502
- expect(root_child0.getComputedWidth()).toBe(50)
503
- expect(root_child0.getComputedHeight()).toBe(50)
504
-
505
- expect(root_child1.getComputedLeft()).toBe(40)
506
- expect(root_child1.getComputedTop()).toBe(40)
507
- expect(root_child1.getComputedWidth()).toBe(50)
508
- expect(root_child1.getComputedHeight()).toBe(50)
509
-
510
- expect(root_child2.getComputedLeft()).toBe(20)
511
- expect(root_child2.getComputedTop()).toBe(20)
512
- expect(root_child2.getComputedWidth()).toBe(50)
513
- expect(root_child2.getComputedHeight()).toBe(50)
514
-
515
- expect(root_child3.getComputedLeft()).toBe(30)
516
- expect(root_child3.getComputedTop()).toBe(30)
517
- expect(root_child3.getComputedWidth()).toBe(50)
518
- expect(root_child3.getComputedHeight()).toBe(50)
519
-
520
- root.calculateLayout(undefined, undefined, Direction.RTL)
521
-
522
- expect(root.getComputedLeft()).toBe(10)
523
- expect(root.getComputedTop()).toBe(10)
524
- expect(root.getComputedWidth()).toBe(100)
525
- expect(root.getComputedHeight()).toBe(100)
526
-
527
- expect(root_child0.getComputedLeft()).toBe(10)
528
- expect(root_child0.getComputedTop()).toBe(10)
529
- expect(root_child0.getComputedWidth()).toBe(50)
530
- expect(root_child0.getComputedHeight()).toBe(50)
531
-
532
- expect(root_child1.getComputedLeft()).toBe(40)
533
- expect(root_child1.getComputedTop()).toBe(40)
534
- expect(root_child1.getComputedWidth()).toBe(50)
535
- expect(root_child1.getComputedHeight()).toBe(50)
536
-
537
- expect(root_child2.getComputedLeft()).toBe(20)
538
- expect(root_child2.getComputedTop()).toBe(20)
539
- expect(root_child2.getComputedWidth()).toBe(50)
540
- expect(root_child2.getComputedHeight()).toBe(50)
541
-
542
- expect(root_child3.getComputedLeft()).toBe(30)
543
- expect(root_child3.getComputedTop()).toBe(30)
544
- expect(root_child3.getComputedWidth()).toBe(50)
545
- expect(root_child3.getComputedHeight()).toBe(50)
546
- } finally {
547
- if (typeof root !== "undefined") {
548
- root.freeRecursive()
549
- }
550
-
551
- config.free()
552
- }
553
- })
554
- test("absolute_layout_align_items_and_justify_content_center", () => {
555
- const config = Yoga.Config.create()
556
- let root
557
-
558
- try {
559
- root = Yoga.Node.create(config)
560
- root.setJustifyContent(Justify.Center)
561
- root.setAlignItems(Align.Center)
562
- root.setPositionType(PositionType.Absolute)
563
- root.setFlexGrow(1)
564
- root.setWidth(110)
565
- root.setHeight(100)
566
-
567
- const root_child0 = Yoga.Node.create(config)
568
- root_child0.setPositionType(PositionType.Absolute)
569
- root_child0.setWidth(60)
570
- root_child0.setHeight(40)
571
- root.insertChild(root_child0, 0)
572
- root.calculateLayout(undefined, undefined, Direction.LTR)
573
-
574
- expect(root.getComputedLeft()).toBe(0)
575
- expect(root.getComputedTop()).toBe(0)
576
- expect(root.getComputedWidth()).toBe(110)
577
- expect(root.getComputedHeight()).toBe(100)
578
-
579
- expect(root_child0.getComputedLeft()).toBe(25)
580
- expect(root_child0.getComputedTop()).toBe(30)
581
- expect(root_child0.getComputedWidth()).toBe(60)
582
- expect(root_child0.getComputedHeight()).toBe(40)
583
-
584
- root.calculateLayout(undefined, undefined, Direction.RTL)
585
-
586
- expect(root.getComputedLeft()).toBe(0)
587
- expect(root.getComputedTop()).toBe(0)
588
- expect(root.getComputedWidth()).toBe(110)
589
- expect(root.getComputedHeight()).toBe(100)
590
-
591
- expect(root_child0.getComputedLeft()).toBe(25)
592
- expect(root_child0.getComputedTop()).toBe(30)
593
- expect(root_child0.getComputedWidth()).toBe(60)
594
- expect(root_child0.getComputedHeight()).toBe(40)
595
- } finally {
596
- if (typeof root !== "undefined") {
597
- root.freeRecursive()
598
- }
599
-
600
- config.free()
601
- }
602
- })
603
- test("absolute_layout_align_items_and_justify_content_flex_end", () => {
604
- const config = Yoga.Config.create()
605
- let root
606
-
607
- try {
608
- root = Yoga.Node.create(config)
609
- root.setJustifyContent(Justify.FlexEnd)
610
- root.setAlignItems(Align.FlexEnd)
611
- root.setPositionType(PositionType.Absolute)
612
- root.setFlexGrow(1)
613
- root.setWidth(110)
614
- root.setHeight(100)
615
-
616
- const root_child0 = Yoga.Node.create(config)
617
- root_child0.setPositionType(PositionType.Absolute)
618
- root_child0.setWidth(60)
619
- root_child0.setHeight(40)
620
- root.insertChild(root_child0, 0)
621
- root.calculateLayout(undefined, undefined, Direction.LTR)
622
-
623
- expect(root.getComputedLeft()).toBe(0)
624
- expect(root.getComputedTop()).toBe(0)
625
- expect(root.getComputedWidth()).toBe(110)
626
- expect(root.getComputedHeight()).toBe(100)
627
-
628
- expect(root_child0.getComputedLeft()).toBe(50)
629
- expect(root_child0.getComputedTop()).toBe(60)
630
- expect(root_child0.getComputedWidth()).toBe(60)
631
- expect(root_child0.getComputedHeight()).toBe(40)
632
-
633
- root.calculateLayout(undefined, undefined, Direction.RTL)
634
-
635
- expect(root.getComputedLeft()).toBe(0)
636
- expect(root.getComputedTop()).toBe(0)
637
- expect(root.getComputedWidth()).toBe(110)
638
- expect(root.getComputedHeight()).toBe(100)
639
-
640
- expect(root_child0.getComputedLeft()).toBe(0)
641
- expect(root_child0.getComputedTop()).toBe(60)
642
- expect(root_child0.getComputedWidth()).toBe(60)
643
- expect(root_child0.getComputedHeight()).toBe(40)
644
- } finally {
645
- if (typeof root !== "undefined") {
646
- root.freeRecursive()
647
- }
648
-
649
- config.free()
650
- }
651
- })
652
- test("absolute_layout_justify_content_center", () => {
653
- const config = Yoga.Config.create()
654
- let root
655
-
656
- try {
657
- root = Yoga.Node.create(config)
658
- root.setJustifyContent(Justify.Center)
659
- root.setPositionType(PositionType.Absolute)
660
- root.setFlexGrow(1)
661
- root.setWidth(110)
662
- root.setHeight(100)
663
-
664
- const root_child0 = Yoga.Node.create(config)
665
- root_child0.setPositionType(PositionType.Absolute)
666
- root_child0.setWidth(60)
667
- root_child0.setHeight(40)
668
- root.insertChild(root_child0, 0)
669
- root.calculateLayout(undefined, undefined, Direction.LTR)
670
-
671
- expect(root.getComputedLeft()).toBe(0)
672
- expect(root.getComputedTop()).toBe(0)
673
- expect(root.getComputedWidth()).toBe(110)
674
- expect(root.getComputedHeight()).toBe(100)
675
-
676
- expect(root_child0.getComputedLeft()).toBe(0)
677
- expect(root_child0.getComputedTop()).toBe(30)
678
- expect(root_child0.getComputedWidth()).toBe(60)
679
- expect(root_child0.getComputedHeight()).toBe(40)
680
-
681
- root.calculateLayout(undefined, undefined, Direction.RTL)
682
-
683
- expect(root.getComputedLeft()).toBe(0)
684
- expect(root.getComputedTop()).toBe(0)
685
- expect(root.getComputedWidth()).toBe(110)
686
- expect(root.getComputedHeight()).toBe(100)
687
-
688
- expect(root_child0.getComputedLeft()).toBe(50)
689
- expect(root_child0.getComputedTop()).toBe(30)
690
- expect(root_child0.getComputedWidth()).toBe(60)
691
- expect(root_child0.getComputedHeight()).toBe(40)
692
- } finally {
693
- if (typeof root !== "undefined") {
694
- root.freeRecursive()
695
- }
696
-
697
- config.free()
698
- }
699
- })
700
- test("absolute_layout_align_items_center", () => {
701
- const config = Yoga.Config.create()
702
- let root
703
-
704
- try {
705
- root = Yoga.Node.create(config)
706
- root.setAlignItems(Align.Center)
707
- root.setPositionType(PositionType.Absolute)
708
- root.setFlexGrow(1)
709
- root.setWidth(110)
710
- root.setHeight(100)
711
-
712
- const root_child0 = Yoga.Node.create(config)
713
- root_child0.setPositionType(PositionType.Absolute)
714
- root_child0.setWidth(60)
715
- root_child0.setHeight(40)
716
- root.insertChild(root_child0, 0)
717
- root.calculateLayout(undefined, undefined, Direction.LTR)
718
-
719
- expect(root.getComputedLeft()).toBe(0)
720
- expect(root.getComputedTop()).toBe(0)
721
- expect(root.getComputedWidth()).toBe(110)
722
- expect(root.getComputedHeight()).toBe(100)
723
-
724
- expect(root_child0.getComputedLeft()).toBe(25)
725
- expect(root_child0.getComputedTop()).toBe(0)
726
- expect(root_child0.getComputedWidth()).toBe(60)
727
- expect(root_child0.getComputedHeight()).toBe(40)
728
-
729
- root.calculateLayout(undefined, undefined, Direction.RTL)
730
-
731
- expect(root.getComputedLeft()).toBe(0)
732
- expect(root.getComputedTop()).toBe(0)
733
- expect(root.getComputedWidth()).toBe(110)
734
- expect(root.getComputedHeight()).toBe(100)
735
-
736
- expect(root_child0.getComputedLeft()).toBe(25)
737
- expect(root_child0.getComputedTop()).toBe(0)
738
- expect(root_child0.getComputedWidth()).toBe(60)
739
- expect(root_child0.getComputedHeight()).toBe(40)
740
- } finally {
741
- if (typeof root !== "undefined") {
742
- root.freeRecursive()
743
- }
744
-
745
- config.free()
746
- }
747
- })
748
- test("absolute_layout_align_items_center_on_child_only", () => {
749
- const config = Yoga.Config.create()
750
- let root
751
-
752
- try {
753
- root = Yoga.Node.create(config)
754
- root.setPositionType(PositionType.Absolute)
755
- root.setFlexGrow(1)
756
- root.setWidth(110)
757
- root.setHeight(100)
758
-
759
- const root_child0 = Yoga.Node.create(config)
760
- root_child0.setAlignSelf(Align.Center)
761
- root_child0.setPositionType(PositionType.Absolute)
762
- root_child0.setWidth(60)
763
- root_child0.setHeight(40)
764
- root.insertChild(root_child0, 0)
765
- root.calculateLayout(undefined, undefined, Direction.LTR)
766
-
767
- expect(root.getComputedLeft()).toBe(0)
768
- expect(root.getComputedTop()).toBe(0)
769
- expect(root.getComputedWidth()).toBe(110)
770
- expect(root.getComputedHeight()).toBe(100)
771
-
772
- expect(root_child0.getComputedLeft()).toBe(25)
773
- expect(root_child0.getComputedTop()).toBe(0)
774
- expect(root_child0.getComputedWidth()).toBe(60)
775
- expect(root_child0.getComputedHeight()).toBe(40)
776
-
777
- root.calculateLayout(undefined, undefined, Direction.RTL)
778
-
779
- expect(root.getComputedLeft()).toBe(0)
780
- expect(root.getComputedTop()).toBe(0)
781
- expect(root.getComputedWidth()).toBe(110)
782
- expect(root.getComputedHeight()).toBe(100)
783
-
784
- expect(root_child0.getComputedLeft()).toBe(25)
785
- expect(root_child0.getComputedTop()).toBe(0)
786
- expect(root_child0.getComputedWidth()).toBe(60)
787
- expect(root_child0.getComputedHeight()).toBe(40)
788
- } finally {
789
- if (typeof root !== "undefined") {
790
- root.freeRecursive()
791
- }
792
-
793
- config.free()
794
- }
795
- })
796
- test("absolute_layout_align_items_and_justify_content_center_and_top_position", () => {
797
- const config = Yoga.Config.create()
798
- let root
799
-
800
- try {
801
- root = Yoga.Node.create(config)
802
- root.setJustifyContent(Justify.Center)
803
- root.setAlignItems(Align.Center)
804
- root.setPositionType(PositionType.Absolute)
805
- root.setFlexGrow(1)
806
- root.setWidth(110)
807
- root.setHeight(100)
808
-
809
- const root_child0 = Yoga.Node.create(config)
810
- root_child0.setPositionType(PositionType.Absolute)
811
- root_child0.setPosition(Edge.Top, 10)
812
- root_child0.setWidth(60)
813
- root_child0.setHeight(40)
814
- root.insertChild(root_child0, 0)
815
- root.calculateLayout(undefined, undefined, Direction.LTR)
816
-
817
- expect(root.getComputedLeft()).toBe(0)
818
- expect(root.getComputedTop()).toBe(0)
819
- expect(root.getComputedWidth()).toBe(110)
820
- expect(root.getComputedHeight()).toBe(100)
821
-
822
- expect(root_child0.getComputedLeft()).toBe(25)
823
- expect(root_child0.getComputedTop()).toBe(10)
824
- expect(root_child0.getComputedWidth()).toBe(60)
825
- expect(root_child0.getComputedHeight()).toBe(40)
826
-
827
- root.calculateLayout(undefined, undefined, Direction.RTL)
828
-
829
- expect(root.getComputedLeft()).toBe(0)
830
- expect(root.getComputedTop()).toBe(0)
831
- expect(root.getComputedWidth()).toBe(110)
832
- expect(root.getComputedHeight()).toBe(100)
833
-
834
- expect(root_child0.getComputedLeft()).toBe(25)
835
- expect(root_child0.getComputedTop()).toBe(10)
836
- expect(root_child0.getComputedWidth()).toBe(60)
837
- expect(root_child0.getComputedHeight()).toBe(40)
838
- } finally {
839
- if (typeof root !== "undefined") {
840
- root.freeRecursive()
841
- }
842
-
843
- config.free()
844
- }
845
- })
846
- test("absolute_layout_align_items_and_justify_content_center_and_bottom_position", () => {
847
- const config = Yoga.Config.create()
848
- let root
849
-
850
- try {
851
- root = Yoga.Node.create(config)
852
- root.setJustifyContent(Justify.Center)
853
- root.setAlignItems(Align.Center)
854
- root.setPositionType(PositionType.Absolute)
855
- root.setFlexGrow(1)
856
- root.setWidth(110)
857
- root.setHeight(100)
858
-
859
- const root_child0 = Yoga.Node.create(config)
860
- root_child0.setPositionType(PositionType.Absolute)
861
- root_child0.setPosition(Edge.Bottom, 10)
862
- root_child0.setWidth(60)
863
- root_child0.setHeight(40)
864
- root.insertChild(root_child0, 0)
865
- root.calculateLayout(undefined, undefined, Direction.LTR)
866
-
867
- expect(root.getComputedLeft()).toBe(0)
868
- expect(root.getComputedTop()).toBe(0)
869
- expect(root.getComputedWidth()).toBe(110)
870
- expect(root.getComputedHeight()).toBe(100)
871
-
872
- expect(root_child0.getComputedLeft()).toBe(25)
873
- expect(root_child0.getComputedTop()).toBe(50)
874
- expect(root_child0.getComputedWidth()).toBe(60)
875
- expect(root_child0.getComputedHeight()).toBe(40)
876
-
877
- root.calculateLayout(undefined, undefined, Direction.RTL)
878
-
879
- expect(root.getComputedLeft()).toBe(0)
880
- expect(root.getComputedTop()).toBe(0)
881
- expect(root.getComputedWidth()).toBe(110)
882
- expect(root.getComputedHeight()).toBe(100)
883
-
884
- expect(root_child0.getComputedLeft()).toBe(25)
885
- expect(root_child0.getComputedTop()).toBe(50)
886
- expect(root_child0.getComputedWidth()).toBe(60)
887
- expect(root_child0.getComputedHeight()).toBe(40)
888
- } finally {
889
- if (typeof root !== "undefined") {
890
- root.freeRecursive()
891
- }
892
-
893
- config.free()
894
- }
895
- })
896
- test("absolute_layout_align_items_and_justify_content_center_and_left_position", () => {
897
- const config = Yoga.Config.create()
898
- let root
899
-
900
- try {
901
- root = Yoga.Node.create(config)
902
- root.setJustifyContent(Justify.Center)
903
- root.setAlignItems(Align.Center)
904
- root.setPositionType(PositionType.Absolute)
905
- root.setFlexGrow(1)
906
- root.setWidth(110)
907
- root.setHeight(100)
908
-
909
- const root_child0 = Yoga.Node.create(config)
910
- root_child0.setPositionType(PositionType.Absolute)
911
- root_child0.setPosition(Edge.Left, 5)
912
- root_child0.setWidth(60)
913
- root_child0.setHeight(40)
914
- root.insertChild(root_child0, 0)
915
- root.calculateLayout(undefined, undefined, Direction.LTR)
916
-
917
- expect(root.getComputedLeft()).toBe(0)
918
- expect(root.getComputedTop()).toBe(0)
919
- expect(root.getComputedWidth()).toBe(110)
920
- expect(root.getComputedHeight()).toBe(100)
921
-
922
- expect(root_child0.getComputedLeft()).toBe(5)
923
- expect(root_child0.getComputedTop()).toBe(30)
924
- expect(root_child0.getComputedWidth()).toBe(60)
925
- expect(root_child0.getComputedHeight()).toBe(40)
926
-
927
- root.calculateLayout(undefined, undefined, Direction.RTL)
928
-
929
- expect(root.getComputedLeft()).toBe(0)
930
- expect(root.getComputedTop()).toBe(0)
931
- expect(root.getComputedWidth()).toBe(110)
932
- expect(root.getComputedHeight()).toBe(100)
933
-
934
- expect(root_child0.getComputedLeft()).toBe(5)
935
- expect(root_child0.getComputedTop()).toBe(30)
936
- expect(root_child0.getComputedWidth()).toBe(60)
937
- expect(root_child0.getComputedHeight()).toBe(40)
938
- } finally {
939
- if (typeof root !== "undefined") {
940
- root.freeRecursive()
941
- }
942
-
943
- config.free()
944
- }
945
- })
946
- test("absolute_layout_align_items_and_justify_content_center_and_right_position", () => {
947
- const config = Yoga.Config.create()
948
- let root
949
-
950
- try {
951
- root = Yoga.Node.create(config)
952
- root.setJustifyContent(Justify.Center)
953
- root.setAlignItems(Align.Center)
954
- root.setPositionType(PositionType.Absolute)
955
- root.setFlexGrow(1)
956
- root.setWidth(110)
957
- root.setHeight(100)
958
-
959
- const root_child0 = Yoga.Node.create(config)
960
- root_child0.setPositionType(PositionType.Absolute)
961
- root_child0.setPosition(Edge.Right, 5)
962
- root_child0.setWidth(60)
963
- root_child0.setHeight(40)
964
- root.insertChild(root_child0, 0)
965
- root.calculateLayout(undefined, undefined, Direction.LTR)
966
-
967
- expect(root.getComputedLeft()).toBe(0)
968
- expect(root.getComputedTop()).toBe(0)
969
- expect(root.getComputedWidth()).toBe(110)
970
- expect(root.getComputedHeight()).toBe(100)
971
-
972
- expect(root_child0.getComputedLeft()).toBe(45)
973
- expect(root_child0.getComputedTop()).toBe(30)
974
- expect(root_child0.getComputedWidth()).toBe(60)
975
- expect(root_child0.getComputedHeight()).toBe(40)
976
-
977
- root.calculateLayout(undefined, undefined, Direction.RTL)
978
-
979
- expect(root.getComputedLeft()).toBe(0)
980
- expect(root.getComputedTop()).toBe(0)
981
- expect(root.getComputedWidth()).toBe(110)
982
- expect(root.getComputedHeight()).toBe(100)
983
-
984
- expect(root_child0.getComputedLeft()).toBe(45)
985
- expect(root_child0.getComputedTop()).toBe(30)
986
- expect(root_child0.getComputedWidth()).toBe(60)
987
- expect(root_child0.getComputedHeight()).toBe(40)
988
- } finally {
989
- if (typeof root !== "undefined") {
990
- root.freeRecursive()
991
- }
992
-
993
- config.free()
994
- }
995
- })
996
- test("position_root_with_rtl_should_position_withoutdirection", () => {
997
- const config = Yoga.Config.create()
998
- let root
999
-
1000
- try {
1001
- root = Yoga.Node.create(config)
1002
- root.setPositionType(PositionType.Absolute)
1003
- root.setPosition(Edge.Left, 72)
1004
- root.setWidth(52)
1005
- root.setHeight(52)
1006
- root.calculateLayout(undefined, undefined, Direction.LTR)
1007
-
1008
- expect(root.getComputedLeft()).toBe(72)
1009
- expect(root.getComputedTop()).toBe(0)
1010
- expect(root.getComputedWidth()).toBe(52)
1011
- expect(root.getComputedHeight()).toBe(52)
1012
-
1013
- root.calculateLayout(undefined, undefined, Direction.RTL)
1014
-
1015
- expect(root.getComputedLeft()).toBe(72)
1016
- expect(root.getComputedTop()).toBe(0)
1017
- expect(root.getComputedWidth()).toBe(52)
1018
- expect(root.getComputedHeight()).toBe(52)
1019
- } finally {
1020
- if (typeof root !== "undefined") {
1021
- root.freeRecursive()
1022
- }
1023
-
1024
- config.free()
1025
- }
1026
- })
1027
- test("absolute_layout_percentage_bottom_based_on_parent_height", () => {
1028
- const config = Yoga.Config.create()
1029
- let root
1030
-
1031
- try {
1032
- root = Yoga.Node.create(config)
1033
- root.setPositionType(PositionType.Absolute)
1034
- root.setWidth(100)
1035
- root.setHeight(200)
1036
-
1037
- const root_child0 = Yoga.Node.create(config)
1038
- root_child0.setPositionType(PositionType.Absolute)
1039
- root_child0.setPosition(Edge.Top, "50%")
1040
- root_child0.setWidth(10)
1041
- root_child0.setHeight(10)
1042
- root.insertChild(root_child0, 0)
1043
-
1044
- const root_child1 = Yoga.Node.create(config)
1045
- root_child1.setPositionType(PositionType.Absolute)
1046
- root_child1.setPosition(Edge.Bottom, "50%")
1047
- root_child1.setWidth(10)
1048
- root_child1.setHeight(10)
1049
- root.insertChild(root_child1, 1)
1050
-
1051
- const root_child2 = Yoga.Node.create(config)
1052
- root_child2.setPositionType(PositionType.Absolute)
1053
- root_child2.setPosition(Edge.Top, "10%")
1054
- root_child2.setPosition(Edge.Bottom, "10%")
1055
- root_child2.setWidth(10)
1056
- root.insertChild(root_child2, 2)
1057
- root.calculateLayout(undefined, undefined, Direction.LTR)
1058
-
1059
- expect(root.getComputedLeft()).toBe(0)
1060
- expect(root.getComputedTop()).toBe(0)
1061
- expect(root.getComputedWidth()).toBe(100)
1062
- expect(root.getComputedHeight()).toBe(200)
1063
-
1064
- expect(root_child0.getComputedLeft()).toBe(0)
1065
- expect(root_child0.getComputedTop()).toBe(100)
1066
- expect(root_child0.getComputedWidth()).toBe(10)
1067
- expect(root_child0.getComputedHeight()).toBe(10)
1068
-
1069
- expect(root_child1.getComputedLeft()).toBe(0)
1070
- expect(root_child1.getComputedTop()).toBe(90)
1071
- expect(root_child1.getComputedWidth()).toBe(10)
1072
- expect(root_child1.getComputedHeight()).toBe(10)
1073
-
1074
- expect(root_child2.getComputedLeft()).toBe(0)
1075
- expect(root_child2.getComputedTop()).toBe(20)
1076
- expect(root_child2.getComputedWidth()).toBe(10)
1077
- expect(root_child2.getComputedHeight()).toBe(160)
1078
-
1079
- root.calculateLayout(undefined, undefined, Direction.RTL)
1080
-
1081
- expect(root.getComputedLeft()).toBe(0)
1082
- expect(root.getComputedTop()).toBe(0)
1083
- expect(root.getComputedWidth()).toBe(100)
1084
- expect(root.getComputedHeight()).toBe(200)
1085
-
1086
- expect(root_child0.getComputedLeft()).toBe(90)
1087
- expect(root_child0.getComputedTop()).toBe(100)
1088
- expect(root_child0.getComputedWidth()).toBe(10)
1089
- expect(root_child0.getComputedHeight()).toBe(10)
1090
-
1091
- expect(root_child1.getComputedLeft()).toBe(90)
1092
- expect(root_child1.getComputedTop()).toBe(90)
1093
- expect(root_child1.getComputedWidth()).toBe(10)
1094
- expect(root_child1.getComputedHeight()).toBe(10)
1095
-
1096
- expect(root_child2.getComputedLeft()).toBe(90)
1097
- expect(root_child2.getComputedTop()).toBe(20)
1098
- expect(root_child2.getComputedWidth()).toBe(10)
1099
- expect(root_child2.getComputedHeight()).toBe(160)
1100
- } finally {
1101
- if (typeof root !== "undefined") {
1102
- root.freeRecursive()
1103
- }
1104
-
1105
- config.free()
1106
- }
1107
- })
1108
- test("absolute_layout_in_wrap_reverse_column_container", () => {
1109
- const config = Yoga.Config.create()
1110
- let root
1111
-
1112
- try {
1113
- root = Yoga.Node.create(config)
1114
- root.setPositionType(PositionType.Absolute)
1115
- root.setFlexWrap(Wrap.WrapReverse)
1116
- root.setWidth(100)
1117
- root.setHeight(100)
1118
-
1119
- const root_child0 = Yoga.Node.create(config)
1120
- root_child0.setPositionType(PositionType.Absolute)
1121
- root_child0.setWidth(20)
1122
- root_child0.setHeight(20)
1123
- root.insertChild(root_child0, 0)
1124
- root.calculateLayout(undefined, undefined, Direction.LTR)
1125
-
1126
- expect(root.getComputedLeft()).toBe(0)
1127
- expect(root.getComputedTop()).toBe(0)
1128
- expect(root.getComputedWidth()).toBe(100)
1129
- expect(root.getComputedHeight()).toBe(100)
1130
-
1131
- expect(root_child0.getComputedLeft()).toBe(80)
1132
- expect(root_child0.getComputedTop()).toBe(0)
1133
- expect(root_child0.getComputedWidth()).toBe(20)
1134
- expect(root_child0.getComputedHeight()).toBe(20)
1135
-
1136
- root.calculateLayout(undefined, undefined, Direction.RTL)
1137
-
1138
- expect(root.getComputedLeft()).toBe(0)
1139
- expect(root.getComputedTop()).toBe(0)
1140
- expect(root.getComputedWidth()).toBe(100)
1141
- expect(root.getComputedHeight()).toBe(100)
1142
-
1143
- expect(root_child0.getComputedLeft()).toBe(0)
1144
- expect(root_child0.getComputedTop()).toBe(0)
1145
- expect(root_child0.getComputedWidth()).toBe(20)
1146
- expect(root_child0.getComputedHeight()).toBe(20)
1147
- } finally {
1148
- if (typeof root !== "undefined") {
1149
- root.freeRecursive()
1150
- }
1151
-
1152
- config.free()
1153
- }
1154
- })
1155
- test("absolute_layout_in_wrap_reverse_row_container", () => {
1156
- const config = Yoga.Config.create()
1157
- let root
1158
-
1159
- try {
1160
- root = Yoga.Node.create(config)
1161
- root.setFlexDirection(FlexDirection.Row)
1162
- root.setPositionType(PositionType.Absolute)
1163
- root.setFlexWrap(Wrap.WrapReverse)
1164
- root.setWidth(100)
1165
- root.setHeight(100)
1166
-
1167
- const root_child0 = Yoga.Node.create(config)
1168
- root_child0.setPositionType(PositionType.Absolute)
1169
- root_child0.setWidth(20)
1170
- root_child0.setHeight(20)
1171
- root.insertChild(root_child0, 0)
1172
- root.calculateLayout(undefined, undefined, Direction.LTR)
1173
-
1174
- expect(root.getComputedLeft()).toBe(0)
1175
- expect(root.getComputedTop()).toBe(0)
1176
- expect(root.getComputedWidth()).toBe(100)
1177
- expect(root.getComputedHeight()).toBe(100)
1178
-
1179
- expect(root_child0.getComputedLeft()).toBe(0)
1180
- expect(root_child0.getComputedTop()).toBe(80)
1181
- expect(root_child0.getComputedWidth()).toBe(20)
1182
- expect(root_child0.getComputedHeight()).toBe(20)
1183
-
1184
- root.calculateLayout(undefined, undefined, Direction.RTL)
1185
-
1186
- expect(root.getComputedLeft()).toBe(0)
1187
- expect(root.getComputedTop()).toBe(0)
1188
- expect(root.getComputedWidth()).toBe(100)
1189
- expect(root.getComputedHeight()).toBe(100)
1190
-
1191
- expect(root_child0.getComputedLeft()).toBe(80)
1192
- expect(root_child0.getComputedTop()).toBe(80)
1193
- expect(root_child0.getComputedWidth()).toBe(20)
1194
- expect(root_child0.getComputedHeight()).toBe(20)
1195
- } finally {
1196
- if (typeof root !== "undefined") {
1197
- root.freeRecursive()
1198
- }
1199
-
1200
- config.free()
1201
- }
1202
- })
1203
- test("absolute_layout_in_wrap_reverse_column_container_flex_end", () => {
1204
- const config = Yoga.Config.create()
1205
- let root
1206
-
1207
- try {
1208
- root = Yoga.Node.create(config)
1209
- root.setPositionType(PositionType.Absolute)
1210
- root.setFlexWrap(Wrap.WrapReverse)
1211
- root.setWidth(100)
1212
- root.setHeight(100)
1213
-
1214
- const root_child0 = Yoga.Node.create(config)
1215
- root_child0.setAlignSelf(Align.FlexEnd)
1216
- root_child0.setPositionType(PositionType.Absolute)
1217
- root_child0.setWidth(20)
1218
- root_child0.setHeight(20)
1219
- root.insertChild(root_child0, 0)
1220
- root.calculateLayout(undefined, undefined, Direction.LTR)
1221
-
1222
- expect(root.getComputedLeft()).toBe(0)
1223
- expect(root.getComputedTop()).toBe(0)
1224
- expect(root.getComputedWidth()).toBe(100)
1225
- expect(root.getComputedHeight()).toBe(100)
1226
-
1227
- expect(root_child0.getComputedLeft()).toBe(0)
1228
- expect(root_child0.getComputedTop()).toBe(0)
1229
- expect(root_child0.getComputedWidth()).toBe(20)
1230
- expect(root_child0.getComputedHeight()).toBe(20)
1231
-
1232
- root.calculateLayout(undefined, undefined, Direction.RTL)
1233
-
1234
- expect(root.getComputedLeft()).toBe(0)
1235
- expect(root.getComputedTop()).toBe(0)
1236
- expect(root.getComputedWidth()).toBe(100)
1237
- expect(root.getComputedHeight()).toBe(100)
1238
-
1239
- expect(root_child0.getComputedLeft()).toBe(80)
1240
- expect(root_child0.getComputedTop()).toBe(0)
1241
- expect(root_child0.getComputedWidth()).toBe(20)
1242
- expect(root_child0.getComputedHeight()).toBe(20)
1243
- } finally {
1244
- if (typeof root !== "undefined") {
1245
- root.freeRecursive()
1246
- }
1247
-
1248
- config.free()
1249
- }
1250
- })
1251
- test("absolute_layout_in_wrap_reverse_row_container_flex_end", () => {
1252
- const config = Yoga.Config.create()
1253
- let root
1254
-
1255
- try {
1256
- root = Yoga.Node.create(config)
1257
- root.setFlexDirection(FlexDirection.Row)
1258
- root.setPositionType(PositionType.Absolute)
1259
- root.setFlexWrap(Wrap.WrapReverse)
1260
- root.setWidth(100)
1261
- root.setHeight(100)
1262
-
1263
- const root_child0 = Yoga.Node.create(config)
1264
- root_child0.setAlignSelf(Align.FlexEnd)
1265
- root_child0.setPositionType(PositionType.Absolute)
1266
- root_child0.setWidth(20)
1267
- root_child0.setHeight(20)
1268
- root.insertChild(root_child0, 0)
1269
- root.calculateLayout(undefined, undefined, Direction.LTR)
1270
-
1271
- expect(root.getComputedLeft()).toBe(0)
1272
- expect(root.getComputedTop()).toBe(0)
1273
- expect(root.getComputedWidth()).toBe(100)
1274
- expect(root.getComputedHeight()).toBe(100)
1275
-
1276
- expect(root_child0.getComputedLeft()).toBe(0)
1277
- expect(root_child0.getComputedTop()).toBe(0)
1278
- expect(root_child0.getComputedWidth()).toBe(20)
1279
- expect(root_child0.getComputedHeight()).toBe(20)
1280
-
1281
- root.calculateLayout(undefined, undefined, Direction.RTL)
1282
-
1283
- expect(root.getComputedLeft()).toBe(0)
1284
- expect(root.getComputedTop()).toBe(0)
1285
- expect(root.getComputedWidth()).toBe(100)
1286
- expect(root.getComputedHeight()).toBe(100)
1287
-
1288
- expect(root_child0.getComputedLeft()).toBe(80)
1289
- expect(root_child0.getComputedTop()).toBe(0)
1290
- expect(root_child0.getComputedWidth()).toBe(20)
1291
- expect(root_child0.getComputedHeight()).toBe(20)
1292
- } finally {
1293
- if (typeof root !== "undefined") {
1294
- root.freeRecursive()
1295
- }
1296
-
1297
- config.free()
1298
- }
1299
- })
1300
- test("percent_absolute_position_infinite_height", () => {
1301
- const config = Yoga.Config.create()
1302
- let root
1303
-
1304
- try {
1305
- root = Yoga.Node.create(config)
1306
- root.setPositionType(PositionType.Absolute)
1307
- root.setWidth(300)
1308
-
1309
- const root_child0 = Yoga.Node.create(config)
1310
- root_child0.setWidth(300)
1311
- root.insertChild(root_child0, 0)
1312
-
1313
- const root_child1 = Yoga.Node.create(config)
1314
- root_child1.setPositionType(PositionType.Absolute)
1315
- root_child1.setPosition(Edge.Left, "20%")
1316
- root_child1.setPosition(Edge.Top, "20%")
1317
- root_child1.setWidth("20%")
1318
- root_child1.setHeight("20%")
1319
- root.insertChild(root_child1, 1)
1320
- root.calculateLayout(undefined, undefined, Direction.LTR)
1321
-
1322
- expect(root.getComputedLeft()).toBe(0)
1323
- expect(root.getComputedTop()).toBe(0)
1324
- expect(root.getComputedWidth()).toBe(300)
1325
- expect(root.getComputedHeight()).toBe(0)
1326
-
1327
- expect(root_child0.getComputedLeft()).toBe(0)
1328
- expect(root_child0.getComputedTop()).toBe(0)
1329
- expect(root_child0.getComputedWidth()).toBe(300)
1330
- expect(root_child0.getComputedHeight()).toBe(0)
1331
-
1332
- expect(root_child1.getComputedLeft()).toBe(60)
1333
- expect(root_child1.getComputedTop()).toBe(0)
1334
- expect(root_child1.getComputedWidth()).toBe(60)
1335
- expect(root_child1.getComputedHeight()).toBe(0)
1336
-
1337
- root.calculateLayout(undefined, undefined, Direction.RTL)
1338
-
1339
- expect(root.getComputedLeft()).toBe(0)
1340
- expect(root.getComputedTop()).toBe(0)
1341
- expect(root.getComputedWidth()).toBe(300)
1342
- expect(root.getComputedHeight()).toBe(0)
1343
-
1344
- expect(root_child0.getComputedLeft()).toBe(0)
1345
- expect(root_child0.getComputedTop()).toBe(0)
1346
- expect(root_child0.getComputedWidth()).toBe(300)
1347
- expect(root_child0.getComputedHeight()).toBe(0)
1348
-
1349
- expect(root_child1.getComputedLeft()).toBe(60)
1350
- expect(root_child1.getComputedTop()).toBe(0)
1351
- expect(root_child1.getComputedWidth()).toBe(60)
1352
- expect(root_child1.getComputedHeight()).toBe(0)
1353
- } finally {
1354
- if (typeof root !== "undefined") {
1355
- root.freeRecursive()
1356
- }
1357
-
1358
- config.free()
1359
- }
1360
- })
1361
- test("absolute_layout_percentage_height_based_on_padded_parent", () => {
1362
- const config = Yoga.Config.create()
1363
- let root
1364
-
1365
- try {
1366
- root = Yoga.Node.create(config)
1367
- root.setPositionType(PositionType.Absolute)
1368
- root.setPadding(Edge.Top, 10)
1369
- root.setBorder(Edge.Top, 10)
1370
- root.setWidth(100)
1371
- root.setHeight(100)
1372
-
1373
- const root_child0 = Yoga.Node.create(config)
1374
- root_child0.setPositionType(PositionType.Absolute)
1375
- root_child0.setWidth(100)
1376
- root_child0.setHeight("50%")
1377
- root.insertChild(root_child0, 0)
1378
- root.calculateLayout(undefined, undefined, Direction.LTR)
1379
-
1380
- expect(root.getComputedLeft()).toBe(0)
1381
- expect(root.getComputedTop()).toBe(0)
1382
- expect(root.getComputedWidth()).toBe(100)
1383
- expect(root.getComputedHeight()).toBe(100)
1384
-
1385
- expect(root_child0.getComputedLeft()).toBe(0)
1386
- expect(root_child0.getComputedTop()).toBe(20)
1387
- expect(root_child0.getComputedWidth()).toBe(100)
1388
- expect(root_child0.getComputedHeight()).toBe(45)
1389
-
1390
- root.calculateLayout(undefined, undefined, Direction.RTL)
1391
-
1392
- expect(root.getComputedLeft()).toBe(0)
1393
- expect(root.getComputedTop()).toBe(0)
1394
- expect(root.getComputedWidth()).toBe(100)
1395
- expect(root.getComputedHeight()).toBe(100)
1396
-
1397
- expect(root_child0.getComputedLeft()).toBe(0)
1398
- expect(root_child0.getComputedTop()).toBe(20)
1399
- expect(root_child0.getComputedWidth()).toBe(100)
1400
- expect(root_child0.getComputedHeight()).toBe(45)
1401
- } finally {
1402
- if (typeof root !== "undefined") {
1403
- root.freeRecursive()
1404
- }
1405
-
1406
- config.free()
1407
- }
1408
- })
1409
- test("absolute_layout_percentage_height_based_on_padded_parent_and_align_items_center", () => {
1410
- const config = Yoga.Config.create()
1411
- let root
1412
-
1413
- try {
1414
- root = Yoga.Node.create(config)
1415
- root.setJustifyContent(Justify.Center)
1416
- root.setAlignItems(Align.Center)
1417
- root.setPadding(Edge.Top, 20)
1418
- root.setPadding(Edge.Bottom, 20)
1419
- root.setWidth(100)
1420
- root.setHeight(100)
1421
-
1422
- const root_child0 = Yoga.Node.create(config)
1423
- root_child0.setPositionType(PositionType.Absolute)
1424
- root_child0.setWidth(100)
1425
- root_child0.setHeight("50%")
1426
- root.insertChild(root_child0, 0)
1427
- root.calculateLayout(undefined, undefined, Direction.LTR)
1428
-
1429
- expect(root.getComputedLeft()).toBe(0)
1430
- expect(root.getComputedTop()).toBe(0)
1431
- expect(root.getComputedWidth()).toBe(100)
1432
- expect(root.getComputedHeight()).toBe(100)
1433
-
1434
- expect(root_child0.getComputedLeft()).toBe(0)
1435
- expect(root_child0.getComputedTop()).toBe(25)
1436
- expect(root_child0.getComputedWidth()).toBe(100)
1437
- expect(root_child0.getComputedHeight()).toBe(50)
1438
-
1439
- root.calculateLayout(undefined, undefined, Direction.RTL)
1440
-
1441
- expect(root.getComputedLeft()).toBe(0)
1442
- expect(root.getComputedTop()).toBe(0)
1443
- expect(root.getComputedWidth()).toBe(100)
1444
- expect(root.getComputedHeight()).toBe(100)
1445
-
1446
- expect(root_child0.getComputedLeft()).toBe(0)
1447
- expect(root_child0.getComputedTop()).toBe(25)
1448
- expect(root_child0.getComputedWidth()).toBe(100)
1449
- expect(root_child0.getComputedHeight()).toBe(50)
1450
- } finally {
1451
- if (typeof root !== "undefined") {
1452
- root.freeRecursive()
1453
- }
1454
-
1455
- config.free()
1456
- }
1457
- })
1458
- test("absolute_layout_padding_left", () => {
1459
- const config = Yoga.Config.create()
1460
- let root
1461
-
1462
- try {
1463
- root = Yoga.Node.create(config)
1464
- root.setPositionType(PositionType.Absolute)
1465
- root.setPadding(Edge.Left, 100)
1466
- root.setWidth(200)
1467
- root.setHeight(200)
1468
-
1469
- const root_child0 = Yoga.Node.create(config)
1470
- root_child0.setPositionType(PositionType.Absolute)
1471
- root_child0.setWidth(50)
1472
- root_child0.setHeight(50)
1473
- root.insertChild(root_child0, 0)
1474
- root.calculateLayout(undefined, undefined, Direction.LTR)
1475
-
1476
- expect(root.getComputedLeft()).toBe(0)
1477
- expect(root.getComputedTop()).toBe(0)
1478
- expect(root.getComputedWidth()).toBe(200)
1479
- expect(root.getComputedHeight()).toBe(200)
1480
-
1481
- expect(root_child0.getComputedLeft()).toBe(100)
1482
- expect(root_child0.getComputedTop()).toBe(0)
1483
- expect(root_child0.getComputedWidth()).toBe(50)
1484
- expect(root_child0.getComputedHeight()).toBe(50)
1485
-
1486
- root.calculateLayout(undefined, undefined, Direction.RTL)
1487
-
1488
- expect(root.getComputedLeft()).toBe(0)
1489
- expect(root.getComputedTop()).toBe(0)
1490
- expect(root.getComputedWidth()).toBe(200)
1491
- expect(root.getComputedHeight()).toBe(200)
1492
-
1493
- expect(root_child0.getComputedLeft()).toBe(150)
1494
- expect(root_child0.getComputedTop()).toBe(0)
1495
- expect(root_child0.getComputedWidth()).toBe(50)
1496
- expect(root_child0.getComputedHeight()).toBe(50)
1497
- } finally {
1498
- if (typeof root !== "undefined") {
1499
- root.freeRecursive()
1500
- }
1501
-
1502
- config.free()
1503
- }
1504
- })
1505
- test("absolute_layout_padding_right", () => {
1506
- const config = Yoga.Config.create()
1507
- let root
1508
-
1509
- try {
1510
- root = Yoga.Node.create(config)
1511
- root.setPositionType(PositionType.Absolute)
1512
- root.setPadding(Edge.Right, 100)
1513
- root.setWidth(200)
1514
- root.setHeight(200)
1515
-
1516
- const root_child0 = Yoga.Node.create(config)
1517
- root_child0.setPositionType(PositionType.Absolute)
1518
- root_child0.setWidth(50)
1519
- root_child0.setHeight(50)
1520
- root.insertChild(root_child0, 0)
1521
- root.calculateLayout(undefined, undefined, Direction.LTR)
1522
-
1523
- expect(root.getComputedLeft()).toBe(0)
1524
- expect(root.getComputedTop()).toBe(0)
1525
- expect(root.getComputedWidth()).toBe(200)
1526
- expect(root.getComputedHeight()).toBe(200)
1527
-
1528
- expect(root_child0.getComputedLeft()).toBe(0)
1529
- expect(root_child0.getComputedTop()).toBe(0)
1530
- expect(root_child0.getComputedWidth()).toBe(50)
1531
- expect(root_child0.getComputedHeight()).toBe(50)
1532
-
1533
- root.calculateLayout(undefined, undefined, Direction.RTL)
1534
-
1535
- expect(root.getComputedLeft()).toBe(0)
1536
- expect(root.getComputedTop()).toBe(0)
1537
- expect(root.getComputedWidth()).toBe(200)
1538
- expect(root.getComputedHeight()).toBe(200)
1539
-
1540
- expect(root_child0.getComputedLeft()).toBe(50)
1541
- expect(root_child0.getComputedTop()).toBe(0)
1542
- expect(root_child0.getComputedWidth()).toBe(50)
1543
- expect(root_child0.getComputedHeight()).toBe(50)
1544
- } finally {
1545
- if (typeof root !== "undefined") {
1546
- root.freeRecursive()
1547
- }
1548
-
1549
- config.free()
1550
- }
1551
- })
1552
- test("absolute_layout_padding_top", () => {
1553
- const config = Yoga.Config.create()
1554
- let root
1555
-
1556
- try {
1557
- root = Yoga.Node.create(config)
1558
- root.setPositionType(PositionType.Absolute)
1559
- root.setPadding(Edge.Top, 100)
1560
- root.setWidth(200)
1561
- root.setHeight(200)
1562
-
1563
- const root_child0 = Yoga.Node.create(config)
1564
- root_child0.setPositionType(PositionType.Absolute)
1565
- root_child0.setWidth(50)
1566
- root_child0.setHeight(50)
1567
- root.insertChild(root_child0, 0)
1568
- root.calculateLayout(undefined, undefined, Direction.LTR)
1569
-
1570
- expect(root.getComputedLeft()).toBe(0)
1571
- expect(root.getComputedTop()).toBe(0)
1572
- expect(root.getComputedWidth()).toBe(200)
1573
- expect(root.getComputedHeight()).toBe(200)
1574
-
1575
- expect(root_child0.getComputedLeft()).toBe(0)
1576
- expect(root_child0.getComputedTop()).toBe(100)
1577
- expect(root_child0.getComputedWidth()).toBe(50)
1578
- expect(root_child0.getComputedHeight()).toBe(50)
1579
-
1580
- root.calculateLayout(undefined, undefined, Direction.RTL)
1581
-
1582
- expect(root.getComputedLeft()).toBe(0)
1583
- expect(root.getComputedTop()).toBe(0)
1584
- expect(root.getComputedWidth()).toBe(200)
1585
- expect(root.getComputedHeight()).toBe(200)
1586
-
1587
- expect(root_child0.getComputedLeft()).toBe(150)
1588
- expect(root_child0.getComputedTop()).toBe(100)
1589
- expect(root_child0.getComputedWidth()).toBe(50)
1590
- expect(root_child0.getComputedHeight()).toBe(50)
1591
- } finally {
1592
- if (typeof root !== "undefined") {
1593
- root.freeRecursive()
1594
- }
1595
-
1596
- config.free()
1597
- }
1598
- })
1599
- test("absolute_layout_padding_bottom", () => {
1600
- const config = Yoga.Config.create()
1601
- let root
1602
-
1603
- try {
1604
- root = Yoga.Node.create(config)
1605
- root.setPositionType(PositionType.Absolute)
1606
- root.setPadding(Edge.Bottom, 100)
1607
- root.setWidth(200)
1608
- root.setHeight(200)
1609
-
1610
- const root_child0 = Yoga.Node.create(config)
1611
- root_child0.setPositionType(PositionType.Absolute)
1612
- root_child0.setWidth(50)
1613
- root_child0.setHeight(50)
1614
- root.insertChild(root_child0, 0)
1615
- root.calculateLayout(undefined, undefined, Direction.LTR)
1616
-
1617
- expect(root.getComputedLeft()).toBe(0)
1618
- expect(root.getComputedTop()).toBe(0)
1619
- expect(root.getComputedWidth()).toBe(200)
1620
- expect(root.getComputedHeight()).toBe(200)
1621
-
1622
- expect(root_child0.getComputedLeft()).toBe(0)
1623
- expect(root_child0.getComputedTop()).toBe(0)
1624
- expect(root_child0.getComputedWidth()).toBe(50)
1625
- expect(root_child0.getComputedHeight()).toBe(50)
1626
-
1627
- root.calculateLayout(undefined, undefined, Direction.RTL)
1628
-
1629
- expect(root.getComputedLeft()).toBe(0)
1630
- expect(root.getComputedTop()).toBe(0)
1631
- expect(root.getComputedWidth()).toBe(200)
1632
- expect(root.getComputedHeight()).toBe(200)
1633
-
1634
- expect(root_child0.getComputedLeft()).toBe(150)
1635
- expect(root_child0.getComputedTop()).toBe(0)
1636
- expect(root_child0.getComputedWidth()).toBe(50)
1637
- expect(root_child0.getComputedHeight()).toBe(50)
1638
- } finally {
1639
- if (typeof root !== "undefined") {
1640
- root.freeRecursive()
1641
- }
1642
-
1643
- config.free()
1644
- }
1645
- })
1646
- test("absolute_layout_padding", () => {
1647
- const config = Yoga.Config.create()
1648
- let root
1649
-
1650
- try {
1651
- root = Yoga.Node.create(config)
1652
- root.setPositionType(PositionType.Absolute)
1653
-
1654
- const root_child0 = Yoga.Node.create(config)
1655
- root_child0.setMargin(Edge.Left, 10)
1656
- root_child0.setMargin(Edge.Top, 10)
1657
- root_child0.setMargin(Edge.Right, 10)
1658
- root_child0.setMargin(Edge.Bottom, 10)
1659
- root_child0.setWidth(200)
1660
- root_child0.setHeight(200)
1661
- root.insertChild(root_child0, 0)
1662
-
1663
- const root_child0_child0 = Yoga.Node.create(config)
1664
- root_child0_child0.setPositionType(PositionType.Static)
1665
- root_child0_child0.setPadding(Edge.Left, 50)
1666
- root_child0_child0.setPadding(Edge.Top, 50)
1667
- root_child0_child0.setPadding(Edge.Right, 50)
1668
- root_child0_child0.setPadding(Edge.Bottom, 50)
1669
- root_child0_child0.setWidth(200)
1670
- root_child0_child0.setHeight(200)
1671
- root_child0.insertChild(root_child0_child0, 0)
1672
-
1673
- const root_child0_child0_child0 = Yoga.Node.create(config)
1674
- root_child0_child0_child0.setPositionType(PositionType.Absolute)
1675
- root_child0_child0_child0.setWidth(50)
1676
- root_child0_child0_child0.setHeight(50)
1677
- root_child0_child0.insertChild(root_child0_child0_child0, 0)
1678
- root.calculateLayout(undefined, undefined, Direction.LTR)
1679
-
1680
- expect(root.getComputedLeft()).toBe(0)
1681
- expect(root.getComputedTop()).toBe(0)
1682
- expect(root.getComputedWidth()).toBe(220)
1683
- expect(root.getComputedHeight()).toBe(220)
1684
-
1685
- expect(root_child0.getComputedLeft()).toBe(10)
1686
- expect(root_child0.getComputedTop()).toBe(10)
1687
- expect(root_child0.getComputedWidth()).toBe(200)
1688
- expect(root_child0.getComputedHeight()).toBe(200)
1689
-
1690
- expect(root_child0_child0.getComputedLeft()).toBe(0)
1691
- expect(root_child0_child0.getComputedTop()).toBe(0)
1692
- expect(root_child0_child0.getComputedWidth()).toBe(200)
1693
- expect(root_child0_child0.getComputedHeight()).toBe(200)
1694
-
1695
- expect(root_child0_child0_child0.getComputedLeft()).toBe(50)
1696
- expect(root_child0_child0_child0.getComputedTop()).toBe(50)
1697
- expect(root_child0_child0_child0.getComputedWidth()).toBe(50)
1698
- expect(root_child0_child0_child0.getComputedHeight()).toBe(50)
1699
-
1700
- root.calculateLayout(undefined, undefined, Direction.RTL)
1701
-
1702
- expect(root.getComputedLeft()).toBe(0)
1703
- expect(root.getComputedTop()).toBe(0)
1704
- expect(root.getComputedWidth()).toBe(220)
1705
- expect(root.getComputedHeight()).toBe(220)
1706
-
1707
- expect(root_child0.getComputedLeft()).toBe(10)
1708
- expect(root_child0.getComputedTop()).toBe(10)
1709
- expect(root_child0.getComputedWidth()).toBe(200)
1710
- expect(root_child0.getComputedHeight()).toBe(200)
1711
-
1712
- expect(root_child0_child0.getComputedLeft()).toBe(0)
1713
- expect(root_child0_child0.getComputedTop()).toBe(0)
1714
- expect(root_child0_child0.getComputedWidth()).toBe(200)
1715
- expect(root_child0_child0.getComputedHeight()).toBe(200)
1716
-
1717
- expect(root_child0_child0_child0.getComputedLeft()).toBe(100)
1718
- expect(root_child0_child0_child0.getComputedTop()).toBe(50)
1719
- expect(root_child0_child0_child0.getComputedWidth()).toBe(50)
1720
- expect(root_child0_child0_child0.getComputedHeight()).toBe(50)
1721
- } finally {
1722
- if (typeof root !== "undefined") {
1723
- root.freeRecursive()
1724
- }
1725
-
1726
- config.free()
1727
- }
1728
- })
1729
- test("absolute_layout_border", () => {
1730
- const config = Yoga.Config.create()
1731
- let root
1732
-
1733
- try {
1734
- root = Yoga.Node.create(config)
1735
- root.setPositionType(PositionType.Absolute)
1736
-
1737
- const root_child0 = Yoga.Node.create(config)
1738
- root_child0.setMargin(Edge.Left, 10)
1739
- root_child0.setMargin(Edge.Top, 10)
1740
- root_child0.setMargin(Edge.Right, 10)
1741
- root_child0.setMargin(Edge.Bottom, 10)
1742
- root_child0.setWidth(200)
1743
- root_child0.setHeight(200)
1744
- root.insertChild(root_child0, 0)
1745
-
1746
- const root_child0_child0 = Yoga.Node.create(config)
1747
- root_child0_child0.setPositionType(PositionType.Static)
1748
- root_child0_child0.setBorder(Edge.Left, 10)
1749
- root_child0_child0.setBorder(Edge.Top, 10)
1750
- root_child0_child0.setBorder(Edge.Right, 10)
1751
- root_child0_child0.setBorder(Edge.Bottom, 10)
1752
- root_child0_child0.setWidth(200)
1753
- root_child0_child0.setHeight(200)
1754
- root_child0.insertChild(root_child0_child0, 0)
1755
-
1756
- const root_child0_child0_child0 = Yoga.Node.create(config)
1757
- root_child0_child0_child0.setPositionType(PositionType.Absolute)
1758
- root_child0_child0_child0.setWidth(50)
1759
- root_child0_child0_child0.setHeight(50)
1760
- root_child0_child0.insertChild(root_child0_child0_child0, 0)
1761
- root.calculateLayout(undefined, undefined, Direction.LTR)
1762
-
1763
- expect(root.getComputedLeft()).toBe(0)
1764
- expect(root.getComputedTop()).toBe(0)
1765
- expect(root.getComputedWidth()).toBe(220)
1766
- expect(root.getComputedHeight()).toBe(220)
1767
-
1768
- expect(root_child0.getComputedLeft()).toBe(10)
1769
- expect(root_child0.getComputedTop()).toBe(10)
1770
- expect(root_child0.getComputedWidth()).toBe(200)
1771
- expect(root_child0.getComputedHeight()).toBe(200)
1772
-
1773
- expect(root_child0_child0.getComputedLeft()).toBe(0)
1774
- expect(root_child0_child0.getComputedTop()).toBe(0)
1775
- expect(root_child0_child0.getComputedWidth()).toBe(200)
1776
- expect(root_child0_child0.getComputedHeight()).toBe(200)
1777
-
1778
- expect(root_child0_child0_child0.getComputedLeft()).toBe(10)
1779
- expect(root_child0_child0_child0.getComputedTop()).toBe(10)
1780
- expect(root_child0_child0_child0.getComputedWidth()).toBe(50)
1781
- expect(root_child0_child0_child0.getComputedHeight()).toBe(50)
1782
-
1783
- root.calculateLayout(undefined, undefined, Direction.RTL)
1784
-
1785
- expect(root.getComputedLeft()).toBe(0)
1786
- expect(root.getComputedTop()).toBe(0)
1787
- expect(root.getComputedWidth()).toBe(220)
1788
- expect(root.getComputedHeight()).toBe(220)
1789
-
1790
- expect(root_child0.getComputedLeft()).toBe(10)
1791
- expect(root_child0.getComputedTop()).toBe(10)
1792
- expect(root_child0.getComputedWidth()).toBe(200)
1793
- expect(root_child0.getComputedHeight()).toBe(200)
1794
-
1795
- expect(root_child0_child0.getComputedLeft()).toBe(0)
1796
- expect(root_child0_child0.getComputedTop()).toBe(0)
1797
- expect(root_child0_child0.getComputedWidth()).toBe(200)
1798
- expect(root_child0_child0.getComputedHeight()).toBe(200)
1799
-
1800
- expect(root_child0_child0_child0.getComputedLeft()).toBe(140)
1801
- expect(root_child0_child0_child0.getComputedTop()).toBe(10)
1802
- expect(root_child0_child0_child0.getComputedWidth()).toBe(50)
1803
- expect(root_child0_child0_child0.getComputedHeight()).toBe(50)
1804
- } finally {
1805
- if (typeof root !== "undefined") {
1806
- root.freeRecursive()
1807
- }
1808
-
1809
- config.free()
1810
- }
1811
- })
1812
- test("absolute_layout_column_reverse_margin_border", () => {
1813
- const config = Yoga.Config.create()
1814
- let root
1815
-
1816
- try {
1817
- root = Yoga.Node.create(config)
1818
- root.setFlexDirection(FlexDirection.ColumnReverse)
1819
- root.setPositionType(PositionType.Absolute)
1820
- root.setWidth(200)
1821
- root.setHeight(200)
1822
-
1823
- const root_child0 = Yoga.Node.create(config)
1824
- root_child0.setPositionType(PositionType.Absolute)
1825
- root_child0.setPosition(Edge.Left, 5)
1826
- root_child0.setPosition(Edge.Right, 3)
1827
- root_child0.setMargin(Edge.Left, 3)
1828
- root_child0.setMargin(Edge.Right, 4)
1829
- root_child0.setBorder(Edge.Left, 1)
1830
- root_child0.setBorder(Edge.Right, 7)
1831
- root_child0.setWidth(50)
1832
- root_child0.setHeight(50)
1833
- root.insertChild(root_child0, 0)
1834
- root.calculateLayout(undefined, undefined, Direction.LTR)
1835
-
1836
- expect(root.getComputedLeft()).toBe(0)
1837
- expect(root.getComputedTop()).toBe(0)
1838
- expect(root.getComputedWidth()).toBe(200)
1839
- expect(root.getComputedHeight()).toBe(200)
1840
-
1841
- expect(root_child0.getComputedLeft()).toBe(8)
1842
- expect(root_child0.getComputedTop()).toBe(150)
1843
- expect(root_child0.getComputedWidth()).toBe(50)
1844
- expect(root_child0.getComputedHeight()).toBe(50)
1845
-
1846
- root.calculateLayout(undefined, undefined, Direction.RTL)
1847
-
1848
- expect(root.getComputedLeft()).toBe(0)
1849
- expect(root.getComputedTop()).toBe(0)
1850
- expect(root.getComputedWidth()).toBe(200)
1851
- expect(root.getComputedHeight()).toBe(200)
1852
-
1853
- expect(root_child0.getComputedLeft()).toBe(143)
1854
- expect(root_child0.getComputedTop()).toBe(150)
1855
- expect(root_child0.getComputedWidth()).toBe(50)
1856
- expect(root_child0.getComputedHeight()).toBe(50)
1857
- } finally {
1858
- if (typeof root !== "undefined") {
1859
- root.freeRecursive()
1860
- }
1861
-
1862
- config.free()
1863
- }
1864
- })