[css-grid] Use Optional to represent indefinite lengths
Blink has been using LayoutUnit(-1) to represent indefinite sizes or more in general, sizes that cannot be resolved. That's unfortunate because it forces us to use that magic number and also because negative LayoutUnits are valid outcomes of some operations. In our particular case, that was forcing us to check the SizingOperation argument in the GridTrackSizingAlgorithm to know whether the passed available and free sizes where actually indefinite or not. Actually that was not totally correct as this was based on the assumption that we were doing intrinsic size computations (preferred widths) whenever the sizes where indefinite which is not correct for all the cases (it's true for widths but a height:auto grid container would have indefinite height and require indefinite size computations). This does not require any additional tests as we are not changing any behaviour. It's a step forward in the process of decoupling the concepts of definite/indefinite sizes and intrinsicSize/layout operations. Review-Url: https://codereview.chromium.org/2808453002 Cr-Commit-Position: refs/heads/master@{#462881}
Showing
This diff is collapsed.
Please register or sign in to comment