Commit graph

596 commits

Author SHA1 Message Date
Ting-Yu Lin
ce9040c985 Bug 1794035 Part 4 - Use range-based for loops to iterate nsFrameList. r=emilio
After this patch, we still need nsFrameList::Enumerator to iterate
nsFrameList::Slice. We might enhance nsFrameList::Iterator to support Slice, but
I'll leave this for another day.

Differential Revision: https://phabricator.services.mozilla.com/D158809
2022-10-07 01:41:41 +00:00
Emilio Cobos Álvarez
a3231a2981 Bug 1793375 - Rename nsILineIterator::GetDirection to IsLineIteratorFlowRTL. r=dholbert
bool GetDirection() is rather meaningless.

Differential Revision: https://phabricator.services.mozilla.com/D158474
2022-10-03 11:00:39 +00:00
Emilio Cobos Álvarez
12a34801fb Bug 1792333 - Implement nsILineIterator in nsFlex/GridContainerFrame. r=dholbert
Instead of digging into the first line-iterable frame. Digging into the
first line-iterable frame is bogus, because if there are multiple flex
items we might prevent moving through them properly (see test-case).

The flex implementation is nice and fairly complete, IMO. The grid one
is not, but the resulting behavior is nicer than the behavior before
this patch, seems reasonable, and matches Chrome in my testing.

In Searchfox, the behavior is even funnier because user-select: none is
involved, but that predates the regression.

Differential Revision: https://phabricator.services.mozilla.com/D158086
2022-10-02 07:49:46 +00:00
Martin Robinson
f943c5f18d Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 20:32:27 +00:00
Norisz Fay
fd54c095de Backed out changeset c3780baf6f24 (bug 1789255) for causing build bustages CLOSED TREE 2022-09-15 21:14:04 +03:00
Martin Robinson
631f1807ed Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
2022-09-15 17:56:42 +00:00
Sandor Molnar
4009825526 Backed out changeset 3a5759eabb42 (bug 1789255) for causing wpt failures in netwerk/protocol/http/Http2Session.cpp CLOSED TREE 2022-09-14 02:01:36 +03:00
Martin Robinson
f48a334b7c Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio
Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D156473
2022-09-13 20:01:35 +00:00
Martin Robinson
ff6e1e7e64 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-29 14:41:36 +00:00
Sandor Molnar
a4f3a0f44b Backed out changeset f67c8298a104 (bug 1767262) for causing wpt assertion failures in layout/base/PresShell.cpp CLOSED TREE 2022-08-24 20:39:45 +03:00
Martin Robinson
9d8878f0d0 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-24 13:30:55 +00:00
Butkovits Atila
5c5ef28ffa Backed out changeset 5a4a5749f8dc (bug 1767262) for causing wpt failures. 2022-08-23 18:33:04 +03:00
Martin Robinson
4d8325d138 Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-23 14:16:10 +00:00
Emilio Cobos Álvarez
352d47e585 Bug 1786214 - Remove UseAutoBSize flag. r=TYLin
Use a more precise, grid-specific flag to avoid applying grid stretching
etc, and pass an unconstrained block size instead for baseline alignment
measuring, which will cause us to interpret relative sizes as auto.

This shouldn't cause any behavior change, but is a prerequisite
necessary for bug 1609403 (where we don't always want definite sizes
being ignored in measuring reflows for baseline alignment). It's also a
bit clearer, IMO.

Differential Revision: https://phabricator.services.mozilla.com/D155178
2022-08-23 09:17:38 +00:00
Emilio Cobos Álvarez
a4d3fd0893 Bug 1785310 - More hybrid build includes.
MANUAL PUSH: Bustage fix CLOSED TREE
2022-08-18 00:29:06 +02:00
Butkovits Atila
ae6a677e52 Backed out changeset 7538d23ee88e (bug 1767262) for causing failures at content-visibility-081.html. CLOSED TREE 2022-08-15 20:37:49 +03:00
Martin Robinson
1cf715eb0d Bug 1767262 - Lazily layout content that is hidden via content-visibility: hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D145949
2022-08-15 16:18:43 +00:00
Ziran Sun
e9ef6ad79c Bug 1783611 - Calculate repeat fill count 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 repeat fill count using the contain intrinsic block size.

Differential Revision: https://phabricator.services.mozilla.com/D153933
2022-08-13 12:27:07 +00:00
Ziran Sun
d2ec77d012 Bug 1783006 - Calculate the track sizes with the contain intrinsic block size if available. r=emilio,Oriol
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/D153623
2022-08-12 19:17:17 +00:00
Norisz Fay
ffad6ce46f Backed out changeset 11827eed4f4d (bug 1783006) for causing wpt failures on contain-size-grid-004.html 2022-08-08 13:57:42 +03:00
Ziran Sun
321b6fc7a6 Bug 1783006 - Calculate the track sizes with the contain intrinsic block size if available. r=emilio,Oriol
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/D153623
2022-08-08 09:18:39 +00:00
Noemi Erli
8ccd15f6fd Backed out changeset 1419f27a7416 (bug 1783006) for causing failures in contain-intrinsic-size-026.html CLOSED TREE 2022-08-03 23:21:28 +03:00
Ziran Sun
3f144b8c3d Bug 1783006 - 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/D153623
2022-08-03 17:00:27 +00:00
Butkovits Atila
790273f0c3 Backed out changeset d8a0b480e0b1 (bug 1632447) for landing with wrong bug number. CLOSED TREE 2022-08-03 18:10:40 +03:00
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