Commit graph

870 commits

Author SHA1 Message Date
Cosmin Sabou
543905e105 Backed out 3 changesets (bug 1809568) for causing build bustages on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset eaa7fe280317 (bug 1809568)
Backed out changeset ab0f2bcb2d9b (bug 1809568)
Backed out changeset a481bf06452b (bug 1809568)
2023-05-01 21:42:14 +03:00
David Shin
d2ebe93a83 Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 17:04:27 +00:00
Iulian Moraru
c9ffb3ffa8 Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp. CLOSED TREE
Backed out changeset 573dc0bd9554 (bug 1809568)
Backed out changeset b8401947aea0 (bug 1809568)
Backed out changeset 7ecabe895121 (bug 1809568)
2023-05-01 17:59:21 +03:00
David Shin
8ff73f5fcc Bug 1809568 - Part 2: Provide GetNaturalBaselineBOffset with baseline export context. r=emilio
Some baseline exports are context-sensitive. One example: In line-layout scenario,
the last baseline of a scroll container is always the margin-end. In other (e.g.
flex, grid) scenarios, it's the border-box clamped offset to the last line in the
container.
This enables the required 3 different behaviours for `inline-block` scroll containers
for 3 different `baseline-source` values:
- `auto`: Last baseline, margin-end
- `first`: Border-box clamped offset to the first line
- `last`: Border-box clamped offset to the last line

Differential Revision: https://phabricator.services.mozilla.com/D173886
2023-05-01 13:44:43 +00:00
Ting-Yu Lin
05e90a8a3e Bug 1827582 - Fix flex container's reflow status when unbreakable flex items consume all content block-size in current fragment. r=dholbert
The bug occurs in `PopulateReflowOutput()` when we change the reflow status of
an auto-height flex container to "complete" because unbreakable tall flex items
have consumed all the theoretical/unfragmented content block-size. Later in
`PopulateReflowOutput()`, we'll change the reflow status [1] to "overflow
incomplete," which cause the next-in-flow to become an overflow container.

It is possible that the container's block-size will grow due to pushed items.
However, `nsSplittableFrame::CalcAndCacheConsumedBSize()` [2] doesn't consider
the overflow container's block-size, so we never correctly consume the extra
block-size growth in later fragments due to pushed items. We end up creating
infinite columns.

[1] https://searchfox.org/mozilla-central/rev/54c533e94ae786056a43231f230c7d9b0773cb80/layout/generic/nsFlexContainerFrame.cpp#5623-5626
[2] https://searchfox.org/mozilla-central/rev/54c533e94ae786056a43231f230c7d9b0773cb80/layout/generic/nsSplittableFrame.cpp#201-204

Differential Revision: https://phabricator.services.mozilla.com/D175543
2023-04-19 21:53:24 +00:00
Ting-Yu Lin
88dc965884 Bug 1827131 - Soften the assertion in nsFlexContainerFrame::ReflowChildren(). r=dholbert
This is derived from the original revision that gets R+ in bug 1826635.
https://phabricator.services.mozilla.com/D174993?id=702649

Differential Revision: https://phabricator.services.mozilla.com/D175024
2023-04-10 23:42:22 +00:00
Ting-Yu Lin
b9d6a9ab5c Bug 1826635 - Don't push flex item if available block-size is unconstrained. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D174993
2023-04-09 07:54:02 +00:00
Ting-Yu Lin
84a42fd613 Bug 1826635 - Fix a comment in ReflowChildren(). r=dholbert
SumOfChildrenBlockSizeProperty() was moved into PerFragmentFlexData in
Bug 1804997 Part 4 [1], and later it was renamed in Bug 1743890 Part 4 [2].

[1] https://hg.mozilla.org/mozilla-central/rev/0404d371c42f3e73b56678fe52a89f4f788ea9b5
[2] https://hg.mozilla.org/mozilla-central/rev/6064a73fc99f012a7400393bdc2ade89fbdf30f8

Differential Revision: https://phabricator.services.mozilla.com/D174992
2023-04-09 07:54:01 +00:00
Ting-Yu Lin
a78e0904e3 Bug 1743890 Part 4 - Rename mSumOfChildrenBSize to mCumulativeContentBoxBSize. r=dholbert
Rename per review comments in
https://phabricator.services.mozilla.com/D165192?id=698523#inline-961796

Differential Revision: https://phabricator.services.mozilla.com/D174172
2023-03-31 16:25:32 +00:00
Ting-Yu Lin
f3117a6913 Bug 1743890 Part 2 - Push monolithic flex item exceeding available block-size to next-in-flow. r=dholbert
This patch deals with two things:

1. Push tall monolithic flex items to next-in-flow, and adjust their positions.
2. Grow flex container's block-size if its block-size is unconstrained.

This patch doesn't fix:
1. Item shifts in different lines in a multi-line column-oriented container
   (bug 1806717).
2. Flex container block-size grow due to flex item's block-size grow in
   fragmentation.

If a flex item has break-before:avoid, we don't want to push it to the
next-in-flow (in the computaion of `shouldPushItem`). Otherwise, we'll fail
web-platform/tests/css/css-break/flexbox/multi-line-column-flex-fragmentation-034.html

Differential Revision: https://phabricator.services.mozilla.com/D165192
2023-03-31 16:25:31 +00:00
Ting-Yu Lin
fafca7f824 Bug 1743890 Part 1 - Add more log to flex container. r=dholbert
MoveFlexItemToFinalPosition() already has a log printing flex item's position.
This patch adds a log in ReflowFlexItem() to print flex item's position, too.

Differential Revision: https://phabricator.services.mozilla.com/D165191
2023-03-31 16:25:30 +00:00
Emilio Cobos Álvarez
2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
Andi-Bogdan Postelnicu
fa5d4cca1f Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 11:35:33 +00:00
Stanca Serban
e31a178029 Backed out 7 changesets (bug 1660405) for causing bustages on Linux x64 opt. CLOSED TREE
Backed out changeset ad1a5f59214f (bug 1660405)
Backed out changeset a39e95f0aafe (bug 1660405)
Backed out changeset 48629ee0d70d (bug 1660405)
Backed out changeset 8419b99aab60 (bug 1660405)
Backed out changeset 535cc12c8bed (bug 1660405)
Backed out changeset e27052da4927 (bug 1660405)
Backed out changeset 11b0f9cf8091 (bug 1660405)
2023-03-22 13:05:53 +02:00
Andi-Bogdan Postelnicu
0b692b5a96 Bug 1660405 - Move away from mozilla::IsFinite in favor of std::isfinite. r=sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D173036
2023-03-22 09:27:57 +00:00
Ting-Yu Lin
f0015a059f Bug 1270891 - Don't honor forced break properties when generating flex lines. r=dholbert
This behavior was based on the old spec. See the spec changes in
https://drafts.csswg.org/css-flexbox-1/#change-201409-algo-breaks

Differential Revision: https://phabricator.services.mozilla.com/D172697
2023-03-16 23:19:10 +00:00
Emilio Cobos Álvarez
c0f66baed0 Bug 1821603 - Fix writing-mode mismatch in visibility: collapse handling. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D172438
2023-03-13 22:19:47 +00:00
Emilio Cobos Álvarez
7fea7835ba Bug 1819936 - Move legacy -moz-box collapse to its own CSS property. r=jwatt
Make display: -moz-box's visibility: collapse handling switchable by its
own CSS property.

Longer term maybe we should switch the front-end away from visibility:
collapse altogether (there are some alternatives), but for now this will
allow to move the front-end to switch to modern `display: flex` while
keeping `visibility: collapse` work as in -moz-box.

Differential Revision: https://phabricator.services.mozilla.com/D171472
2023-03-06 11:14:40 +00:00
Ting-Yu Lin
19a0c5fb59 Bug 1819211 - Export Baseline.h under mozilla. r=emilio
It is because `Baseline` is a utility class under `namespace mozilla`.

Also change the include guard to match the coding style.
https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html#header-files

Differential Revision: https://phabricator.services.mozilla.com/D171162
2023-03-01 03:50:03 +00:00
David Shin
f5a42005e2 Bug 1811311 - Part 3: Refactor GetNaturalBaselineBOffset to return Maybe<nscoord>. r=layout-reviewers,emilio
Changed from returning `bool` & taking an out parameter.

Differential Revision: https://phabricator.services.mozilla.com/D168998
2023-02-23 14:53:27 +00:00
David Shin
e02d078c12 Bug 1811311 - Part 2: Extract SynthesizeBaselineBOffsetFrom* out of nsIFrame. r=emilio
These functions work fine as static functions, and `nsIFrame` is pretty overloaded.

Differential Revision: https://phabricator.services.mozilla.com/D167991
2023-02-23 14:53:27 +00:00
David Shin
5c7c22165f Bug 1811311 - Part 1: Unite baseline-related functions in nsIFrame into one. r=emilio
Before, there existed 3 virtual functions that calculated baselines:

- `GetLogicalBaseline`
- `GetVerticalAlignBaseline`
- `GetNaturalBaselineBOffset`

Each of them had slightly different behaviours:

- `GetLogicalBaseline` would synthesize a baseline if there is no baseline.
  Others would simply return `false`.
- `GetNaturalBaselineBOffset` requires the caller to pick which of first/last
  baseline to calculate. Others pick on on their own.
- `GetNaturalBaselineBOffset`'s result can be either offset from border box
   start/end edge, depending on the caller-supplied baseline. Others always
   return offset from border box start edge.

Now:

- `GetNaturalBaselineBOffset` is the sole virtual function.
- `GetLogicalBaseline` exists to support its use, with 2 virtual helper functions:
  - `SynthesizeFallbackBaseline` to generate a baseline for elements that
    doesn't have one.
  - `GetBaselineSharingGroup` to preserve the default baseline picking behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D167990
2023-02-23 14:53:26 +00:00
David Shin
7b3603ea6c Bug 1815936 - In flexbox baseline calculation, ensure that the offset originates from border-start. r=dholbert
`GetNaturalBaselineBOffset` returns the offset originating from border-end for
last baselines.

Differential Revision: https://phabricator.services.mozilla.com/D169362
2023-02-22 20:19:24 +00:00
Iulian Moraru
9b76a2e623 Backed out changeset 3f46184524f1 (bug 1815936) for causing wpt failures on flex-align-baseline-flex-001.html. CLOSED TREE 2023-02-17 21:41:06 +02:00
David Shin
b02c8246c1 Bug 1815936 - In flexbox baseline calculation, ensure that the offset originates from border-start. r=dholbert
`GetNaturalBaselineBOffset` returns the offset originating from border-end for
last baselines.

Differential Revision: https://phabricator.services.mozilla.com/D169362
2023-02-17 17:02:24 +00:00
Ting-Yu Lin
a550ab4c13 Bug 1637091 - Always reflow a flex item in a fragmented context. r=dholbert
nsColumnSetFrame can reflow its last column in an unconstrained available
block-size to measure the total block-size of the content [1]. This patch adds a
helper method in ReflowInput for that.

For flex items in a fragmented context, we *cannot* skip its final reflow
because fragmentation might grow its block-size if there's any force break in
it (bug 1663079), or if it has repeated table header/footer (bug 1744363).

This patch doesn't change observable behavior for now. Before this patch, we may
skip an item's final reflow if it is in a flex container's continuation that is
in the last column with an unconstrained available block-size. As of this patch,
the item will be reflowed. This is a partial step towards fixing the above bugs
where the item's block-size may grow.

[1] https://searchfox.org/mozilla-central/rev/daf613efc5c358f3a94961d73b90472c00703838/layout/generic/nsColumnSetFrame.cpp#614-621

Differential Revision: https://phabricator.services.mozilla.com/D167207
2023-02-06 22:04:21 +00:00
Ting-Yu Lin
0971798aca Bug 1809564 - Remove macros getting main/cross component. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D166488
2023-01-11 23:17:44 +00:00
Ting-Yu Lin
a45a1c2c20 Bug 1804997 Part 4 - Move SumOfChildrenBlockSizeProperty into a struct. r=dholbert
ReflowChildren() needs more bookkeeping data to correctly place tall flex items
being pushed from prev-in-flows during fragmentation. This is a preparation for
bug 1743890 that is going to add more fields to the struct.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D164399
2022-12-15 21:58:31 +00:00
Ting-Yu Lin
d5e1c77a20 Bug 1804997 Part 3 - When building a flex container's next-in-flows, carry forward its items' groupings into distinct FlexLines. r=dholbert
When I first implemented flexbox fragmentation, all the children in flex
container's next-in-flows are all put in one FlexLine, because we assume the
position of flex items won't shift in fragmentation. However, when we implement
more granular control of flexbox fragmentation such as pushing a tall flex item
to next page/column, we'll need the information of flex lines.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D164398
2022-12-15 21:58:31 +00:00
Ting-Yu Lin
66b246d165 Bug 1804997 Part 2 - Rename areChildrenComplete to anyChildIncomplete. r=dholbert
This is a follow-up of Bug 1622935 Part 1
https://hg.mozilla.org/mozilla-central/rev/78d4dfbda06a

The variable storing the return value of ReflowChildren should be renamed, too.

Differential Revision: https://phabricator.services.mozilla.com/D164397
2022-12-15 21:58:30 +00:00
Ting-Yu Lin
457f6eb83e Bug 1804997 Part 1 - Simplify GenerateFlexItemForChild(). r=dholbert
- Remove the return value since it is never used.
- Store the newly create flex item in a reference since EmplaceBack() returns
  NonNull<FlexItem*>.

Differential Revision: https://phabricator.services.mozilla.com/D164396
2022-12-15 21:58:30 +00:00
Ting-Yu Lin
e99e67b0f7 Bug 1805522 - Construct SharedFlexData for incomplete flex containers, regardless of whether they have constrained BSize. r=dholbert
This reverts part of Bug 1803486 Part 1.

The crashtest was adapted from bug 1805522 comment 0. I use wpt printing test
since window.print() doesn't work in wpt crashtest.

Differential Revision: https://phabricator.services.mozilla.com/D164635
2022-12-14 20:51:59 +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
Ting-Yu Lin
c04b02498d Bug 1803486 Part 4 - Remove arguments for CheckForMinSizeAuto() and rename it. r=dholbert
The arguments are removed for the following reasons:

1) We might need to call it in future patches when ReflowInput is not available.
   Although getting the cached style struct pointers from ReflowInput is cheaper,
   but getting them from the frame directly is not expensive nowadays.

2) We can initialize mNeedsMinSizeAutoResolution directly in the member
   initializer list.

Also, simplify its implementation and comments.

Differential Revision: https://phabricator.services.mozilla.com/D163548
2022-12-01 22:29:56 +00:00
Ting-Yu Lin
8dc12efebe Bug 1803486 Part 3 - Add SharedFlexData::Update(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D163547
2022-12-01 22:29:55 +00:00
Ting-Yu Lin
8f9e8be26a Bug 1803486 Part 2 - Move prevInFlow definition up in nsFlexContainerFrame::Reflow(). r=dholbert
Depends on D163545

Differential Revision: https://phabricator.services.mozilla.com/D163546
2022-12-01 22:29:55 +00:00
Ting-Yu Lin
b0619f5571 Bug 1803486 Part 1 - Guard logic required only by fragmentation for flex container. r=dholbert
This separation makes hacking fragmentation code easier, and readers who are not
interested in flex container fragmentation can skip it.

Differential Revision: https://phabricator.services.mozilla.com/D163545
2022-12-01 22:29:54 +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
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
Emilio Cobos Álvarez
4e91d2f0e8 Bug 1797504 - Make nsFlexContainerFrame::UnionChildOverflow() keep including out of flows. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D160374
2022-10-26 18:38:27 +00:00
Emilio Cobos Álvarez
c45abc29af Bug 1797272 - Fix flex container dynamic overflow updates to avoid triggering extra reflows. r=TYLin
Move the custom overflow code to UnionChildOverflow, so that it's
computed correctly from UpdateOverflow() when a transformed descendant
changes.

This can cause extra reflows in some cases. In the case of the tab bar
it was here:

  https://searchfox.org/mozilla-central/rev/12a18f7e112a4dcf88d8441d439b84144bfbe9a3/layout/generic/nsGfxScrollFrame.cpp#6916

The subsequent reflow ended up fixing up the overflow areas, so I don't
think it's a correctness issue otherwise.

It seems grid has the same issue, but it seems a bit harder to fix
because of subgrid and masonry. Filed filed bug 1797305 for that.

Differential Revision: https://phabricator.services.mozilla.com/D160221
2022-10-25 22:42:27 +00:00
Ting-Yu Lin
cd2c1471d2 Bug 1795196 Part 2 - Convert ComputedMin{I|B}Size() and ComputedMax{I|B}Size() that return writable references to setters. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D159353
2022-10-18 00:26:20 +00:00
Emilio Cobos Álvarez
ae203c5f2c Bug 1793727 - Make -moz-collapsed items not contribute to scrollable overflow of their flex container. r=TYLin
This fixes some tests with flex emulation enabled in the browser
toolbox (which I plan to enable soon enough in bug 1790616).

Differential Revision: https://phabricator.services.mozilla.com/D158629
2022-10-06 22:48:04 +00:00
Emilio Cobos Álvarez
ed051e8a4c Bug 1793727 - Clean-up some code related to visibility: collapse handling in flexbox. r=jwatt
No behavior change intended.

Depends on D158627

Differential Revision: https://phabricator.services.mozilla.com/D158628
2022-10-06 14:20:38 +00:00
Emilio Cobos Álvarez
873867b161 Bug 1793727 - Minor optimization: avoid looping through all items to see if we have any collapsed strut. r=jwatt
Keep track of whether we have any collapsed items, since we're already
looking at it while generating them.

No behavior change intended.

Differential Revision: https://phabricator.services.mozilla.com/D158627
2022-10-06 14:20:38 +00:00
Emilio Cobos Álvarez
d5836162f2 Bug 1793700 - Improve widget-imposed min size handling. r=TYLin,layout-reviewers,dshin
Make it work as a min-size everywhere rather than only handling it in
nsIFrame::ComputeSize.

This is more similar to what XUL code does. In particular, it makes
makes it work for elements that don't have a definite size in
ComputeSize (like flex containers).

For web-exposed widgets this only matters for <input type=color> and
<input type=range>, which are the only exposed widgets that return a
minimum size that return a minimum size. This patch makes the minimum
size honored for `<input type="color" style="height: auto">`. Add a test
for that (though we might want to change it to match other browsers).

Without this fix, min/max/close buttons on Linux are zero-height with
flex emulation, because we fail to account for their minimum
widget-imposed size.

This allows us to remove the special case in nsFlexContainerFrame too,
since that should be handled by ReflowInput correctly now.

Differential Revision: https://phabricator.services.mozilla.com/D158612
2022-10-05 19:34:03 +00:00