[layoutng] Add a shrink-to-fit flag to the constraint space
This is useful for a few things:
- A way to communicate from the layout algorithm to ng_length_utils that we
should treat auto as shrink-to-fit. There's no good other way to do this --
ng_length_utils gets the logicalWidth() property directly and needs to know
to treat it specially.
Conversely I did not want to encode this knowledge inside of length utils
because that gets complicated fast and puts special knowledge in a single
place instead of distributing it to caller layout algorithms which are a
much more natural spot.
- It allows a parent layout algorithm to tell a child box that it should shrink
to fit even when it normally wouldn't, e.g. for flex items.
This is essentially a companion change to
https://codereview.chromium.org/2583033004/ -- with both these changes we
should correctly size inline-blocks and floats.
R=ikilpatrick@chromium.org
BUG=635619
Review-Url: https://codereview.chromium.org/2587283004
Cr-Commit-Position: refs/heads/master@{#440344}
7 files changed