Commit graph

886 commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
2414af9244 Bug 1793689 - Make GetMinimumWidgetSize work properly on non-XUL flexbox. r=TYLin,layout-reviewers
The XUL behavior in nsBox.cpp is fairly different to what the non-XUL
layout code paths do. In particular, canOverride=false means that the
min-{width,height} properties cannot go under the min widget size of the
widget, but that doesn't mean that intrinsic sizes don't affect the
final size of the widget.

This is very visible if you turn on flex emulation on Windows or macOS,
where the toolbar has an appearance that returns
width=0,height=N,canOverride=false.

With flex emulation we'd collapse the item to be zero-width, which is
not good at all.

The good thing is that this is no longer exposed to the web
(non-native-theme always returns canOverride=true), and our front-end
code doesn't seem to rely on this, so we can just remove support for
canOverride=false.

Differential Revision: https://phabricator.services.mozilla.com/D158608
2022-10-05 19:09:29 +00:00
Emilio Cobos Álvarez
dd98178218 Bug 1793687 - Simplify collapse code for legacy moz-box. r=dshin
Recently we added different bits for -webkit-/-moz- box emulation, so we
no longer need to go look at the scrolled frame etc.

Differential Revision: https://phabricator.services.mozilla.com/D158603
2022-10-05 14:23:15 +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
Ting-Yu Lin
dbd25c17f5 Bug 1791458 - Remove auto main-size workaround for replaced elements when computing flex base size. r=emilio
After bug 1340715, we use the same path [1] when computing `auto` and
`max-content` inline-sizes for replaced elements in
`nsContainerFrame::ComputeSizeWithIntrinsicDimensions()`. For block-sizes,
`max-content` and `auto` already have the same behavior.

This patch shouldn't change the behavior.

[1] https://searchfox.org/mozilla-central/rev/6d7704caae2a61b0101bdb67481a80af20376663/layout/generic/nsContainerFrame.cpp#2354-2355

Differential Revision: https://phabricator.services.mozilla.com/D157678
2022-09-19 23:49:06 +00:00
Ting-Yu Lin
f752657659 Bug 1791430 - Remove a "Not Implemented Yet" warning of bug 1480850 in flex container. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D157667
2022-09-19 20:55:14 +00:00
Daniel Holbert
8be8e10200 Bug 1786910: Ignore 'align-content' when determining the aligned static position of abspos flex children. r=TYLin
Before this patch, we honored `align-content` (in combination with
`align-self`) for cross-axis alignment for abspos flex children **in cases
where the flex container was multi-line**. This was a bit weird, but was
required by the spec, and made some sense in the spirit of aligning the abspos
box as if it were the sole flex item in a flex container.

Now the CSSWG has resolved in [1] to simplify things by just ignoring
`align-content` for abspos flex children. So, this patch updates us in
accordance with this change. Such items now only have to look at `align-self`
for cross-axis alignment to determine their static position in their flex
container.

Before this commit, we had a bunch of WPT tests to check the impact of every
align-content value, with all of the various flavors of directionality.  Now
that align-content has *no effect* in any of these cases, all of these tests
become pretty trivial and redundant.  Rather than carrying them all forward
with trivial "no impact" expectations for each scenario, I've just updated the
first/simplest such test to expect no-behavioral-impact and I've removed the
rest.

[1] https://github.com/w3c/csswg-drafts/issues/7596#issuecomment-1225952646

Differential Revision: https://phabricator.services.mozilla.com/D157571
2022-09-19 20:36:05 +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
Ting-Yu Lin
4b20ea1119 Bug 1790312 Part 2 - Remove flex item's normal position snapshot in ReflowChildren(). r=dholbert
ReflowChildren() only cares about the flex item's normal position, so we don't
need to output the relative position from `MoveFlexItemToFinalPosition()`.

By making `aFramePos` const for `MoveFlexItemToFinalPosition`, we can delete
`itemNormalBPos` because `framePos` cannot be changed after calling
`MoveFlexItemToFinalPosition`.

This patch shouldn't change the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D157079
2022-09-12 16:34:10 +00:00
Ting-Yu Lin
19e8ae9be4 Bug 1790312 Part 1 - Make aFramePos parameter const for ReflowFlexItem(). r=dholbert
`aFramePos` is never modified in ReflowFlexItem().

Differential Revision: https://phabricator.services.mozilla.com/D157078
2022-09-12 16:34:09 +00:00
Emilio Cobos Álvarez
c5d167dfed Bug 1789123 - Split legacy box bits in MOZ/WEBKIT. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D156737
2022-09-08 11:54:45 +00:00
Emilio Cobos Álvarez
b5c2fd645c Bug 1789123 - Make anonymous box wrapping inside XUL boxes be similar to modern flex boxes. r=dholbert
I haven't spotted any UI regression from this, and this should generally
make the XUL -> modern flex transition easier, and simplify some
of the relevant code.

This does fix a few layout issues with emulated flexbox.

For the most part, this shouldn't change behavior without that. This
changes behavior if you have mixed inline/non-inline content in the same
XUL box (before they'd get a single item, now you'd get the flexbox /
grid behavior of one item per inline run), and multiple inline-elements
(which would become their own flex items). But I pushed a patch with
some asserts and they didn't fire on our browser mochitests, so I think
we're good.

The UA rule refactoring (removing the inherit from xul anon blocks)
shouldn't matter in practice, since we only have one item (so
box-ordinal is irrelevant) and they have overflow: visible (so
text-overflow and overflow-clip-box shouldn't have an effect).

Differential Revision: https://phabricator.services.mozilla.com/D156375
2022-09-08 11:51:15 +00:00
Emilio Cobos Álvarez
3c206e563a Bug 1786147 - Make -webkit-line-clamp create a block container in the appropriate situations. r=dholbert
This is a hack, sorta, similar to Chromium's:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_object.cc;l=356;drc=312b74e385e6aba98ab31fd911238c0dc16b396c

except at computed-value rather than used-value time, because it's both
simpler to reason about and prevents lying in the computed style.

This fixes the relevant test-case, and matches closer what Chromium does,
by not creating anonymous flex items for all elements inside the
line-clamp context.

The behavior change is covered by the test changes. I had to also fix a
couple pre-existing bugs that were caught by tests, now that the
line-clamped block is the -webkit-box-styled element rather than an anonymous
flex item (and thus now had padding).

Depends on D155180

Differential Revision: https://phabricator.services.mozilla.com/D155181
2022-09-07 23:57:18 +00:00
Emilio Cobos Álvarez
83c7733c7c Bug 1786147 - Move line-clamp out of mako and do some adjacent clean-up. r=boris
No behavior change, but simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D155180
2022-08-31 12:39:19 +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
Ting-Yu Lin
f030093058 Bug 1786610 - Use auto main-size workaround for replaced elements without aspect-ratio when computing flex base size. r=dholbert
This bug is regressed by Bug 1686603 Part 4 [1]. When the used flex-basis is
'content', the old code computes flex base size by using 'auto' as the main size
in `nsContainerFrame::ComputeSizeWithIntrinsicDimensions()`. The method is for
replaced elements to compute sizes, even if the element has no preferred
aspect-ratio such as an `<svg>` without viewBox nor aspect-ratio property.

However, Bug 1686603 Part 4 made replaced elements without preferred
aspect-ratio uses 'max-content' when computing flex base size. Unfortunately, we
only trigger the replaced elements intrinsic sizing via 'auto' but not via
'max-content', so this patch restores the behavior via emplacing 'auto' in
`styleFlexBaseSize`.

[1] https://phabricator.services.mozilla.com/D101795

Differential Revision: https://phabricator.services.mozilla.com/D155628
2022-08-26 07:20:04 +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
534f39ed75 Bug 1785310 - Remove mozilla/StaticPrefs_layout.h includes from other headers. r=dholbert
Adding layout prefs cause massive rebuilds because of this.

Differential Revision: https://phabricator.services.mozilla.com/D154928
2022-08-17 21:26:36 +00: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
Oriol Brufau
9ebd6bd8e5 Bug 1781995 - Obey contain-intrinsic-size in flex containers. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D152984
2022-07-28 09:42:55 +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
Ting-Yu Lin
cbdc83f787 Bug 1776079 - Delete SharedFlexData() only if there's no flex container's next-in-flow. r=dholbert
nsGridContainerFrame has the same logic.
https://searchfox.org/mozilla-central/rev/6d0ba065e3d41822337c708c8c0aca334ddd9218/layout/generic/nsGridContainerFrame.cpp#9116

Differential Revision: https://phabricator.services.mozilla.com/D150157
2022-06-24 05:00:07 +00:00
Ting-Yu Lin
4b73cd1e20 Bug 1739561 - Honor break-inside:avoid on flex containers. r=dholbert
Note this patch only prevents "break-inside:avoid" flex containers from being
broken when they are not at the top of their current page/column. When they are
at the top of their current page/column, this patch fails to help since
`nsContainerFrame::ShouldAvoidBreakInside()` returns `false` via the
`mIsTopOfPage` check. This is essentially bug 793686.

Differential Revision: https://phabricator.services.mozilla.com/D149318
2022-06-15 00:55:54 +00:00
Boris Chiou
035220bf4c Bug 1760658 - Part 1: Apply automatic content-based minimum on flex container. r=emilio
Basides, factor out the utility function to AspectRatio so everyone can
use it.

Differential Revision: https://phabricator.services.mozilla.com/D144891
2022-05-02 20:06:32 +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
Ting-Yu Lin
04af168c74 Bug 1758020 - Revise MoveFlexItemToFinalPosition(). r=dholbert
This patch shouldn't change the behavior.

* It's OK to get the item's offset only when its relatively positioned, because
  `ApplyRelativePositioning` doesn't use the offset parameter if the frame is
  sticky positioned. Document `ApplyRelativePositioning`'s parameters to clarify
  this. Also, we don't need to call apply relative positioning to a
  non-relatively-and-non-sticky-positioned item.

* Print `FLEX_LOG` after applying relative-positioning because `aFramePos` will
  be adjusted in `ApplyRelativePositioning`, and we really want to see the
  item's "final position".

* `aReflowInput` parameter is removed because it's only used to get flex
  container's WritingMode. We can get it from FlexItem.

Differential Revision: https://phabricator.services.mozilla.com/D140703
2022-03-10 19:17:44 +00:00
Ting-Yu Lin
b48196dcda Bug 1758018 Part 2 - Add helpers testing only "position:relative", and adapt them at some callsites. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D140274
2022-03-04 03:02:01 +00:00
Ting-Yu Lin
7e0c39f9b1 Bug 1758018 Part 1 - Rename the helpers testing "position:relative" or "position:sticky". r=emilio
`nsIFrame::IsRelativelyPositioned()` tests "position:relative" or
"position:sticky", but its naming is misleading until you've dug into the
underlying helper `nsStyleDisplay::IsRelativelyPositionedStyle()`.

Differential Revision: https://phabricator.services.mozilla.com/D140273
2022-03-04 03:02:00 +00:00
Ting-Yu Lin
ae6fa4834c Bug 1752658 Part 7 - Generalize GenerateFlexLines to populate FlexLayoutResult. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D138101
2022-02-08 22:47:20 +00:00
Ting-Yu Lin
141dbba00c Bug 1752658 Part 6 - Pass FlexLayoutResult into ReflowChildren(). r=dholbert
Currently, we pass all the five fields in FlexLayoutResult separately into
ReflowChildren(), but we really should just pass FlexLayoutResult instead.

Differential Revision: https://phabricator.services.mozilla.com/D138100
2022-02-08 22:47:20 +00:00
Ting-Yu Lin
6191c0136b Bug 1752658 Part 5 - Pass flex container's tentative cross size into DoFlexLayout and others. r=dholbert
We've got the tentative cross size before calling DoFlexLayout() in Reflow(), so
we can just use that value in DoFlexLayout and a few other methods.

Also, add "ContentBox" to naming of the main size argument ComputeMainSize().

Differential Revision: https://phabricator.services.mozilla.com/D137365
2022-02-08 22:47:20 +00:00
Ting-Yu Lin
0db4093210 Bug 1752658 Part 4 - Aggregate DoFlexLayout's output data in a struct instead of output arguments. r=dholbert
I found in/out parameters confusing when reasoning the data flow. Aggregating
DoFlexLayout's output data in a struct also reduces DoFlexLayout's number of
arguments.

Differential Revision: https://phabricator.services.mozilla.com/D137364
2022-02-08 22:47:19 +00:00
Ting-Yu Lin
f0a1413baf Bug 1752658 Part 3 - Reduce scope of the struts array in Reflow(). r=dholbert
The `struts` array is used only within DoFlexLayout, so we should move it into
`if (!GetPrevInFlow()) { ... }` branch.

Also, move `nsTArray<StrutInfo>&` argument on DoFlexLayout() to the second to
last place so that the output arguments are grouped together after applying Part
4.

Differential Revision: https://phabricator.services.mozilla.com/D137363
2022-02-08 22:47:19 +00:00
Ting-Yu Lin
2b61aa41a4 Bug 1752658 Part 2 - Remove aConsumedBSize from DoFlexLayout() and ComputeCrossSize(). r=dholbert
DoFlexLayout() and ComputeCrossSize() are only called in first-in-flow, so
aConsumedBSize are always 0.

Differential Revision: https://phabricator.services.mozilla.com/D137362
2022-02-08 22:47:19 +00:00
Ting-Yu Lin
6e68c19465 Bug 1752658 Part 1 - Compute gap sizes only in flex container's first-in-flow. r=dholbert
Move the assertion for unconstrained isize to the beginning of Reflow() because
we check it in all cases -- in GetMainSizeFromReflowInput when a flex container
is row-oriented, or in the old code computing gap size and ComputeCrossSize()
when a flex container is column-oriented.

Differential Revision: https://phabricator.services.mozilla.com/D137361
2022-02-08 22:47:18 +00:00
Ting-Yu Lin
9a07ff37d5 Bug 1751471 - Add a diagnostic preference to always run flex item's final reflow. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D136764
2022-01-25 06:21:08 +00:00
Ting-Yu Lin
32b84f3235 Bug 1747515 - Remove an obsolete comment in nsFlexContainerFrame.cpp. r=dholbert
We introduced this comment at the very beginning of the flexbox implementation.
Since then, WritingModes.h has obtained the utilities dealing with logical axis,
and CSSAlignUtils.h has supported CSS alignment for both flexbox and grid. All
the helper functions remaining in nsFlexContainerFrame.cpp are related to
flexbox, so I feel it's time we retire this comment.

NPOTB DONTBUILD because this patch changes only comments.

Differential Revision: https://phabricator.services.mozilla.com/D134652
2021-12-25 16:11:29 +00:00
Ting-Yu Lin
0ddbd1d7f7 Bug 1543267 Part 2 - Make 'space-between' fallback to 'flex-start' for flexbox's abspos children. r=dholbert
Per Alignment spec [1], the default fallback alignment for 'space-between' is
'flex-start'.

[1] https://drafts.csswg.org/css-align/#valdef-align-content-space-between

Differential Revision: https://phabricator.services.mozilla.com/D134544
2021-12-23 02:08:04 +00:00
Ting-Yu Lin
2d47a61355 Bug 1543267 Part 1 - Make 'stretch' fallback to 'flex-start' for flexbox's abspos children. r=dholbert
In Flexbox spec 4.1, Example 3 [1]:
   ... since the absolutely-positioned box is considered to be
   "fixed-size", a value of stretch is treated the same as flex-start.

Also, per Alignment 3 spec [2]:
  The default fallback alignment for 'stretch' is 'flex-start'.

Thus, when computing the alignment for flexbox's abspos children in
CSSAlignmentForAbsPosChild(), we convert 'stretch' to 'flex-start', and let the
subsequent logic convert 'flex-start' to either 'start' or 'end', because
nsAbsoluteContainingBlock don't know how to deal with the flex-relative axis.

This patch makes us behave the same as Google Chrome on the modified testcases.

[1] https://drafts.csswg.org/css-flexbox/#abspos-items
[2] https://drafts.csswg.org/css-align/#valdef-align-content-stretch

Differential Revision: https://phabricator.services.mozilla.com/D134543
2021-12-23 02:08:03 +00:00
Ting-Yu Lin
5909d5b7f3 Bug 1744895 Part 3 - Fix justify-*:{left|right} mapping for abspos children of flex containers. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D133169
2021-12-10 17:42:23 +00:00
Ting-Yu Lin
fd68e79da7 Bug 1744895 Part 2 - Fix justify-*:{left|right} mapping for vertical row-oriented flex containers. r=dholbert
Currently, we use IsPhysicalLTR() to query which is the start side of the
physical left <-> right axis. However, for vertical row-oriented flex
containers, physical left <-> right axis is its cross axis. We really should
query IsBidiLTR() instead because its main axis is parallel to line-left <->
line-right axis (i.e. inline axis).

flexbox-justify-content-wmvert-003.html is adapted from
flexbox-justify-content-wmvert-002.html.

Differential Revision: https://phabricator.services.mozilla.com/D133168
2021-12-10 17:42:22 +00:00
Ting-Yu Lin
06346bb565 Bug 1744895 Part 1 - Extract a helper mapping justify-*:{left|right} to {start|end}. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D133167
2021-12-10 17:42:22 +00:00
Ting-Yu Lin
248b711736 Bug 1730570 - Clamp flex item's resolved min auto size if it's bogus. r=dholbert
This patch clamps the `resolvedMinSize` before the size is passed into
`UpdateMainMinSize`, which is where the assertion is triggered.

Also, tweak the MOZ_ASSERT a bit because it's best to test an nscoord is
not NS_UNCONSTRAINEDSIZE before invoking comparison operator.

Differential Revision: https://phabricator.services.mozilla.com/D129230
2021-10-26 00:01:58 +00:00
Ting-Yu Lin
ca7c388f7e Bug 1735251 - Use AxisTracker::MainComponent() to retrieve main max size. r=emilio
After Bug 1681849 Part 4 [1], accessing ComputedMaxSize() is trivial.
Note: MainComponent() expects its aSize argument in flex container's
writing mode, which matches aReflowInput's writing mode, so we don't
need any conversion.

[1] https://hg.mozilla.org/mozilla-central/rev/80ed365889fc

Differential Revision: https://phabricator.services.mozilla.com/D128151
2021-10-12 17:51:12 +00:00
Ting-Yu Lin
5a1edcbcec Bug 1145323 - Audit callers of ReflowOutput constructor in nsFlexContainerFrame. r=dholbert
ReflowOutput can accept any writing mode or ReflowInput passed to its
constructor, so a caller can pass a writing mode that is more convenient
to retrieve the size.

After reflowing flex items, we want to cache its metrics in flex item's
writing mode, so we pass item's ReflowInput into ReflowOutput. However,
for out-of-flow children, we can change ReflowOutput to use flex
container's writing mode by convention.

Differential Revision: https://phabricator.services.mozilla.com/D127913
2021-10-08 17:50:35 +00:00
Ting-Yu Lin
143fe07a33 Bug 1700580 Part 4 - Cache flex item's border and padding used in the final reflow. r=dholbert
Currently, we assume any flex item with percentage padding will be
marked as dirty if the percentage basis is changed. However, it is not
true.

To fix it, we cache the flex item's border and padding used in its most
recent final reflow to detect their changes.

dynamic-isize-change-004.html is designed to catch the concern in bug
1700580 comment 12.

Differential Revision: https://phabricator.services.mozilla.com/D125620
2021-09-17 05:54:09 +00:00
Ting-Yu Lin
192d010f2b Bug 1700580 Part 2 - Add a helper class to cache flex item's metrics in its most recent reflow. r=dholbert
This patch introduces a class that caches metrics in flex item's final
reflow. With it, we have a better symmetry for caches, one for measuring
reflow and the other for final reflow. Also, we don't have to explain
that mLastReflowTreatedBSizeAsIndefinite is only meaningful if
mFinalReflowSize is set.

Differential Revision: https://phabricator.services.mozilla.com/D124967
2021-09-17 05:54:08 +00:00
Ting-Yu Lin
16a0744567 Bug 1700580 Part 1 - Unify CachedFlexItemData's APIs that update the existing cache. r=dholbert
Add `CachedFlexItemData::Update()` with the same arguments as the
constructor to update the existing cache for both the measuring & final
reflow.

`mFinalReflowSize` is going to be renamed in a later patch, so I also
change `UpdateFinalReflowSize()` to `Update()` for consistency with the
new API.

Differential Revision: https://phabricator.services.mozilla.com/D124966
2021-09-17 05:54:08 +00:00
Ting-Yu Lin
fe3e424e83 Bug 1730506 - Tweak the assertion again to recognize integer overflow due to huge main gap size. r=dholbert
Similar to bug 1728319, a huge main gap size can also make SumOfGaps()
negative due to integer overflow. This patch is to recognize that
scenario.

We still need to annotate the crashtest because it still triggers the
following assertion in nsIFrame.

```
ASSERTION: inline-size less than zero: 'result >= 0'
```

Differential Revision: https://phabricator.services.mozilla.com/D125778
2021-09-16 23:06:37 +00:00
Ting-Yu Lin
30a1f1e161 Bug 1728319 - Tweak an assertion to recognize integer overflow due to huge margin/border/padding. r=dholbert
We could fix the testcase in this patch by promoting
`FlexLine::mTotalItemMBP` to `AuCoord64`, but then
`layout/generic/crashtests/1488762-1.html` will start crashing. It is
because `FlexItem::OuterMainSize()` can return negative size due to
integer overflow, and the negative sizes will accumulate in
`mTotalOuterHypotheticalMainSize`.

Instead of promoting more variables to `AuCoord64` to workaround huge
margin/border/padding that we cannot handle gracefully, this patch
tweaks the assertion to check only if `mTotalOuterHypotheticalMainSize`
and `mTotalItemMBP` have valid values.

Differential Revision: https://phabricator.services.mozilla.com/D124409
2021-09-03 21:23:52 +00:00
Ting-Yu Lin
85766432de Bug 1725973 Part 1 - Add a FLEX_LOG in MoveFlexItemToFinalPosition(). r=dholbert
Make it easier to spot a flex item is being moved to the final position
rather than going through the final reflow.

Differential Revision: https://phabricator.services.mozilla.com/D123702
2021-08-26 22:43:09 +00:00
Ting-Yu Lin
eb00182e36 Bug 1469649 Part 3 - Upgrade the assertion to MOZ_ASSERT, and update its comments. r=dholbert
The assertion is testing the sign of `availableFreeSpace` and `isUsingFlexGrow`.
After we use 64-bit arithmetic, it's likely that the stronger assertion holds.

Differential Revision: https://phabricator.services.mozilla.com/D123519
2021-08-25 06:43:34 +00:00
Ting-Yu Lin
1162baafb1 Bug 1469649 Part 2 - Use 64-bit coord type when resolving the main size for flex items. r=dholbert
The idea of this patch is to use 64-bit coord type when resolving the
main size for flex items to avoid integer overflow when individual flex
items have huge hypothetical main sizes, which can happen with
percent-width table-layout:fixed descendants. We have to avoid integer
overflow to shrink flex items properly in that scenario.

Delete the "Note:" in `AddLastItemToMainSizeTotals()` since we remove
`AddChecked()` in favor of regular 64-bit addition for
`mTotalOuterHypotheticalMainSize`.

The wpt testcase is adapted from bug 1469649 comment 12.

Differential Revision: https://phabricator.services.mozilla.com/D123268
2021-08-25 06:43:34 +00:00
Ting-Yu Lin
1902424bff Bug 1469649 Part 1 - Promote floating point precision when computing the weight of flex items. r=dholbert
The precision of `double` is needed when we are distributing large
`sizeDelta` via `availableFreeSpace * myShareOfRemainingSpace`.

Without this patch, the wpt test added in Part 2 will fail.

Differential Revision: https://phabricator.services.mozilla.com/D123267
2021-08-25 06:43:33 +00:00
Ting-Yu Lin
2fe6eb093f Bug 1611303 - Always assume a flex item needs a block-axis resize in final reflow. r=dholbert
In an incremental reflow, if a flex item has a valid bsize cache , we
skip its measuring reflow. However, we may still need to set relevant
bsize flags if the flex container is changing its definiteness in the
block-axis. See bug 1611303 comment 2 for an analysis.

This patch is playing safe by always calling SetHasBSizeChange() if we
override bsize for the item. Of course this can be solved in a more
sophisticated way by checking whether the item really has a block-axis
resize, but that means we'll need to duplicate a lot of logic in
FlexItem::NeedsFinalReflow().

Differential Revision: https://phabricator.services.mozilla.com/D122041
2021-08-10 21:43:14 +00:00
Ting-Yu Lin
cd5b6baa4e Bug 1686961 - Don't cache ascent in CachedBAxisMeasurement. r=dholbert
CachedBAxisMeasurement::mAscent caches the ascent of a flex item after
the measuring reflow, but the ascent may change after the final reflow
if the item is stretched and does some vertical alignment internally.
However, we don't cache the new ascent. Therefore, when we reflow the
item incrementally, if the CachedBAxisMeasurement::Key is valid, we just
skip the measuring reflow, and retrieve the wrong ascent from the cache.

Instead of fixing this bug by updating the cached ascent or rejecting
the ascent cache for a stretching flex item in block axis, this patch
removes the cache and sets ReflowOutput's BlockStartAscent() to the flex
item after the item's measuring reflow. (We've done the same after the
item's final reflow.) If the ascent is ReflowOutput::ASK_FOR_BASELINE,
we resolve in FlexItem::ResolvedAscent() anyway.

Differential Revision: https://phabricator.services.mozilla.com/D121404
2021-08-09 20:55:11 +00:00
Daniel Holbert
570c828b36 Bug 1672640 part 2: Fall back to GetNaturalBaselineBOffset to ask flex items what their baseline is. r=TYLin
Our earlier call to nsLayoutUtils::GetFirstLineBaseline/GetLastLineBaseline
works in most cases, but those APIs don't handle every frame type and fails for
text control frames (for example).  This new call should handle those cases
by directly asking the frame for its baseline.

Differential Revision: https://phabricator.services.mozilla.com/D121922
2021-08-06 18:46:21 +00:00
Daniel Holbert
607fd2307c Bug 1672640 part 1: Flatten logic and update comments in FlexItem::ResolvedAscent(). r=TYLin
This patch doesn't affect behavior; it just refactors some logic to have an
early-return and reduce indentation, to make the next patch in this series
easier/simpler.

While we're at it, this patch also updates & extends some neighboring
code-comments to be more specific & more correct about how this code behaves
and its limitations.

Differential Revision: https://phabricator.services.mozilla.com/D121921
2021-08-06 18:46:21 +00:00
Ting-Yu Lin
fed4cc4fdd Bug 1702401 - Reject existing CachedBAxisMeasurement if the item's subtree is dirty. r=dholbert
When a flex item's subtree is dirty, we should reject the cached
measurement and perform a measuring reflow for the item to get the
correct ascent. Without this patch, we are going to call
FlexItem::ResolvedAscent() in the flex algorithm based on a dirty flex
item subtree, and get a wrong ascent. (Although we'll still perform the
final reflow for the item, it's too late to get the correct ascent to
compute flex container's ascent.)

With the above modification, it exposes an existing issue that
layout/generic/crashtests/1666592.html can now trigger
`MOZ_ASSERT(!mFinalReflowSize)` in UpdateFinalReflowSize() in
fragmentation scenario. The problem is: when we clone a FlexItem for a
child frame in a flex container's continuation via FlexItem::CloneFor(),
we didn't reset the mHadMeasuringReflow flag, so we wrongly assume it
had a measuring reflow and may update its final reflow size based on the
cached metrics. However, we never run measuring reflow for flex items in
flex container's continuation, so we should reset the flag to prevent it
from falling into wrong path in FlexItem::NeedsFinalReflow().

Differential Revision: https://phabricator.services.mozilla.com/D121405
2021-08-05 05:39:32 +00:00
Sandor Molnar
f10c7e437d Backed out 2 changesets (bug 1686961, bug 1702401) for causing reftest failures in flexbox-align-self-baseline-horiz. CLOSED TREE
Backed out changeset ebbc084701a4 (bug 1702401)
Backed out changeset 20e053eb704a (bug 1686961)
2021-08-04 23:50:16 +03:00
Ting-Yu Lin
3369ba7354 Bug 1702401 - Reject existing CachedBAxisMeasurement if the item's subtree is dirty. r=dholbert
When a flex item's subtree is dirty, we should reject the cached
measurement and perform a measuring reflow for the item to get the
correct ascent. Without this patch, we are going to call
FlexItem::ResolvedAscent() in the flex algorithm based on a dirty flex
item subtree, and get a wrong ascent. (Although we'll still perform the
final reflow for the item, it's too late to get the correct ascent to
compute flex container's ascent.)

With the above modification, it exposes an existing issue that
layout/generic/crashtests/1666592.html can now trigger
`MOZ_ASSERT(!mFinalReflowSize)` in UpdateFinalReflowSize() in
fragmentation scenario. The problem is: when we clone a FlexItem for a
child frame in a flex container's continuation via FlexItem::CloneFor(),
we didn't reset the mHadMeasuringReflow flag, so we wrongly assume it
had a measuring reflow and may update its final reflow size based on the
cached metrics. However, we never run measuring reflow for flex items in
flex container's continuation, so we should reset the flag to prevent it
from falling into wrong path in FlexItem::NeedsFinalReflow().

Differential Revision: https://phabricator.services.mozilla.com/D121405
2021-08-04 18:50:32 +00:00
Ting-Yu Lin
b2bf6debd0 Bug 1686961 - Don't cache ascent in CachedBAxisMeasurement. r=dholbert
CachedBAxisMeasurement::mAscent caches the ascent of a flex item after
the measuring reflow, but the ascent may change after the final reflow
if the item is stretched and does some vertical alignment internally.
However, we don't cache the new ascent. Therefore, when we reflow the
item incrementally, if the CachedBAxisMeasurement::Key is valid, we just
skip the measuring reflow, and retrieve the wrong ascent from the cache.

Instead of fixing this bug by updating the cached ascent or rejecting
the ascent cache for a stretching flex item in block axis, this patch
removes the cache and sets ReflowOutput's BlockStartAscent() to the flex
item after the item's measuring reflow. (We've done the same after the
item's final reflow.) If the ascent is ReflowOutput::ASK_FOR_BASELINE,
we resolve in FlexItem::ResolvedAscent() anyway.

Differential Revision: https://phabricator.services.mozilla.com/D121404
2021-08-04 18:50:32 +00:00
Daniel Holbert
a0581e6247 Bug 1723039: Remove obsolete code-comments about our flexbox implementation disagreeing with spec (now that spec has changed). r=TYLin
DONTBUILD

This patch doesn't impact behavior; it's just removing code-comments that refer
to a requirement in the spec that we don't honor, & which the CSSWG has now
resolved to remove (which makes our existing behavior correct & no longer
noteworthy).

The CSSWG resolution is in https://github.com/w3c/csswg-drafts/issues/4311 .
The new text is yet-to-be-written, but the main takeaway is that the "fully
inflexible" requirement (which we ignore) has been removed; so now, any flex
item with a definite flex-basis should have its main-size considered to be
definite.  (And this matches our implementation.)

Differential Revision: https://phabricator.services.mozilla.com/D121284
2021-07-30 19:05:18 +00:00
Ting-Yu Lin
1fb3c26fc2 Bug 1715661 - Fix justify-content:{left|right} for column oriented vertical flex container. r=dholbert
In a column oriented vertical flex container, its main axis is parallel
to physical left <-> right axis, so justify-content:left and
justify-content:right should map to physical left and right edge,
respectively. This patch makes this particular case go to the (tweaked)
`else` branch.

https://drafts.csswg.org/css-align-3/#valdef-justify-content-left

Differential Revision: https://phabricator.services.mozilla.com/D120415
2021-07-22 00:12:07 +00:00
Mats Palmgren
c701d0e232 Bug 1708007 - Make sure we always reflow flex items that have a continuation. r=dholbert
The root cause of the crash was that FlexItem::NeedsFinalReflow
returned false even though the item had a non-empty next-in-flow.
This made the flex container skip the item's reflow and consider
the item's reflow status as COMPLETE, which triggers the removal
of the container's own next-in-flow, which causes the assertions
and eventually the crash.

Differential Revision: https://phabricator.services.mozilla.com/D118420
2021-06-22 01:59:42 +00:00
Ting-Yu Lin
e8ac85f840 Bug 1712875 - Inflate flex container's padding by using the union of flex items' normal position margin boxes. r=dholbert
Also, revise the comment based on what we are currently doing.

Differential Revision: https://phabricator.services.mozilla.com/D116025
2021-05-27 05:52:15 +00:00
Ting-Yu Lin
94aa79421f Bug 1712496 - Adjust flex container's overflow area only if there are flex items. r=dholbert
The rect `flexItemMarginBoxBounds` is initialized at position (0, 0),
not the flex container's content-box origin. Inflating its initial value
with flex container's padding is just wrong.

Differential Revision: https://phabricator.services.mozilla.com/D115854
2021-05-26 02:59:16 +00:00
Ting-Yu Lin
1f9c1bdc99 Bug 1703304 - Compute transferred size suggestion only if a flex item is a replaced element. r=dholbert
If the flex item is a non-replaced element and its min-width/min-height
is 'auto', the spec has changed so that it has no transferred size
suggestion now. https://drafts.csswg.org/css-flexbox-1/#min-size-auto

This patch also updates WPT tests to fix
https://github.com/web-platform-tests/wpt/issues/27878

Differential Revision: https://phabricator.services.mozilla.com/D112830
2021-04-30 20:49:19 +00:00
Ting-Yu Lin
6b293350a8 Bug 1706200 - Rename childrenInflowBounds to flexItemMarginBoxBounds in nsFlexContainerFrame::Reflow(). r=dholbert
Also, change the loop so that it iterates over flex items because
mFrames can contain out-of-flow placeholders which are not flex items.
This doesn't change the behavior because the out-of-flow placeholders
doesn't have any overflow areas (unless we fixed bug 1460484).

Differential Revision: https://phabricator.services.mozilla.com/D112672
2021-04-20 21:40:07 +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
Ting-Yu Lin
3699230bff Bug 1697349 - Incorporate flex item's margin and flex container's padding when computing flex container's overflow area. r=dholbert
This patch incorporates flex item's margin and flex container's padding
when computing flex container's overflow area in both the inline axis
and block axis.

overflow-top-left.html starts to fail because the test has flex items
with margin contributing to the overflow area now. We leave the test
unchanged for now until the webcompat situation is clear (Bug1698428).

flexbox-overflow-padding-002.html is based on
flexbox-overflow-padding-001.html with `writing-mode: vertical-rl` and
`direction: rtl` added to `.flexContainer`.

Differential Revision: https://phabricator.services.mozilla.com/D107936
2021-03-22 18:24:46 +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