Commit graph

622 commits

Author SHA1 Message Date
Ziran Sun
124b0f048d Bug 1632447 - Calculate the track sizes with the contain intrinsic block size if available. r=emilio
When block size is initially indefinite but later was determined by the contain intrinsic
size, we calculate the track sizes using the contain intrinsic block size.

Differential Revision: https://phabricator.services.mozilla.com/D153611
2022-08-03 14:29:22 +00:00
Oriol Brufau
b86c3fe61a Bug 1782297 - Obey contain-intrinsic-size in grid containers. r=emilio
Some tests are still failing but I think it's due to bug 1481876: after
determining the block size of the grid container, the rows that depend
on it (like percentages or fr units) are not recomputed.

Also, 'contain-intrinsic-size: none' behaves as 0, ignoring the track
sizes and gaps, but that's bug 1488878.

Differential Revision: https://phabricator.services.mozilla.com/D153279
2022-08-01 16:12:53 +00:00
Ting-Yu Lin
f101e2077d Bug 1464761 Part 4 - Remove nsReflowStatus::mTruncated bit. r=dholbert
In the description of the mTruncated bit, its purpose is the same as calling
SetInlineLineBreakBeforeAndReset(). We've removed all its usages in previous
patches, so the bit is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D151461
2022-07-27 21:55:18 +00:00
Boris Chiou
e3d089f302 Bug 1760658 - Part 2: Apply automatic content-based minimum on grid container. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D144899
2022-05-02 20:06:33 +00:00
David Shin
ec93876623 Bug 1755565 - Implement contain: inline-size. r=emilio,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D143501
2022-04-19 17:44:16 +00:00
Sean Feng
2590fe3e7e Bug 1682686 - Fix grid-item measurement cache to actually update the cache when the old value is no longer suitable r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D139068
2022-02-18 20:27:39 +00:00
Sean Feng
f7f7f6ccba Bug 1740702 - Add some grid performance logging r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D135610
2022-01-12 21:51:45 +00:00
Sean Feng
fc11ef0b3f Bug 1733978 - Don't overwrite the ISize of child frames when optimizing nested grid layout r=mats
The optimized code path for nested grid layout should only set the
BSize of the child frames, since this is what the optimization is
for.

Without the change, the ISize is always going to be set to 0 for
child frames which may break the layout. Sometimes, it is not
an issue because the ISize of the grid area gets updated, so
the cached measurement becomes invalid, and the ISize of the child
frame gets set to the correct one again.

Differential Revision: https://phabricator.services.mozilla.com/D130828
2021-11-10 16:18:11 +00:00
Sean Feng
fc3b778ccf Bug 1591366 - Improve nested grid layout performance r=mats
This patch improves nested grid layout performance by caching the grid
items' block axis measurement to avoid potentially doing exponential
reflows.

Differential Revision: https://phabricator.services.mozilla.com/D115711
2021-09-20 19:52:45 +00:00
Noemi Erli
bb5d736641 Backed out 2 changesets (bug 1591366) for causing failures in table-grid-item-dynamic-004.html CLOSED TREE
Backed out changeset 19be43686dc0 (bug 1591366)
Backed out changeset a2b6f6abda6e (bug 1591366)
2021-09-18 02:42:58 +03:00
Sean Feng
586a33d2b9 Bug 1591366 - Improve nested grid layout performance r=mats
This patch improves nested grid layout performance by caching the grid
items' block axis measurement to avoid potentially doing exponential
reflows.

Differential Revision: https://phabricator.services.mozilla.com/D115711
2021-09-17 21:06:52 +00:00
Ting-Yu Lin
a869ed259f Bug 1527539 Part 2 - Incorporate grid items' margins and grid container's paddings when computing grid container's overflow area. r=dholbert
This patch updated the grid container's scrollable overflow areas to
match the spec. This also fixed Bug 1532383 - include space in empty
explicit grid tracks in the scrollable overflow area.

Note: this patch can make overflow areas reported by grid container
overflow off the top or left, but the overflow areas won't be scrollable
because they are clipped once `nsHTMLScrollFrame` calls
`nsLayoutUtils::GetScrolledRect()`.

Differential Revision: https://phabricator.services.mozilla.com/D111995
2021-06-07 23:56:29 +00:00
Ting-Yu Lin
204fd3a17a Bug 1527539 Part 1 - Add helper functions to calculate the sum of grid tracks sizes (and gaps). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D111994
2021-06-07 23:56:29 +00:00
Dorel Luca
bc6081ed3a Backed out 2 changesets (bug 1527539) for WPT failures in /css/css-grid/alignment/grid-content-alignment-overflow-002.html. CLOSED TREE
Backed out changeset 3cac3147fcd5 (bug 1527539)
Backed out changeset 6de6fc3205c0 (bug 1527539)
2021-06-04 07:08:53 +03:00
Ting-Yu Lin
e44219b2c5 Bug 1527539 Part 2 - Incorporate grid items' margins and grid container's paddings when computing grid container's overflow area. r=dholbert
This patch updated the grid container's scrollable overflow areas to
match the spec. This also fixed Bug 1532383 - include space in empty
explicit grid tracks in the scrollable overflow area.

Note: this patch can make overflow areas reported by grid container
overflow off the top or left, but the overflow areas won't be scrollable
because they are clipped once `nsHTMLScrollFrame` calls
`nsLayoutUtils::GetScrolledRect()`.

Differential Revision: https://phabricator.services.mozilla.com/D111995
2021-06-04 02:53:04 +00:00
Ting-Yu Lin
7d55e74a9c Bug 1527539 Part 1 - Add helper functions to calculate the sum of grid tracks sizes (and gaps). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D111994
2021-06-04 02:53:04 +00:00
Ting-Yu Lin
e3c34d34cc Bug 1709491 Part 3 - Fix Subgrid::mMarginBorderPadding when the subgrid is a scroll frame. r=dholbert
When `aGridFrame.mFrame` is a scroll frame, the inner scrolled frame
`subgridFrame` only has padding, but no margin nor border. We should add
margin and border from the outer scroll frame to `mMarginBorderPadding`
so that the grid area of the subgrid is computed correctly.

Differential Revision: https://phabricator.services.mozilla.com/D114546
2021-05-12 06:32:41 +00:00
Ting-Yu Lin
47126fa98d Bug 1709491 Part 2 - Simplify Subgrid::mMarginBorderPadding computation. r=dholbert
SizeComputationInput's logical margin and border&padding getters accept
arbitrary writing mode, so we can operate on `cbWM` directly without
using physical coordinates.

This patch is a preparation of the next part, and it shouldn't change
the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D114545
2021-05-12 06:32:40 +00:00
Simon Giesecke
628cc55f22 Bug 708901 - Migrate to nsTHashSet in layout. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108597
2021-03-24 17:56:46 +00:00
Csoregi Natalia
f54ee076ae Backed out 13 changesets (bug 708901, bug 1184468) for causing build bustage on GeckoViewHistory.cpp. CLOSED TREE
Backed out changeset b1e4c01e63b8 (bug 708901)
Backed out changeset 37b52cce83c0 (bug 708901)
Backed out changeset eee75f33f060 (bug 708901)
Backed out changeset 479bf64c7986 (bug 708901)
Backed out changeset 15a8fb94d15d (bug 708901)
Backed out changeset be31ccd9a61d (bug 708901)
Backed out changeset fc54f4eaedd5 (bug 708901)
Backed out changeset 03c3a56c3d13 (bug 708901)
Backed out changeset 73f11d3c1298 (bug 708901)
Backed out changeset aed22fd80893 (bug 708901)
Backed out changeset 74d8249fbe7e (bug 708901)
Backed out changeset acb725eb3c1d (bug 1184468)
Backed out changeset 70f3ea6efec4 (bug 1184468)
2021-03-24 19:26:20 +02:00
Simon Giesecke
c73f87b72b Bug 708901 - Migrate to nsTHashSet in layout. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108597
2021-03-24 16:58:58 +00:00
Simon Giesecke
ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Ting-Yu Lin
7e74c47006 Bug 1690701 Part 2 - Check NS_FRAME_OUT_OF_FLOW bit in nsIFrame::IsAbsolutelyPositioned(). r=emilio
I assume nsIFrame::IsAbsolutelyPositioned()'s callers really want to
check whether a frame is a real abspos frame, not just check a frame has
a abspos style. This could potentially change the behavior, but I feel
its the right thing to do.

Differential Revision: https://phabricator.services.mozilla.com/D106580
2021-03-04 00:34:03 +00:00
Emilio Cobos Álvarez
c17b1c2e53 Bug 1695390 - Move extremum lengths to the individual Size / MaxSize types. r=boris
This will prevent growing them when introducing fit-content(<length>).

This can _almost_ be derived, if it wasn't because of the quirky stuff.
I think the macro is probably good enough for now but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D106713
2021-03-02 12:11:35 +00:00
Brindusan Cristian
82efbb80e1 Backed out changeset be6d9849825d (bug 1695390) for wr failures in col-definite-max-size-001.html. CLOSED TREE 2021-03-02 13:41:40 +02:00
Emilio Cobos Álvarez
b5686164be Bug 1695390 - Move extremum lengths to the individual Size / MaxSize types. r=boris
This will prevent growing them when introducing fit-content(<length>).

This can _almost_ be derived, if it wasn't because of the quirky stuff.
I think the macro is probably good enough for now but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D106713
2021-03-02 10:34:39 +00:00
Simon Giesecke
be7dc83fa6 Bug 1691913 - Mark nsBaseHashtable (and its subclasses') member functions nodiscard where appropriate. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D105474
2021-02-26 09:22:53 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Ting-Yu Lin
bfc8d66755 Bug 1527734 - Use ReflowInput::mContainingBlockSize instead of GridItemCBSizeProperty(). r=mats
Grid container stores the containing block size on a table wrapper grid
item in GridItemCBSizeProperty(), but the size is also passed as a
parameter when creating table wrapper's ReflowInput, and is stored in
ReflowInput::mContainingBlockSize. We can use mContainingBlockSize
directly instead of GridItemCBSizeProperty().

The test 002.html is inspired from the testcases in bug 1527734.
003.html and 004.html are inspired from the testcase in bug 1521088.
004.html is 003.html with 'width:500px' added to <table>, which we still
fail with this patch.

Differential Revision: https://phabricator.services.mozilla.com/D104144
2021-02-09 00:59:39 +00:00
Ting-Yu Lin
ec91abb3dc Bug 1690715 - Expand nsTableWrapperFrame::InitChildReflowInput() at its only caller. r=dholbert
The purpose of InitChildReflowInput() is to provide customized border,
padding, and containing block size for the *inner table frame*, not for
the caption frame. So the caption frame's ReflowInput doesn't need to be
initialized in a separate step.

Differential Revision: https://phabricator.services.mozilla.com/D103436
2021-02-04 05:17:11 +00:00
Ting-Yu Lin
a43cae175a Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-26 02:47:40 +00:00
Csoregi Natalia
0492d8333a Backed out 8 changesets (bug 1686603) for causing crashtest failures. CLOSED TREE
Backed out changeset 94b5d0986d27 (bug 1686603)
Backed out changeset e7edf6fcc41d (bug 1686603)
Backed out changeset 4c9271f07178 (bug 1686603)
Backed out changeset 7013b95266ae (bug 1686603)
Backed out changeset cf7a55638aef (bug 1686603)
Backed out changeset 7717a0f2a37b (bug 1686603)
Backed out changeset c82593b13a61 (bug 1686603)
Backed out changeset fd1d95a1e706 (bug 1686603)
2021-01-26 04:32:13 +02:00
Ting-Yu Lin
ffce5ed7d6 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-25 22:29:31 +00:00
Mihai Alexandru Michis
b6b2f1e5f4 Backed out 7 changesets (bug 1686603) for causing crashtest assertion failures.
CLOSED TREE

Backed out changeset 19cba7d34a7f (bug 1686603)
Backed out changeset 3a0d0155ea5e (bug 1686603)
Backed out changeset f1f672cdd0c6 (bug 1686603)
Backed out changeset 63020922e2fd (bug 1686603)
Backed out changeset 8766ce79ba5e (bug 1686603)
Backed out changeset 965dbe8de1e1 (bug 1686603)
Backed out changeset b1328ee45f43 (bug 1686603)
2021-01-21 09:21:12 +02:00
Ting-Yu Lin
d0c462cb81 Bug 1686603 Part 2 - Add StyleSizeOverrides parameter to ReflowInput's constructor & co. to override data from style system data. r=dholbert
This patch adds the struct as a parameter to various functions.

The struct is cached in ReflowInput so that we don't need to pass it
down to the internal method where nsIFrame::ComputeSize() is called.

In the subsequent patches, we'll use it to revise the implementation of
flex container's flex base size resolution, and size overrides.

Differential Revision: https://phabricator.services.mozilla.com/D101793
2021-01-21 04:17:59 +00:00
Mats Palmgren
e96c7aae64 Bug 1638860 - Inhibit subgridding for abs.pos. subgrids that doesn't span a parent track. r=dholbert
I'm fixing three bugs, in the order they appear in the patch:
1. when inhibiting subgridding we remove the frame bit on the wrong frame
   when the item has an anonymous frame (e.g. a scroll frame) - we used
   mFrame instead of the correct SubgridFrame()
2. an abs.pos. subgrid using 'auto' lines should span all parent tracks,
   not just explicit tracks (i.e. it should behave the same as the non-
   abs.pos. case)
3. when spanning from the first/last line to the padding edge using 'auto'
   then the subgrid technically doesn't span any parent tracks, so we
   need to inhibit subgridding in this case.  The subgrid itself will still
   span that area though so the layout inside will behave as if it were
   "subgridded" to a hypothetical track corresponding to that area. IOW,
   inhibitting subgridding in this case should do what the author expects
   anyway.

Differential Revision: https://phabricator.services.mozilla.com/D76867
2020-12-03 22:03:05 +00:00
Jon Bauman
f5c1a59332 Bug 1675987 - No derogatory language: Remove references to "crazy" in layout module r=emilio,AlaskanEmily
Differential Revision: https://phabricator.services.mozilla.com/D97657
2020-11-20 21:21:03 +00:00
Emilio Cobos Álvarez
d0cf38cffb Bug 1677920 - Remove writing mode argument from CalcAndCacheConsumedBSize(). r=TYLin
Always matches the frame's writing-mode.

Differential Revision: https://phabricator.services.mozilla.com/D97390
2020-11-18 11:06:29 +00:00
Emilio Cobos Álvarez
cdff7e9fe1 Bug 1675376 - Cache consumed BSize in a frame property for non-first continuations. r=mats
This removes virtually all the time under ConsumedBSize. See the comment for
what ensures the correctness of the cache: Basically, we refresh the cache for
a frame continuation every time we reflow it, which means that when next
continuations go look for it it should be up-to-date (we rely on that already
because we're looking at the content rect).

Differential Revision: https://phabricator.services.mozilla.com/D97357
2020-11-18 11:04:35 +00:00
Bogdan Tara
a051dd1b28 Backed out 3 changesets (bug 1675376) for asan crashtest failures CLOSED TREE
Backed out changeset b276c591ea2d (bug 1675376)
Backed out changeset 20d5c7217304 (bug 1675376)
Backed out changeset e3aa6fb62422 (bug 1675376)
2020-11-18 08:00:38 +02:00
Emilio Cobos Álvarez
9c7552e958 Bug 1675376 - Cache consumed BSize in a frame property for non-first continuations. r=mats
This removes virtually all the time under ConsumedBSize. See the comment for
what ensures the correctness of the cache: Basically, we refresh the cache for
a frame continuation every time we reflow it, which means that when next
continuations go look for it it should be up-to-date (we rely on that already
because we're looking at the content rect).

Differential Revision: https://phabricator.services.mozilla.com/D97357
2020-11-18 03:08:13 +00:00
Ting-Yu Lin
545a6376cd Bug 1677635 Part 4 - Rename nsOverflowAreas to OverflowAreas, and move it into mozilla namespace. r=layout-reviewers,emilio
This patch is generated via the rename functionality in my editor; add
`mozilla::` prefix to `OverflowAreas` in headers; and remove the
`OverflowType` alias added in Part 1.

Differential Revision: https://phabricator.services.mozilla.com/D97235
2020-11-18 00:08:12 +00:00
Ting-Yu Lin
15775521ac Bug 1674931 Part 3 - Add WritingMode argument to SizeComputationInput::ComputedLogicalPadding(), and adapt callers. r=jfkthame
This patch is similar to Part 1, but for ComputedLogicalPadding().

Differential Revision: https://phabricator.services.mozilla.com/D95663
2020-11-03 19:56:03 +00:00
Ting-Yu Lin
1c052b9ff3 Bug 1674931 Part 2 - Add WritingMode argument to SizeComputationInput::ComputedLogicalBorderPadding(), and adapt callers. r=jfkthame
This patch is similar to Part 1, but for ComputedLogicalBorderPadding().

Differential Revision: https://phabricator.services.mozilla.com/D95662
2020-11-03 19:57:40 +00:00
Ting-Yu Lin
9910d9e651 Bug 1674931 Part 1 - Add WritingMode argument to SizeComputationInput::ComputedLogicalMargin(), and adapt callers. r=jfkthame
It's straightforward to determine which writing mode is required to pass
to ComputedLogicalMargin() by looking at any subsequent method called on
the margin.

For example, if we see

```
ComputedLogicalMargin().BStartEnd(wm);
```

the writing mode needed to pass to `ComputedLogicalMargin()` is `wm`.

Differential Revision: https://phabricator.services.mozilla.com/D95661
2020-11-03 19:44:58 +00:00
Emilio Cobos Álvarez
77adb00bd1 Bug 1411372 - Use enum classes in CSSOrderAwareFrameIterator. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D94789
2020-10-27 17:33:14 +00:00
Ting-Yu Lin
b5d7c879c0 Bug 1673056 - Remove nsLayoutUtils::MIN_ISIZE and nsLayoutUtils::PREF_ISIZE. r=mats
Both are aliases to IntrinsicISizeType::MinISize and
IntrinsicISizeType::PrefISize.

Remove MOZ_ASSERT in nsLayoutUtils::IntrinsicForAxis and
nsContainerFrame::DoInlineIntrinsicISize since IntrinsicISizeType is a
enum class nowadays, which cannot have other values.

I've compiled this patch with DEBUG_INTRINSIC_WIDTH defined in
nsLayoutUtils.cpp, and fixed aWM undefined in
nsLayoutUtils::MinSizeContributionForAxis().

Differential Revision: https://phabricator.services.mozilla.com/D94618
2020-10-23 22:52:02 +00:00
Botond Ballo
948cec1b06 Bug 1667594 - Avoid including nsLayoutUtils.h in nsContainerFrame.h. r=emilio
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType,
which this patch moves to LayoutConstants.h instead.

Depends on D91505

Differential Revision: https://phabricator.services.mozilla.com/D91506
2020-09-26 18:19:14 +00:00
Ting-Yu Lin
b34bab609c Bug 1657345 - Make grid container aware that its available block-size can be unconstrained in paginated context. r=mats
This happens when nsColumnSetFrame reflows its last column in an
unconstrained available block-size.

The wpt test can trigger the bug in a debug build easily. In opt builds like
Nightly, if one wants to load the test manually, additional incremental reflow
(such as opening devtools) may be needed to trigger the bug.

Co-authored-by: Mats Palmgren <mats@mozilla.com>

Differential Revision: https://phabricator.services.mozilla.com/D86672
2020-09-12 00:54:10 +00:00
Ting-Yu Lin
8763701634 Bug 1663822 Part 6 - Convert the anonymous enum controlling ReflowInput's behavior into an EnumSet. r=dholbert
This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89545
2020-09-11 17:59:21 +00:00
Ting-Yu Lin
edcb942efd Bug 1663822 Part 4 - Add a ComputeSizeFlags parameter to ReflowInput's constructor, and store it in ReflowInput. r=dholbert
Currently, to set ComputeSizeFlags, the caller uses an anonymous enum as
a parameter to ReflowInput constructor to set ReflowInputFlags fields,
and then ReflowInput creates a ComputeSizeFlags from the relevant
ReflowInputFlags fields in Init().

This patch simplifies this flags handover by adding ComputeSizeFlags
parameter to ReflowInput so that the caller can create the flags and
pass it to ReflowInput directly. The can also simplifies the process
needed to add a new ComputeSizeFlag.

We still need to store ComputeSizeFlags in ReflowInput since there's one
caller in `nsBlockFrame::ComputeFinalSize` wanting to checking
`ComputeSizeFlag::BClampMarginBoxMinSize`.

Note 1: ComputeSizeFlags is added only to the ReflowInput's constructor
that also takes parent ReflowInput. The other constructor's existing
callers don't need it.

Note 2: I don't bother adjust the value of DUMMY_PARENT_REFLOW_INPUT,
CALLER_WILL_INIT, and STATIC_POS_IS_CB_ORIGIN because they are going to
be converted into a enum class in a later patch.

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D89543
2020-09-11 18:17:51 +00:00
Oriol Brufau
1a38c1beab Bug 1655581 - [css-grid] Use min-content size for intrinsic maximums resolution. r=mats
By mistake the specification used to say that, for items spanning
multiple tracks, the growth limits of the tracks with an intrinsic max
track sizing function should grow to accommodate the minimum
contribution of the item.

But this was a mistake, because an intrinsic max track sizing function
can only be min-content or max-content. So instead of distributing the
minimum contribution, it should be the min-content contribution.

The spec has been fixed and there is a CSSWG resolution in
https://github.com/w3c/csswg-drafts/issues/4790

This patch fixes the problem by reverting 2b923d48ea7e. The change is
likely web compatible, since it only affects a rare edge case with
'minmax()' where the min sizing function is 'auto' or a fixed value
smaller than the min-content contribution, the max sizing function is
'min-content', and an item whose minimum contribution is forced to be
smaller than the min-content contribution, and spans multiple tracks.

Differential Revision: https://phabricator.services.mozilla.com/D89145
2020-09-11 12:42:07 +00:00
Simon Giesecke
96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli
381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke
032d2ac9d3 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Brad Werth
b38e6bdb3f Bug 1648774 Part 1: Make GetFlexFrameWithComputedInfo work for nsFieldSetFrame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D84626
2020-07-23 19:29:37 +00:00
Simon Giesecke
cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kagami Sascha Rosylight
8be8aebf9d Bug 1647525 - Use HasAnyStateBits() in nsGridContainerFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81203
2020-06-27 13:17:04 +00:00
Ting-Yu Lin
675da8e9a4 Bug 1648673 - Remove duplicate CSSOrderAwareFrameIteratorT typedefs in nsGridContainerFrame.h r=dholbert
* It's easier to maintain the type aliases of in one place, i.e.
CSSOrderAwareFrameIterator.h, and the iterator's header itself doesn't
include a lot of headers that add complex dependencies to
nsGridContainerFrame.h.

* Make "jump to definition" functionality in editors work
correctly (rather than just jumping to those declarations.)

Differential Revision: https://phabricator.services.mozilla.com/D81281
2020-06-26 16:51:40 +00:00
Emily McDonough
9c4930c11b Bug 1633737 - Fix asserts and array accesses for oversized grid tracks with repeat-auto r=emilio
Handle grid track lists that are too large in CalculateRepeatFillCount. Check
for repeat tracks that begin or end past the maximum track limit in
InitRepeatTracks, and handle the possible size mismatch in nsComputedDOMStyle.

This may result in there being fewer than the maximum number of tracks again
after removing empty tracks in a repeat(auto-fit), but only limiting the track
count after removing empty tracks would leave the number of repeat tracks
unbounded (or require a separate limit on just the repeat track count).

Differential Revision: https://phabricator.services.mozilla.com/D76191
2020-06-24 18:25:08 +00:00
Brindusan Cristian
8246b23171 Backed out changeset a59280f412c0 (bug 1633737) for crashtest assertion failures at nsGridContainerFrame.cpp. CLOSED TREE 2020-06-18 04:16:09 +03:00
Emily McDonough
4b9ef7886e Bug 1633737 - Fix asserts and array accesses for oversized grid tracks with repeat-auto r=emilio
Handle grid track lists that are too large in CalculateRepeatFillCount. Check
for repeat tracks that begin or end past the maximum track limit in
InitRepeatTracks, and handle the possible size mismatch in nsComputedDOMStyle.

This may result in there being fewer than the maximum number of tracks again
after removing empty tracks in a repeat(auto-fit), but only limiting the track
count after removing empty tracks would leave the number of repeat tracks
unbounded (or require a separate limit on just the repeat track count).

Differential Revision: https://phabricator.services.mozilla.com/D76191
2020-06-17 23:25:14 +00:00
Brad Werth
bec018af01 Bug 1644498: Transition devtools nsFrameStateBits to nsIFrame.h r=heycam
This patch takes the flags NS_STATE_GRID_GENERATE_COMPUTED_VALUES and
NS_STATE_FLEX_GENERATE_COMPUTED_VALUES and combines them into a single new
flag that is defined in nsIFrame.h, with accessors.

Differential Revision: https://phabricator.services.mozilla.com/D78978
2020-06-10 05:03:35 +00:00
Csoregi Natalia
205b2ad0b6 Backed out changeset f73a200460d9 (bug 1644498) for crashes on nsGridContainerFrame. CLOSED TREE 2020-06-10 03:54:24 +03:00
Brad Werth
a2bfa24957 Bug 1644498: Transition devtools nsFrameStateBits to nsIFrame.h r=heycam
This patch takes the flags NS_STATE_GRID_GENERATE_COMPUTED_VALUES and
NS_STATE_FLEX_GENERATE_COMPUTED_VALUES and combines them into a single new
flag that is defined in nsIFrame.h, with accessors.

Differential Revision: https://phabricator.services.mozilla.com/D78978
2020-06-09 23:01:00 +00:00
Simon Giesecke
ca2d0aaa68 Bug 1644403 - Fix inconsistent uses of CopyableAutoTArray and Clone. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78893
2020-06-09 14:27:20 +00:00
Ting-Yu Lin
e3ba3c551e Bug 1643173 Part 2 - Unify GetDisplayFlag helpers for flex and grid items. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D78167
2020-06-05 02:52:58 +00:00
Ting-Yu Lin
1022daa063 Bug 1643173 Part 1 - Convert enum nsIFrame::DISPLAY_CHILD_* to enum class. r=dholbert
The modifications are all straightforward conversion except the one in
nsMathMLContainerFrame, where it is simplified by calling the equivalent
BuildDisplayListForInline() helper.

Differential Revision: https://phabricator.services.mozilla.com/D78166
2020-06-05 02:52:05 +00:00
Ting-Yu Lin
72644413c0 Bug 1641739 - Reduce the support child list types for flex / grid container's frame list manipulation methods. r=mats
These flex / grid's methods are implemented by delegating to
nsContainerFrame's methods. We shouldn't assume they can support more
child list types than the ones supported in nsContainerFrame's methods.

- NoteNewChildren is a helper for flex and grid's AppendFrame and
InsertFrames, and nsContainerFrame::{AppendFrame,InsertFrames} supports
only kPrincipalList and kNoReflowPrincipalList.

- nsContainerFrame::RemoveFrame supports only kPrincipalList and
kNoReflowPrincipalList.

- nsContainerFrame::SetInitialChildList supports only kPrincipalList and
kBackdropList.

Differential Revision: https://phabricator.services.mozilla.com/D77391
2020-06-01 18:22:03 +00:00
Ting-Yu Lin
fae28a9fe1 Bug 1640275 Part 1 - Move some nsGridContainerFrame's helper methods to nsContainerFrame. r=mats
In the next part, I'll extend these helpers, and use them in
nsFlexContainerFrame.

Differential Revision: https://phabricator.services.mozilla.com/D77203
2020-05-28 18:03:11 +00:00
Ting-Yu Lin
b510e66915 Bug 1622935 Part 2 - Move nsGridContainerFrame's NormalizeChildLists() and related helpers to nsContainerFrame. r=mats
Also, add relevant bits to be able to use them in the flex container.

Differential Revision: https://phabricator.services.mozilla.com/D73166
2020-05-01 23:34:22 +00:00
Emily McDonough
143b38623d Bug 1629575 - [css-grid] Initialize LineNameMap::mTemplateLinesEnd correctly also when a repeat(auto-fill/fit) has more than one track. r=mats
This only occurred when a grid with a repeat with multiple values was used.
Also Add crashtests for this case, and update some comments on LineNameMap's
fields while we are here.

Differential Revision: https://phabricator.services.mozilla.com/D71242
2020-05-07 18:27:30 +00:00
Bogdan Tara
5e05e2ded9 Backed out changeset 0c1494c8c04a (bug 1629575) by alaskanemily's request 2020-05-07 03:07:20 +03:00
Emily McDonough
80a9e4f320 Bug 1629575 - Fix incorrect grid template size in the line name map r=mats
This only occurred when a grid with a repeat with multiple values was used.

Differential Revision: https://phabricator.services.mozilla.com/D71242
2020-05-06 22:20:09 +00:00
Emily McDonough
1943cf3dcf Bug 1628041 - Use fill length rather than index to indicate a repeat(auto) in subgrid from Servo r=mats
Differential Revision: https://phabricator.services.mozilla.com/D70066
2020-05-06 19:35:03 +00:00
Simon Giesecke
b8e5abc46a Bug 1626570 - Improve handling of copying arrays in layout/generic/. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D72353
2020-05-05 10:11:01 +00:00
Mats Palmgren
fa99004b91 Bug 1633720 - [css-grid-2] Adjust the grid area stored in the Subgrid property as well for removed 'auto-fit' tracks in the parent. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D73007
2020-04-30 11:34:20 +00:00
Mats Palmgren
3622105887 Bug 1607954 part 2 - [css-grid][css-align] Implement Masonry layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D67062
2020-04-28 01:18:47 +00:00
Simon Giesecke
2d8c4390b7 Bug 1628715 - Part 15: Replace MOZ_NONNULL_RETURN by returning NotNull<elem_type*>. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D71300
2020-04-24 13:35:27 +00:00
L. David Baron
b4556207cc Bug 1631941 - Add DEBUG-only mWritingMode to mozilla::LogicalSides. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D71885
2020-04-22 23:52:08 +00:00
Stefan Hindli
ed13e122ee Backed out 3 changesets (bug 1631941) for mass build bustages CLOSED TREE
Backed out changeset 8a7e21f2b5f9 (bug 1631941)
Backed out changeset 6a53d6f1ec95 (bug 1631941)
Backed out changeset 91ac0b7e571b (bug 1631941)
2020-04-23 02:14:30 +03:00
L. David Baron
129af7be9b Bug 1631941 - Add DEBUG-only mWritingMode to mozilla::LogicalSides. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D71885
2020-04-22 17:54:28 +00:00
Stefan Hindli
145ea7c2cf Backed out 3 changesets (bug 1631941) for causing valgrind bustages in /builds/worker/workspace/obj-build/dist/include/mozilla/WritingModes CLOSED TREE
Backed out changeset 17391a8c2a05 (bug 1631941)
Backed out changeset b0b425ffb6e9 (bug 1631941)
Backed out changeset f4c1d7dcca50 (bug 1631941)
2020-04-22 20:13:06 +03:00
L. David Baron
304574d922 Bug 1631941 - Add DEBUG-only mWritingMode to mozilla::LogicalSides. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D71885
2020-04-22 15:55:54 +00:00
Ting-Yu Lin
7323697f18 Bug 1625362 Part 3 - Extract grid container's PushIncompleteChildren logic, and move it to nsContainerFrame. r=mats
I left all the bits that related to grid container, such as setting
aStatus, NS_STATE_GRID_DID_PUSH_ITEMS, and aState.mIter in
nsGridContainerFrame::ReflowRowsInFragmentainer().

Differential Revision: https://phabricator.services.mozilla.com/D68492

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:35 +00:00
Ting-Yu Lin
a2e0d00564 Bug 1625362 Part 2 - Move some helpers manipulating overflow lists from nsGridContainerFrame to nsContainerFrame. r=mats
We can utilize these helpers to implement flex item fragmentation.

Differential Revision: https://phabricator.services.mozilla.com/D68491

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:33 +00:00
Ting-Yu Lin
97c3b1d8cb Bug 1625362 Part 1 - Move ReparentFrame and ReparentFrames into nsContainerFrame. r=mats
We have duplicated ReparentFrame and ReparentFrames define in both
nsBlockFrame and nsGridContainerFrame. We should move them into
nsContainerFrame.

Differential Revision: https://phabricator.services.mozilla.com/D68490

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:25 +00:00
Emily McDonough
a076865928 Bug 1628837 - Add subgrid property address to nsGridContainerFrame frame dump output r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D70436

--HG--
extra : moz-landing-system : lando
2020-04-09 21:25:12 +00:00
Emily McDonough
9ae2ce3fae Bug 1624756 - Use EmplaceBack instead of AppendElement(std::make_pair) in TrackSizingFunction::ExpandNonRepeatAutoTracks r=mats
Differential Revision: https://phabricator.services.mozilla.com/D68130

--HG--
extra : moz-landing-system : lando
2020-03-31 16:36:26 +00:00
Emily McDonough
38fbd0aba9 Bug 1625051 Part 1 - Fix calculation of maximum repeat count for grid repeat(auto) r=mats
Differential Revision: https://phabricator.services.mozilla.com/D68488

--HG--
extra : moz-landing-system : lando
2020-03-30 23:46:41 +00:00
André Bargull
2712714d84 Bug 1625138 - Part 35: Replace mozilla::TrueType with std::true_type. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68554

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:20 +00:00
Ting-Yu Lin
b3c3bf9bc9 Bug 1624514 Part 2 - Generalize nsIFrame::ContentBSize() to be ContentSize(). r=AlaskanEmily
To get the logical content size of a frame, some callers use
GetContentRectRelativeToSelf().Size() and then convert it to
LogicalRect. We really should generalize ContentBSize(), and provide
ContentSize() for such purpose.

Differential Revision: https://phabricator.services.mozilla.com/D68065

--HG--
extra : moz-landing-system : lando
2020-03-25 18:12:25 +00:00
Emily McDonough
d3cac52f73 Bug 1341507 part 6 - Enable multiple grid repeat values in Servo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60931

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:48 +00:00
Emily McDonough
e8a1c53e39 Bug 1341507 part 5 - Support multiple tracks in repeat-auto in line name maps r=mats
This includes when using subgrid layout.

Differential Revision: https://phabricator.services.mozilla.com/D60930

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:45 +00:00
Emily McDonough
e2096a565d Bug 1341507 part 4 - Add auto-fill length field to line name lists returned from Servo. r=mats,emilio
Rename fill_idx to fill_start, to indicate it is not a single value but a
range. Also change a numeric_limits<>::max() involving the fill_start to use
decltype() to ensure its type matches that of the auto-generated structure's
field, while we're touching that code.

The test to ensure only a single repeat value is allowed will be removed by a
later commit.

Differential Revision: https://phabricator.services.mozilla.com/D60929

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:43 +00:00
Emily McDonough
e478232272 Bug 1341507 part 3 - Support multiple repeat values when getting the sizing of a track by index. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D60928

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:35 +00:00
Emily McDonough
7199fa5871 Bug 1341507 part 2 - Take multiple repeat track sizes into account when computing how many repetitions will fit. r=mats
This also means that the result of CalculateRepeatFillCount is specified to be
a number of repetitions of all repeat tracks, not the total number of tracks.

Differential Revision: https://phabricator.services.mozilla.com/D60927

--HG--
extra : moz-landing-system : lando
2020-03-19 22:35:48 +00:00
Stefan Hindli
f3854a78ed Backed out 7 changesets (bug 1341507) for mochitest failures in dom/grid/test/chrome/test_grid_repeat_auto_fill.html CLOSED TREE
Backed out changeset e4e968fabe2b (bug 1341507)
Backed out changeset 6cafdef7eb79 (bug 1341507)
Backed out changeset eff4ad47440c (bug 1341507)
Backed out changeset 55432ee0cd4b (bug 1341507)
Backed out changeset e798ebf91eca (bug 1341507)
Backed out changeset 08d38f05b160 (bug 1341507)
Backed out changeset 6b35af9ecb38 (bug 1341507)
2020-03-19 02:49:17 +02:00
Emily McDonough
8cc2cae246 Bug 1341507 part 6 - Enable multiple grid repeat values in Servo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60931

--HG--
extra : moz-landing-system : lando
2020-03-18 22:44:41 +00:00
Emily McDonough
cd299acef9 Bug 1341507 part 5 - Support multiple tracks in repeat-auto in line name maps r=mats
This includes when using subgrid layout.

Differential Revision: https://phabricator.services.mozilla.com/D60930

--HG--
extra : moz-landing-system : lando
2020-03-18 23:01:23 +00:00