facebook / yoga

Yoga is an embeddable layout engine targeting web standards.
https://yogalayout.dev/
MIT License
17.1k stars 1.41k forks source link

Sanitize measure function results #1654

Closed NickGerleman closed 1 month ago

NickGerleman commented 2 months ago

Summary: We've started seeing assertion failures in Yoga where a NaN value makes its way to an availableHeight constrtaint when measuring Litho nodes.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds santization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of NaN.

Changelog: [Internal]

Differential Revision: D57285584

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
yoga-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2024 6:03pm
facebook-github-bot commented 2 months ago

This pull request was exported from Phabricator. Differential Revision: D57285584

facebook-github-bot commented 2 months ago

This pull request was exported from Phabricator. Differential Revision: D57285584