The side used to calculate the baseline offset should use the correct
under/over side according to the writing modes of the container and the
item.
Differential Revision: https://phabricator.services.mozilla.com/D240317
All items in an alignment context should be checked for baseline
alignment. Items that turn out to be orthogonal to the alignment
context should synthesize a baseline.
Differential Revision: https://phabricator.services.mozilla.com/D216793
This change makes most places in grid intrinsic sizing code specify operations
by sizing phase and sizing constraint, rather than using the sizing function
types directly. This should help with readability and debugging, as the
intended operation rather than the selector bits are used now.
Differential Revision: https://phabricator.services.mozilla.com/D249697
The idea behind this patch is to allow grid items with percent-valued
block-sizes to resolve against definite grid rows and then transfer that
resolved block-size as their inline contribution to the grid container's
intrinsic inline-size.
Differential Revision: https://phabricator.services.mozilla.com/D246466
Instead of bit-packing grid area inline size and baseline padding into a hash,
store them as separate fields to avoid key collisions.
I failed to craft a testcase to cover this change alone. However, with the new
behavior introduced in bug 1944423 (with
`layout.css.grid-multi-pass-track-sizing.enabled` enabled), these WPTs will fail
without this patch.
- css/css-grid/layout-algorithm/grid-fit-content-percentage.html
- css/css-grid/layout-algorithm/grid-container-percentage-001.html
Differential Revision: https://phabricator.services.mozilla.com/D246465
The grid item cache is an internal implementation detail that does not need to
be exposed in the header. This patch moves `CachedBAxisMeasurement` to the cpp
file, similar to where `nsFlexContainerFrame::CachedBAxisMeasurement` lives.
This change also reduces compile time when modifying the cache code.
Since `CachedBAxisMeasurement` is now hidden, we add a helper
`MarkCachedGridMeasurementsDirty` to remove `CachedBAxisMeasurement::Prop()` in
`nsIFrame::MarkIntrinsicISizesDirty()`.
Differential Revision: https://phabricator.services.mozilla.com/D246060
This check is based on the exact definition in the spec, and ideally would
be a superset of the cases where it is currently applied.
This also updates some test expectations. It seems that perhaps
layout/reftests/css-grid/grid-flex-min-sizing-001.html isn't so useful, as
the tests and refs are almost identical now. The layout reftest changes
reflect behavior in other browsers, and appear more correct after examination.
As noted in the past, these tests depend on known incorrect behavior to begin
with.
This difference was not caught by the WPT, and a test case will be added to
WPT in the next part of this bug.
This re-breaks table-grid-item-dynamic-004.html which was fixed by
bug 1916849, however I believe this was fixed on accident in that bug. It
doesn't seem that those changes should have fixed that test, and likely it was
the slightly different handling of this flag that caused it to "work".
Differential Revision: https://phabricator.services.mozilla.com/D244447
Add a test which is specifically failed before this patch (with the pref
enabled) but is fixed by the patch. This specific case seems to not be tested
in isolation by WPT.
This fixes the major issue we found with bug 1938619, and enables the pref
layout.css.grid-flex-spanning-items-intrinsic-sizing.enabled in nightly-only.
Differential Revision: https://phabricator.services.mozilla.com/D243030
In `nsGridContainerFrame::Reflow()`, we are computing the content-box block-size
for the grid container. This patch renames the variable `bSize` to improve
clarity.
The only modification other than the rename is removing the `nscoord`
declaration within `if (aReflowInput.ShouldApplyAutomaticMinimumOnBlockAxis())`
since we've already declared `contentBSize`.
Differential Revision: https://phabricator.services.mozilla.com/D242972
The motivation of this patch is that this test would fail after we fix
bug 1481876, and it already fails in Chrome and Safari, which is worth fixing
now.
This patch maintains the intent of the sub-test that validates fractional `fr`
units. However, the flex factor sum, which used to be less than one, now becomes
greater than one. Therefore, I have distilled this sub-test into a web-platform
test in the next part to exercise the code path and the behavior described in
spec 12.7.1.2 [1].
[1] https://drafts.csswg.org/css-grid-2/#algo-find-fr-size
Differential Revision: https://phabricator.services.mozilla.com/D240553
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.
Differential Revision: https://phabricator.services.mozilla.com/D237097
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.
Differential Revision: https://phabricator.services.mozilla.com/D237097
Don't have to write more one-off wrappers for size and margin.
It does cost having to copy fallback values, but that may
not be a huge tradeoff.
Differential Revision: https://phabricator.services.mozilla.com/D237097
Bug 1277129 renamed `GridReflowState` to `GridReflowInput`, hence the renaming
of these parameters. This change also helps distinguish these variables from
`GridItemInfo::mState` and `TrackSize::mState`.
Differential Revision: https://phabricator.services.mozilla.com/D236290
`RepeatTrackSizingInput::InitFromStyle()` is called in
`nsGridContainerFrame::ComputeIntrinsicISize()`. When we compute a frame's
intrinsic inline size, its inline-size property should not affect the result.
Differential Revision: https://phabricator.services.mozilla.com/D235879
The pref layout.css.grid-flex-spanning-items-intrinsic-sizing.enabled is
expected to be removed once these regressions are fixed. This should be a good
compromise between maintaining the code from bug 1916849, and avoiding
breakage/extra backouts.
Differential Revision: https://phabricator.services.mozilla.com/D235089
Per the CSS Align specification, 'space-between', 'space-around', and
'space-evenly' should use a "safe" fallback alignment when overflow occurs. This
patch implements that behavior, renames the function for clarity, and removes
unused parameters.
Differential Revision: https://phabricator.services.mozilla.com/D234755
This has a couple unfortunate parts to its implementation. In particular, the
adjustment to ShouldApplyAutoMinSize are difficult to explain other than that
function doesn't actually calculate if the minimum contribution of an item is
content-based, but rather checks if the caller should also call MinSize or not.
Part of this calculation includes checking the min-size-auto of the item, but
some are just matching checks for special cases in MinSize.
This could be optimized, and should definitely be refactored to simplify how
all of this is computed.
This still doesn't quite correctly handle all cases for items spanning flex
tracks and tracks with a definite length, but that case is already not handled
correctly so this won't introduce any regressions for that case unless the
expected result is that such an item will have an intrinsic size of zero. In
that case, simply not calculating anything would accidentally be the correct
value, and this new calculation may or may not produce that result.
Differential Revision: https://phabricator.services.mozilla.com/D230829