Automatic update from web-platform-tests[css-grid] Distribution offset doesn't account for non-spanning items
We recenttly changed the track sizing algorithm so that it considers the
offsets added by the Content Alignment properties. The change in r566412
introduce intermediate steps in the track sizing algorithm so that
inline-axis Content Distribution accounts for the row tracks sizes
computed in the next step.
However, we were adding the Content Distribution offsets for any column
track, but we should do it only for the tracks with spanning items. This
error led to the mentioned bugs and this change fixes them.
Bug: 871230, 871242
Change-Id: I8ac789ccacc2e5a51bfafd7820ed08e96a31e58b
Reviewed-on: https://chromium-review.googlesource.com/1176803
Reviewed-by: Sergio Villar <[email protected]>
Commit-Queue: Javier Fernandez <[email protected]>
Cr-Commit-Position: refs/heads/master@{#583802}
--
wpt-commits: 676265b89417b09c27d94a2a8538a88a34821e88
wpt-pr: 12512
Automatic update from web-platform-tests[css-grid] Content Alignment as part of the track sizing algorithm
The CSS WG resolved [1] that Content Alignment should account to the
track sizing algorithm.
The sizing algorithm has been modified so that two new steps (1.5
and 2.5) were added to compute the Content Alignment offsets after
resolving the columns' and rows' sizes respectively.
This change decouples the Content Alignment logic from the tracks
position, so that we can use it as part of the track sizing algorithm.
I also had to store the whole ContentAlignmentData structure in two
class attributes. We need both, position and distribution offsets, to
be used in different parts of the layout logic.
Finally, since the ContentAlignmentData is now used as persistent
memory, we had to remove the STACK_ALLOCATED flag; hence, I think
using DISALLOW_COPY_AND_ASSIGN and let the functions update the
structure's internal field is a more efficient approach to commit
this change.
[1] https://github.com/w3c/csswg-drafts/issues/2557
Added WPT
* grid-content-distribution-must-account-for-track-sizing-001.html
* grid-content-distribution-must-account-for-track-sizing-002.html
Bug: 844744
Change-Id: I90019a96b148d3713467e35fde9482d0d39b1ced
Reviewed-on: https://chromium-review.googlesource.com/1067918
Commit-Queue: Javier Fernandez <[email protected]>
Reviewed-by: Manuel Rego Casasnovas <[email protected]>
Cr-Commit-Position: refs/heads/master@{#566412}
--
wpt-commits: 73ed379a1437407749c730239019bd61528b060b
wpt-pr: 11115
Automatic update from web-platform-tests[css-grid] Avoid layouts during intrinsic size computation
The definition of intrinsic size excludes explicitly performing layouts
to compute the final value. However, it may be necessary to laid out
some children to retrieve accurate information about the geometry of
the box, specially when some of these children are orthogonal to the
box its intrinsic size is being computed.
However, the writing-mode specification suggest [1] that auto-sized
orthogonal boxes may require to run their sizing phase before any
content contribution could be established.
The Blink engine discourages performing layouts during intrinsic size
computation. In order to address the orthogonal flow issues and get
a more accurate sizing, both during intrinsic size and layout phases,
the engine performs a pre-layout of all the orthogonal boxes in the
layout tree (LocalFrameView::LayoutOrthogonalWritingModeRoot).
However, this pre-layout operations doesn't make sense for grid items
because the grid areas, the grid items' actual containing blocks, are
not computed yet. Hence, we decided to exclude grid items from this
pre-layout operation (PrepareOrthogonalWritingModeRootForLayout).
With this CL, we follow the same plan Blink has for orthogonal flow
boxes, but doing it once the grid items are placed in their
corresponding grid areas. Since the grid tracks sizing algorithm has
not been run at this stage, the size of the grid areas is estimated
based on the track's max-sizing function, in a similar way [2] the
algorithm does to deal with orthogonal items during the layout phase.
This change is covered by current tests, however, added an additional
test to verify we use the max-track sizing as a way to estimate the
orthogonal item's block-axis size.
[1] https://www.w3.org/TR/css-writing-modes-3/#orthogonal-flows
[2] https://drafts.csswg.org/css-grid/#algo-overview
Change-Id: I836b92120825916324f94befec6d35263ec84f2b
Reviewed-on: https://chromium-review.googlesource.com/1027882
Commit-Queue: Javier Fernandez <[email protected]>
Reviewed-by: Manuel Rego Casasnovas <[email protected]>
Cr-Commit-Position: refs/heads/master@{#556469}
--
wpt-commits: a878a9a9a5d1f4b0160620ba5479ba2c7d2e2373
wpt-pr: 10810