Commit 02d8ec6
Expose HadOverflow property in JavaScript bindings (#1930)
Summary:
The C API provides `YGNodeLayoutGetHadOverflow()` to check whether a node's layout had overflow, but this was not exposed in the JavaScript bindings. This PR adds:
- `getComputedHadOverflow(): boolean` — standalone method on `Node`
- `hadOverflow: boolean` field in the `Layout` type returned by `getComputedLayout()`
The implementation follows the exact same pattern as existing layout getters (e.g., `getComputedWidth`, `getComputedHeight`) and boolean accessors (e.g., `hasNewLayout`).
Closes #1773
Pull Request resolved: #1930
Test Plan:
- Added `YGHadOverflowTest.test.ts` with 4 test cases ported from the C++ test suite (`tests/YGHadOverflowTest.cpp`):
- Children overflow with no wrap and no flex → `hadOverflow` is true
- No overflow with flex children that shrink → `hadOverflow` is false
- Overflow flag resets when layout changes → true then false
- `getComputedLayout()` includes `hadOverflow` field
- Full test suite passes: 38 suites, 574 tests, 0 failures
Reviewed By: NickGerleman
Differential Revision: D100144528
Pulled By: fabriziocucci
fbshipit-source-id: fb0f1bdefb17a27a85b32bef5ed82e25153be8661 parent 21680f2 commit 02d8ec6
2 files changed
Lines changed: 117 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
965 | 967 | | |
966 | 968 | | |
967 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
968 | 974 | | |
969 | 975 | | |
970 | 976 | | |
| |||
973 | 979 | | |
974 | 980 | | |
975 | 981 | | |
| 982 | + | |
976 | 983 | | |
977 | 984 | | |
978 | 985 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
0 commit comments