[css-grid] Fix crash when using auto repeat for indefinite widths
The computeAutoRepeatTracksCount() call needs to know the available size in
order to compute a number of repetitions. When computing the preferred
logical widths that size is indefinite so it should just return 1. The
problem is that instead it was directly calling another methods that were
reentering the preferred size computation. That lead to a situation of never
ending recursive calls to the preferred widths code.
As we know whether we're computing the intrinsic sizes or not, we can
leverage that knowledge and do not call the method in that case (the number
of repetitions would be 0 or 1 depending on whether auto-fit|fill was
specified or not).
Made some of the attributes mutable as they are modified by the intrinsic size
computation. Moved the clean up of those attributes to a new method. We'll
eventually need to change the current code so that we could call the track
sizing algorithm without affecting the internal state of the layout object.
BUG=621517
Review-Url: https://codereview.chromium.org/2135703002
Cr-Commit-Position: refs/heads/master@{#405529}
4 files changed