Commit graph

415 commits

Author SHA1 Message Date
Ting-Yu Lin
02e367f255 Bug 1782602 - No need to consider margin when computing -moz-column-content's origin. r=emilio
`-moz-column-content` is the anonymous frame under column set, and it has no
margin per its style in ua.css.

Differential Revision: https://phabricator.services.mozilla.com/D153404
2022-08-01 23:01:14 +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
0a6b4c7ebb Bug 1464761 Part 3 - Remove IsTruncated() in nsColumnSetFrame::ReflowChildren(). r=dholbert
In nsReflowStatus::UpdateTruncated(), mTruncated can be true only when
mIsTopOfPage is false. However, when we reflow -moz-column-content, we always
set mIsTopOfPage to true. Therefore, IsTruncated() always returns false, i.e.
`!IsTruncated()` is always true.

Differential Revision: https://phabricator.services.mozilla.com/D151460
2022-07-27 21:55:17 +00:00
Ting-Yu Lin
631b3a60a0 Bug 1756008 Part 2 - Fix a comment in nsColumnSetFrame. r=emilio
nsBlockFrame::ReflowBlockFrame() creates a ReflowInput for its block child, not
BlockReflowInput.

Differential Revision: https://phabricator.services.mozilla.com/D139437
2022-02-23 21:22:43 +00:00
Daniel Holbert
d05867cc4e Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D125611
2021-09-15 16:15:02 +00:00
criss
196daa1700 Backed out changeset 007ff7f371c9 (bug 1730774) for causing bustages on Bp-hybrid. CLOSED TREE 2021-09-15 09:14:41 +03:00
Daniel Holbert
522de8e4d7 Bug 1730774 part 2: Add includes and forward-decls to fix non-unified-build bustage in layout/generic, and remove REQUIRES_UNIFIED_BUILD declaration. r=TYLin
After the fixes in this patch, the REQUIRES_UNIFIED_BUILD declaration is no
longer needed, so I'm removing it here.  This directory now builds successfully
with that removed and with ac_add_options --disable-unified-build in the
mozconfig.

Depends on D125610

Differential Revision: https://phabricator.services.mozilla.com/D125611
2021-09-15 00:04:16 +00:00
Matt Woodrow
3be3d71f55 Bug 1729236 - Don't use GetPaintRect for CreateWebRenderCommands. r=jrmuizel
WebRender prefers to know the full bounds of the primitive, since it makes invalidation easier (and doesn't increase the size of the commands we send).

Differential Revision: https://phabricator.services.mozilla.com/D124588
2021-09-13 05:01:35 +00:00
criss
9640d7f5f3 Backed out 10 changesets (bug 1714138, bug 1542929, bug 1728232, bug 1729236, bug 1728258, bug 1728251, bug 1728050) for causing bug 1424348 a=backout
Backed out changeset c5b71e6ce0e5 (bug 1729236)
Backed out changeset c6bcc4ed3d2e (bug 1729236)
Backed out changeset 7e292895282a (bug 1729236)
Backed out changeset d9ddd915e0c2 (bug 1714138)
Backed out changeset 82b98d2f0dcf (bug 1728258)
Backed out changeset 9a84a36b9dc4 (bug 1542929)
Backed out changeset 96be978630ff (bug 1728251)
Backed out changeset d7a8bf19d849 (bug 1728251)
Backed out changeset cce0c53b439f (bug 1728232)
Backed out changeset 3afd6aee7849 (bug 1728050)
2021-09-12 12:00:30 +03:00
Matt Woodrow
a0a81ab3ce Bug 1729236 - Don't use GetPaintRect for CreateWebRenderCommands. r=jrmuizel
WebRender prefers to know the full bounds of the primitive, since it makes invalidation easier (and doesn't increase the size of the commands we send).

Differential Revision: https://phabricator.services.mozilla.com/D124588
2021-09-10 03:43:35 +00:00
Sandor Molnar
e259e004de Backed out 3 changesets (bug 1729236) for causing reftest failures in layout/reftests/svg/filters/filter-giant.
Backed out changeset 1333d00d417c (bug 1729236)
Backed out changeset a3021a3499e1 (bug 1729236)
Backed out changeset 49a5aa4c8eb7 (bug 1729236)
2021-09-06 19:31:31 +03:00
Matt Woodrow
3cdf8e4aeb Bug 1729236 - Don't use GetPaintRect for CreateWebRenderCommands. r=jrmuizel
WebRender prefers to know the full bounds of the primitive, since it makes invalidation easier (and doesn't increase the size of the commands we send).

Differential Revision: https://phabricator.services.mozilla.com/D124588
2021-09-06 06:26:07 +00:00
Iulian Moraru
80b969f9fe Backed out 3 changesets (bug 1729236) for causing multiple failures. CLOSED TREE
Backed out changeset 8ebf965d624b (bug 1729236)
Backed out changeset 0d26dce41a12 (bug 1729236)
Backed out changeset bf228d1f3b49 (bug 1729236)
2021-09-06 07:32:43 +03:00
Matt Woodrow
87fc1d4890 Bug 1729236 - Don't use GetPaintRect for CreateWebRenderCommands. r=jrmuizel
WebRender prefers to know the full bounds of the primitive, since it makes invalidation easier (and doesn't increase the size of the commands we send).

Differential Revision: https://phabricator.services.mozilla.com/D124588
2021-09-06 03:42:25 +00:00
Matt Woodrow
a1f669f3aa Bug 1728709 - Add nsDisplayItem::GetPaintRect that computes a value using the current clip extents. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D124299
2021-09-03 18:58:18 +00:00
Mats Palmgren
fbd78876d2 Bug 1728497 - Remove nsColumnSetFrame::CalculateColumnRuleBounds and just return InkOverflowRect() instead. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D124202
2021-09-02 15:42:04 +00:00
Emilio Cobos Álvarez
a4e7c9e510 Bug 1722945 - Support break-inside: avoid-{page,column}. r=TYLin
break-before/after: page|column seem harder because you need to deal
with nested breaks, I think, but this should be straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D121206
2021-08-03 17:56:58 +00:00
Noemi Erli
89a565ea85 Backed out changeset 67c33ba5566e (bug 1722945) for causing bustage in nsContainerFrame.cpp 2021-08-03 20:35:10 +03:00
Emilio Cobos Álvarez
3d1b4f252f Bug 1722945 - Support break-inside: avoid-{page,column}. r=TYLin
break-before/after: page|column seem harder because you need to deal
with nested breaks, I think, but this should be straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D121206
2021-08-03 13:59:47 +00:00
Ting-Yu Lin
97b5489509 Bug 1716212 Part 1 - Rename CalcLineHeight to GetLineHeight, and cache used line height in ReflowInput. r=emilio
This patch introduces `mLineHeight`, and it opens the possibility to
override it in Part 2.

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

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

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

For example, if we see

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

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

Differential Revision: https://phabricator.services.mozilla.com/D95661
2020-11-03 19:44:58 +00:00
Ting-Yu Lin
709e05b496 Bug 1671319 - Remove GetAvailableContentISize in nsColumnSetFrame.cpp. r=emilio
nsColumnSetFrame won't have any border and padding because it's an inner
frame under ColumnSetWrapper. We've already asserted this fact at the
beginning of nsColumnSetFrame::Reflow().

This change shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D93626
2020-10-15 17:30:28 +00:00
Ting-Yu Lin
0076add365 Bug 1641085 Part 1 - Add move semantic to nsFrameList, and use it on SetOverflowFrames(). r=mats
It's useful to use `std::move()` to indicate the frames' ownership in one list
is transferred to the another list.

For a frame list managed by AutoFrameListPtr, after moving its frames to
another list, it can be automatically deleted when it is going out of
scope.

Differential Revision: https://phabricator.services.mozilla.com/D88455
2020-08-29 00:22:16 +00:00
Ting-Yu Lin
e7a3e6870c Bug 1661874 Part 4 - Simplify the condition to set colData.mHasExcessBSize to true. r=heycam
nsColumnSetFrame's ComputedBSize() and ComputedMaxBSize() are always
NS_UNCONSTRAINEDSIZE.

Differential Revision: https://phabricator.services.mozilla.com/D88700
2020-08-31 03:45:38 +00:00
Ting-Yu Lin
7ffc02eb41 Bug 1661874 Part 3 - Reverse the meaning of skipIncremental and rename it. r=heycam
I feel skipIncremental is hard to reasoning. It's easier to list all the
possible reasons that the child needs to be reflowed again.

Differential Revision: https://phabricator.services.mozilla.com/D88699
2020-08-31 03:45:23 +00:00
Ting-Yu Lin
be1519920a Bug 1661874 Part 2 - Remove the support of ColumnSetFrame being an abs.pos container. r=heycam
The support of this was added in
https://hg.mozilla.org/mozilla-central/rev/fb0790d28846

After supporting column-span, ColumnSetFrame isn't the top-level
multicol container anymore, and is not served as an abs.pos container.
Thus, we can simply the reflow code a bit.

Differential Revision: https://phabricator.services.mozilla.com/D88698
2020-08-31 03:45:15 +00:00
Ting-Yu Lin
218e47c67f Bug 1661874 Part 1 - Rename mColMaxBSize to mColBSize in ReflowConfig. r=heycam
Rename so that its naming is consistent with ReflowConfig::mColISize,
and to avoid confusion with ColumnBalanceData::mMaxBSize.

Differential Revision: https://phabricator.services.mozilla.com/D88697
2020-08-31 03:45:13 +00:00
Ting-Yu Lin
a9328a86bf Bug 1658198 - Provide a minimum starting value for extraBlockSize in FindBestBalanceBSize. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D87131
2020-08-16 00:46:30 +00:00
Ting-Yu Lin
bffd4f08c6 Bug 1647520 Part 4 - Stop binary search once the feasible and infeasible block-size is within one device pixel. r=heycam
The gist of this patch is: once the feasible and infeasible block-size
is within one device pixel, we choose nextGuess to be the greatest
multiple of one device pixel below or equal to the feasible block-size.
If this nextGuess is infeasible, we will reflow children one last time
by using the last feasible block-size and done with the balancing.

Differential Revision: https://phabricator.services.mozilla.com/D83732
2020-07-20 22:28:45 +00:00
Ting-Yu Lin
e68bedf3c5 Bug 1647520 Part 3 - Improve some comments in FindBestBalanceBSize(). r=heycam
Here's an example that can break the loop at the first iteration.
<div style="column-count:2; height:100px"><img src="" style="height:500px">

Differential Revision: https://phabricator.services.mozilla.com/D83731
2020-07-20 22:27:44 +00:00
Ting-Yu Lin
fdc00547f6 Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron
This patch is generated by:

```
# Rename the nsOverflowType enum.
rg -l "eVisualOverflow" layout/ gfx/ | xargs sed -i "s/eVisualOverflow/eInkOverflow/g"

# Rename and drop the "Get" prefix from various functions.
rg -l "GetVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowRect/InkOverflowRect/g"
rg -l "GetPreEffectsVisualOverflowRect" layout/ gfx/ | xargs sed -i "s/GetPreEffectsVisualOverflowRect/PreEffectsInkOverflowRect/g"
rg -l "GetVisualOverflowFromDeltas" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowFromDeltas/InkOverflowFromDeltas/g"
rg -l "GetScrollableOverflowRect" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowRect/ScrollableOverflowRect/g"

# Rename, drop the "Get" prefix, and change the suffix "Area" to "Rect"
# (because they return nsRect) for the two methods in nsLineBox.
rg -l "GetVisualOverflowArea" layout/ gfx/ | xargs sed -i "s/GetVisualOverflowArea/InkOverflowRect/g"
rg -l "GetScrollableOverflowArea" layout/ gfx/ | xargs sed -i "s/GetScrollableOverflowArea/ScrollableOverflowRect/g"

# Rename rest of the functions and variables.
rg -l "VisualOverflow" layout/ gfx/ | xargs sed -i "s/VisualOverflow/InkOverflow/g"
rg -l "visual overflow" layout/ gfx/ | xargs sed -i "s/visual overflow/ink overflow/g"
rg -l "visualOverflow" layout/ gfx/ | xargs sed -i "s/visualOverflow/inkOverflow/g"
rg -l "visOverflow" layout/ gfx/ | xargs sed -i "s/visOverflow/inkOverflow/g"
rg -l "vis-overflow" layout/ gfx/ python/ | xargs sed -i "s/vis-overflow/ink-overflow/g"

./mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D84231
2020-07-20 20:17:36 +00:00
Ting-Yu Lin
ffcfb6dcec Bug 1651171 - Convert NS_SUBTREE_DIRTY to an inline method of nsIFrame. r=jfkthame
This is a straightforward conversion except that
`NS_SUBTREE_DIRTY(this)` can be written terser as `IsSubtreeDirty()`.

Differential Revision: https://phabricator.services.mozilla.com/D82811
2020-07-09 18:29:15 +00:00
Kagami Sascha Rosylight
2bd2a63ded Bug 1647525 - Use HasAnyStateBits() in nsColumnSetFrame r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D81198
2020-06-27 13:16:31 +00:00
Ting-Yu Lin
6047332ae6 Bug 1647332 Part 4 - Keep doubling the extra block-size that adds to the estimate column block-size until finding a feasible one. r=heycam
In FindBestBalanceBSize(), suppose we have aUnboundedLastColumn equals
to true, and the measuring reflow of all the columns is feasible. This
setting represents the most common scenario of multi-column layout as
the multi-column footnote on Wikipedia.

We used to use 600 as the extra block-size added to the estimate column
block-size. However, if the first guess of the column block-size, say
G1, is infeasible, the feasible block-size is still bound to the sum of
all columns S. That leaves us a massive range between G1 and S to
search.

We don't want to use a larger fixed extra block-size. Although it can
reduce the possibility of failing the first guess, but for cases where a
smaller extra block-size is sufficient, it increases the search range
and the iteration number before the binary search converges.

Instead, we can spend the first few iterations doubling the extra
block-size E added to the estimate column block-size until we find the
first feasible block-size. This gives us a smaller upper bound S / N +
E, where N is the number of columns.

Differential Revision: https://phabricator.services.mozilla.com/D80571
2020-06-23 18:34:42 +00:00
Ting-Yu Lin
7818447d6c Bug 1647332 Part 3 - Extract the constant 600 app units when estimating balancing column block-size. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D80570
2020-06-23 18:34:40 +00:00
Ting-Yu Lin
777470ec78 Bug 1647332 Part 2 - Output the number of columns in ColumnBalanceData, and replace nsFrameList::GetLength(). r=heycam
The motivation is to replace mFrames.GetLength() in
FindBestBalanceBSize() since it is O(N), where N is the number of
columns.

Also, counting the column number from 1 so that it matches mUsedColCount
without needing to subtract 1 at some places.

Differential Revision: https://phabricator.services.mozilla.com/D80569
2020-06-23 18:34:36 +00:00
Ting-Yu Lin
24871a70de Bug 1647332 Part 1 - Print more information in column set log. r=heycam
* childContentBEnd: this value can be larger than
kidDesiredSize.BSize(wm) if -moz-column-content anonymous blocks has a
child which is overflow-incomplete.

* mLastBSize: last column's block-size is important in column balancing
algorithm because it sets mKnownInfeasibleBSize when a balancing
iteration is feasible.

* The iteration count in column balancing. This is an easy way to
observe column balancing performance.

Differential Revision: https://phabricator.services.mozilla.com/D80568
2020-06-23 18:34:34 +00:00
Ting-Yu Lin
9ebd7d8fc0 Bug 1634102 - Always balance columns before column-spans (regardless the column-fill property). r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D77570
2020-06-17 03:35:42 +00:00
Ting-Yu Lin
aa8db6ce2d Bug 1614101 - Make sure ColumnSet does not split in the last reflow if ColumnSetWrapper's available block-size is unconstrained. r=dbaron
Checking ColumnSet's available block-size [1] makes no sense nowadays
because ColumnSet is an inner frame under ColumnSetWrapper. We should
check ColumnSetWrapper's available block-size instead.

Also, bump assertions count for 1015844.html on Android, which is a
crashtest having multicols.

[1] The comment was also misleading, which said it was checking
ColumnSet's "block-size", but it actually was checking available
block-size.

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

--HG--
extra : moz-landing-system : lando
2020-03-04 18:21:01 +00:00
Csoregi Natalia
f57c04f7ff Backed out changeset 5ecd70faa23f (bug 1614101) for crashtest failures on 1015844.html. CLOSED TREE 2020-03-04 19:41:38 +02:00
Ting-Yu Lin
bf48011278 Bug 1614101 - Make sure ColumnSet does not split in the last reflow if ColumnSetWrapper's available block-size is unconstrained. r=dbaron
Checking ColumnSet's available block-size [1] makes no sense nowadays
because ColumnSet is an inner frame under ColumnSetWrapper. We should
check ColumnSetWrapper's available block-size instead.

[1] The comment was also misleading, which said it was checking
ColumnSet's "block-size", but it actually was checking available
block-size.

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

--HG--
extra : moz-landing-system : lando
2020-03-03 13:07:40 +00:00
Ting-Yu Lin
95282ce758 Bug 1618646 Part 2 - Remove mComputedBSize and mConsumedBSize in nsColumnSetFrame::ReflowConfig. r=mats
They were used when nsColumnSetFrame was still a column container, but
are not used today.

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

--HG--
extra : moz-landing-system : lando
2020-02-28 22:36:35 +00:00
Ting-Yu Lin
450809ad1c Bug 1618646 Part 1 - Remove nsColumnSetFrame::GetAvailableContentBSize(). r=mats
ColumnSet is an inner frame now. It cannot have border and padding.

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

--HG--
extra : moz-landing-system : lando
2020-02-28 22:35:21 +00:00
Simon Giesecke
9350e6b741 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

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

--HG--
extra : moz-landing-system : lando
2020-02-20 11:40:14 +00:00
Dorel Luca
d5f9df8ee1 Backed out 2 changesets (bug 1613985) for Build bustage on Windows2012. CLOSED TREE
Backed out changeset fd177b40b561 (bug 1613985)
Backed out changeset fb6d62b7f28d (bug 1613985)
2020-02-19 22:22:41 +02:00
Simon Giesecke
59b23375c0 Bug 1613985 - Use MOZ_COUNTED_DEFAULT_CTOR_*/MOZ_COUNTED_DTOR_* macros. r=froydnj
This removes the need for explicit #ifdef NS_BUILD_REFCNT_LOGGING without
introducing user-defined destructors when it is not defined.

Also, some uses of virtual for declaring destructors are replaced by the
appropriate override declaration through these changes.

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

--HG--
extra : moz-landing-system : lando
2020-02-19 18:05:38 +00:00
Emilio Cobos Álvarez
006e5cca66 Bug 1614198 - Use cbindgen instead of nsStyleImage. r=aosmond
The trickier part is that we represent -moz-image-rect as a Rect() type instead
of image with non-null clip-rect. So we need to add a bit of code to
distinguish "image request types" from other types of images.

But it's not too annoying, and we need to do the same for fancier images like
image-set and such whenever we implement it, so seems nice to get rid of
most explicit usages of nsStyleImage::GetType().

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

--HG--
extra : moz-landing-system : lando
2020-02-11 20:56:20 +00:00
Ting-Yu Lin
4c6c2f7bbe Bug 1603088 Part 2 - Delete NS_FRAME_CONTAINS_RELATIVE_BSIZE manipulation in nsColumnSetFrame::Reflow(). r=dbaron
Nowadays, ColumnSetFrame is an inner frame under ColumnSetWrapperFrame.
It always has "block-size: auto", so `aReflowInput.ComputedBSize()`
always equals to NS_UNCONSTRAINEDSIZE.

Also, -moz-column-content no longer has "max-block-size: 100%", so
NS_FRAME_CONTAINS_RELATIVE_BSIZE can never be set on ColumnSetFrame when
constructing ReflowInputs for ColumnSetFrame's children in
`ReflowInput::InitResizeFlags`. Removing the bit is not needed, either.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 02:48:14 +00:00