core
core copied to clipboard
Parent-based sizing (Pw and Ph) can be unstable
Describe the bug
When specifying sizing in terms of Pw or Ph (especially Pw), the size of the widget you are styling can often affect the size of the parent, leading to recursion or instability.
How to reproduce
See #1516 for an example. This also can happen with image sizing in htmlcore. More generally, having Pw and Ph correspond to visible parent width and height would potentially prevent this problem. See also #1518 for another case where visible parent size should be used.
Example code
Relevant output
Platform
macOS
The key logic here is to ignore any Pw, Ph settings in the first passes, and only apply them in SizeFinal. Similar to Grow factors basically.