Uses the sum of border and padding if it's greater than the container definite size #651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Match the flex container behavior with padding and border values larger than the container
Context
I couldn't find it in the flexbox spec, but I noticed that all major browsers implement this behavior
When the sum of padding and border is larger than the definite size of the flex container, it uses that as it's definite size
https://codepen.io/juliascript/pen/WNBeoev
Yoga behaves the same in the case of padding, but it ignores border
Right now Taffy behavior seems to be that in a
ComputeSize
run mode pass, it doesn't consider padding and border at all whenstyled_based_known_dimensions
can be derived, while in aPerformLayout
run it does account for that in the cross axis but not in the main axisFeedback wanted
I added a simple test case, I'm not sure that's the right place
Edit:
Apparently the block layout implements this behavior so I imagine it comes from the block layout model
taffy/src/compute/block.rs
Line 172 in 066949d