Commit 8a9341a
Reland Fix possible invalid measurements when width or height is zero pixels
Summary:
X-link: facebook/yoga#1823
X-link: facebook/react-native#52348
Fixes facebook/yoga#1819
Yoga has a fast path when measuring a node, if it thinks it knows its dimensions ahead of time.
This path has some eroneous logic, to set both axis to owner size, if *either* will evaluate to zero, while having an `YGMeasureModeAtMost`/`FitContent` constraint. This means that if a node is given a zero width, and Yoga later measures with with `FitContent`, its height will become the maximum allowable height, even if it shouldn't be that large.
We can fix this, by only allowing if both axis are this fixed case, instead of just one.
This bug has existed for about a decade (going back to at least D3312496).
Changelog:
[General][Fixed] - Fix possible invalid measurements with width or height is zero pixels
Reviewed By: yungsters
Differential Revision: D76851589
fbshipit-source-id: 6f5a0e6beccc51f591726c9e83e9b90f3350ed0f1 parent 9756618 commit 8a9341a
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
418 | 424 | | |
419 | 425 | | |
420 | 426 | | |
| |||
424 | 430 | | |
425 | 431 | | |
426 | 432 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
| 433 | + | |
| 434 | + | |
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| |||
0 commit comments