Commit graph

612 commits

Author SHA1 Message Date
Ben Freist
8b3a740547 Bug 1805097 - [refactor] Migrate NS_STYLE_MASONRY_* defines r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D164422
2023-01-03 12:14:56 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Tiaan Louw
650c19c965 Bug 1799111 - Don't apply auto min sizing when spanning flexible tracks. r=emilio
This is the first part of the bug.  A clarification in the spec states
that a grid item spanning multiple tracks, which include a flexible
track, should not participate in auto min sizing calculation and should
have a width of 0.

https://w3c.github.io/csswg-drafts/css-grid-1/#min-size-auto

For the reftest, the previous overrides are removed as the correct
behaviour is now implemented.

Differential Revision: https://phabricator.services.mozilla.com/D160900
2022-11-21 07:21:17 +00:00
Tiaan Louw
38a8b8dc54 Bug 1799707 - Cleanup ResolveIntrinsicSize function with better naming r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D161763
2022-11-19 10:35:48 +00:00
Ting-Yu Lin
514d412f9b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-12 04:38:53 +00:00
Noemi Erli
7c40c0e983 Backed out 3 changesets (bug 1799732) for causing build bustages in nsIFrame.cpp CLOSED TREE
Backed out changeset e559f9dbc76f (bug 1799732)
Backed out changeset c40fda7a8b0b (bug 1799732)
Backed out changeset 1f84bfb41ab8 (bug 1799732)
2022-11-12 02:16:45 +02:00
Ting-Yu Lin
192956df1b Bug 1799732 Part 3 - Convert FrameChildListID to enum class. r=emilio
This patch is first generated by the following script under gecko root folder.

```
#!/bin/bash

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "kPrincipalList" "FrameChildListID::Principal"
rename "kPopupList" "FrameChildListID::Popup"
rename "kCaptionList" "FrameChildListID::Caption"
rename "kColGroupList" "FrameChildListID::ColGroup"
rename "kAbsoluteList" "FrameChildListID::Absolute"
rename "kFixedList" "FrameChildListID::Fixed"
rename "kOverflowList" "FrameChildListID::Overflow"
rename "kOverflowContainersList" "FrameChildListID::OverflowContainers"
rename "kExcessOverflowContainersList" "FrameChildListID::ExcessOverflowContainers"
rename "kOverflowOutOfFlowList" "FrameChildListID::OverflowOutOfFlow"
rename "kFloatList" "FrameChildListID::Float"
rename "kBulletList" "FrameChildListID::Bullet"
rename "kPushedFloatsList" "FrameChildListID::PushedFloats"
rename "kBackdropList" "FrameChildListID::Backdrop"
rename "kNoReflowPrincipalList" "FrameChildListID::NoReflowPrincipal"
```

And then:
1. Manually fix `FrameChildListID` definition in nsFrameList.h.
2. Apply clang-format.

Differential Revision: https://phabricator.services.mozilla.com/D161864
2022-11-11 23:44:17 +00:00
Cristian Tuns
47d4ab36e9 Backed out changeset b2e56f907f70 (bug 1799111) reftest failures on grid-track-fit-content-sizing-001.html CLOSED TREE 2022-11-04 11:38:46 -04:00
Tiaan Louw
8c0f480a7d Bug 1799111 - Don't apply auto min sizing when spanning flexible tracks. r=emilio
This is the first part of the bug.  A clarification in the spec states
that a grid item spanning multiple tracks, which include a flexible
track, should not participate in auto min sizing calculation and should
have a width of 0.

https://w3c.github.io/csswg-drafts/css-grid-1/#min-size-auto

Differential Revision: https://phabricator.services.mozilla.com/D160900
2022-11-04 14:05:48 +00:00
Emilio Cobos Álvarez
078a10f45f Bug 1798830 - Clean up DisplayFlagForFlexOrGridItem. r=dholbert
No need to be an out of band member function given the only callers are
in flex / grid code.

I was looking at this in the context of bug 1798396. This probably
doesn't matter for PGO, but it being a static method helps reason about
the flags being the same for all items.

Differential Revision: https://phabricator.services.mozilla.com/D161102
2022-11-03 02:32:47 +00:00
Ting-Yu Lin
040feb02dd Bug 1798373 Part 7 - Change nsContainerFrame::InsertFrames() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160843
2022-11-01 21:15:55 +00:00
Ting-Yu Lin
c99b45fa14 Bug 1798373 Part 6 - Change nsContainerFrame::AppendFrames() to take rvalue reference of nsFrameList. r=emilio
Change nsBlockFrame::AppendFrames() helper, too.

Differential Revision: https://phabricator.services.mozilla.com/D160842
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
4787078c5c Bug 1798373 Part 5 - Change nsContainerFrame::SetInitialChildList() to take rvalue reference of nsFrameList. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D160841
2022-11-01 21:15:54 +00:00
Ting-Yu Lin
13d40cfd97 Bug 1797011 Part 1 - Delete nsFrameList's copy constructor. r=layout-reviewers,emilio
This patch doesn't change behavior, and eliminates copy construction of
nsFrameList via utilizing const-references to store the return value of
`GetChildList()`.

nsFrameList::Clone() is added in case the caller wants a copy of a list.

This is the first step toward making nsFrameList a move-only class.

Differential Revision: https://phabricator.services.mozilla.com/D160013
2022-10-26 04:22:24 +00:00
Butkovits Atila
b704dcf231 Backed out 4 changesets (bug 1797011) for causing high frequency ThreadSanitizer failures. CLOSED TREE
Backed out changeset e55bef9aa488 (bug 1797011)
Backed out changeset 515757be2f7e (bug 1797011)
Backed out changeset 360739dfb6d1 (bug 1797011)
Backed out changeset 9a3f104b78c5 (bug 1797011)
2022-10-25 01:03:29 +03:00
Ting-Yu Lin
a3eea20a9b Bug 1797011 Part 1 - Delete nsFrameList's copy constructor. r=layout-reviewers,emilio
This patch doesn't change behavior, and eliminates copy construction of
nsFrameList via utilizing const-references to store the return value of
`GetChildList()`. This is the first step toward making nsFrameList a move-only
class.

Differential Revision: https://phabricator.services.mozilla.com/D160013
2022-10-24 19:14:32 +00:00
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