Commit graph

1603 commits

Author SHA1 Message Date
Ting-Yu Lin
1e80f659a2 Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-30 06:32:22 +00:00
Sebastian Hengst
ccb101be8f Backed out 15 changesets (bug 1896516) for causing scrolling crashes on macOS. a=backout
Backed out changeset fd6904338812 (bug 1896516)
Backed out changeset 2977ff81a23e (bug 1896516)
Backed out changeset c8a6b0e526d6 (bug 1896516)
Backed out changeset 3c06f22da72b (bug 1896516)
Backed out changeset f63b0c4335fe (bug 1896516)
Backed out changeset 6f7ab8adfa6e (bug 1896516)
Backed out changeset 997c9249dbed (bug 1896516)
Backed out changeset c964fccd5180 (bug 1896516)
Backed out changeset 7b481b747b7a (bug 1896516)
Backed out changeset 42e1bbe0ecb6 (bug 1896516)
Backed out changeset 717dac08b607 (bug 1896516)
Backed out changeset 2f0817331dbe (bug 1896516)
Backed out changeset b765169a7a8f (bug 1896516)
Backed out changeset a2d37b98273c (bug 1896516)
Backed out changeset ea9ecb543e66 (bug 1896516)
2024-05-29 11:22:52 +02:00
Sebastian Hengst
ecacb7d457 Backed out 2 changesets (bug 1899345) for conflicting with backout of bug 1896516
Backed out changeset b96c165e9ab4 (bug 1899345)
Backed out changeset 01a540f73690 (bug 1899345)
2024-05-29 11:21:39 +02:00
Ting-Yu Lin
3953202381 Bug 1899345 Part 1 - Convert PhysicalAxes to an EnumSet<PhysicalAxis>. r=layout-reviewers,emilio
This also makes `PhysicalAxis::{Horizontal,Vertical}` more useful when we
previous needed `PhysicalAxes::{Horizontal,Vertical}`.

Differential Revision: https://phabricator.services.mozilla.com/D211941
2024-05-29 05:10:38 +00:00
Stanca Serban
0580eff632 Backed out 2 changesets (bug 1899345) for causing android build bustages in ScrollContainerFrame.cpp. CLOSED TREE
Backed out changeset ccb2ccbef46e (bug 1899345)
Backed out changeset 6f66d112b450 (bug 1899345)
2024-05-29 03:49:38 +03:00
Ting-Yu Lin
ccc55a5003 Bug 1899345 Part 1 - Convert PhysicalAxes to an EnumSet<PhysicalAxis>. r=layout-reviewers,emilio
This also makes `PhysicalAxis::{Horizontal,Vertical}` more useful when we
previous needed `PhysicalAxes::{Horizontal,Vertical}`.

Differential Revision: https://phabricator.services.mozilla.com/D211941
2024-05-29 00:17:58 +00:00
Emilio Cobos Álvarez
b4d60bef91 Bug 1899187 - Use cbindgen for border-spacing. r=firefox-style-system-reviewers,layout-reviewers,boris
Differential Revision: https://phabricator.services.mozilla.com/D211781
2024-05-28 09:37:22 +00:00
Ting-Yu Lin
6bd29e633d Bug 1896516 Part 11 - Remove nsIScrollableFrame usages under layout/, widget/, and toolkit/. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D211498
2024-05-28 04:46:20 +00:00
David Shin
c2e27a0f1a Bug 1825384 - Use app units in border-collapsed table data, not dev pixels. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187140
2024-05-14 13:51:28 +00:00
David Shin
ec10376fff Bug 1871609: On calculating border-collapsed table's borders, reset max-seen width. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D208526
2024-05-08 16:43:07 +00:00
Cristian Tuns
3c0c419ec9 Backed out changeset 84b76f80bf96 (bug 1871609) for causing wpt failures in /css/css-tables/* CLOSED TREE 2024-05-07 10:10:21 -04:00
David Shin
d5a05978ca Bug 1871609: On calculating border-collapsed table's borders, reset max-seen width. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D208526
2024-05-07 13:11:23 +00:00
Ting-Yu Lin
ef7e43f284 Bug 1892307 Part 2 - Remove LogicalSideBits. r=layout-reviewers,jfkthame
We can replace `mBits` with `EnumSet<LogicalSide>` in `LogicalSides` so that
`LogicalSideBits` is not relavent.

Differential Revision: https://phabricator.services.mozilla.com/D207906
2024-04-19 22:16:03 +00:00
Ting-Yu Lin
b518ef30fa Bug 1888535 Part 5 - Remove DISPLAY_REFLOW. r=layout-reviewers,emilio
It is used in `Reflow()` implementations.

Differential Revision: https://phabricator.services.mozilla.com/D206317
2024-04-02 19:03:05 +00:00
flowejam
68f084fc8b Bug 1885693: Converted LogicalSide to an enum class, and renamed variables accordingly. r=TYLin
Values were static_casted where required. Some functions in WritingModes.h were
rewritten such that bitwise operations aren't being used. Added static_casts to
avoid (debug) build errors from debugging printfs in layout/tables/nsCellMap.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D205510
2024-03-26 17:55:16 +00:00
Ting-Yu Lin
a0d64453fb Bug 1885691 - Convert LogicalCorner to enum class in WritingMode.h. r=dholbert
While I'm here, I remove the explict indices (0 - 3) for the enumerators since
they don't get used anywhere.

Differential Revision: https://phabricator.services.mozilla.com/D204833
2024-03-16 01:26:40 +00:00
Ting-Yu Lin
c2163d448d Bug 1881157 - Restore the old behavior that allows TableBCDataProperty to be set on table continuations. r=dholbert
Bug 1861562 Part 6 [1] made a bold assumption that TableBCDataProperty should
only be set on first-in-flow, but apparently a table continuation can call
`GetOrCreateTableBCData()` to set the property in the testcase [2].

This patch restores the old behavior that allows TableBCDataProperty to be set
on table continuations.

[1] https://hg.mozilla.org/mozilla-central/rev/c9c310c769d2
[2] Note: we don't support fragmenting tables in multicol. Table continuations
are created in this testcase because the abspos `<dialog>` in the table
is fragmented.

Differential Revision: https://phabricator.services.mozilla.com/D203707
2024-03-07 14:45:59 +00:00
Sandor Molnar
b2dfaa2696 Backed out changeset 2960ea3e50ca (bug 1881157) for causing crashtest assertion failures. CLOSED TREE 2024-03-06 21:01:06 +02:00
Ting-Yu Lin
f7a5e4dbd3 Bug 1881157 - Restore the old behavior that allows TableBCDataProperty to be set on table continuations. r=dholbert
Bug 1861562 Part 6 [1] made a bold assumption that TableBCDataProperty should
only be set on first-in-flow, but apparently a table continuation can call
`GetOrCreateTableBCData()` to set the property in the testcase [2].

This patch restores the old behavior that allows TableBCDataProperty to be set
on table continuations.

[1] https://hg.mozilla.org/mozilla-central/rev/c9c310c769d2
[2] Note: we don't support fragmenting tables in multicol. Table continuations
are created in this testcase because the abspos `<dialog>` in the table
is fragmented.

Differential Revision: https://phabricator.services.mozilla.com/D203707
2024-03-06 16:32:56 +00:00
Ting-Yu Lin
ba8b9181f6 Bug 1863421 Part 1 - Stop reserving row-spacing at the block-start edge in table continuations. r=dholbert
The testcases in our own reftest frameworks are modified to reflect the current
rendering. The main difference after this patch is that we don't apply row
border-spacing at the block-start edge in the table continuations. As a result,
we add `top: -2px` to reference pages such as
`rowgroup-page-break-after-always-1-ref.html` and
`rowgroup-page-break-after-always-2-ref.html` to counteract the default UA table
style `border-spacing: 2px;` [1].

[1] https://searchfox.org/mozilla-central/rev/6b0b8c1003504e302e243c300355ef4d61e24909/layout/style/res/html.css#257

Differential Revision: https://phabricator.services.mozilla.com/D195333
2024-03-06 16:01:58 +00:00
David Shin
0c24333993 Bug 1879731: Address clang-tidy concerns in BCMapCellIterator. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D202316
2024-02-27 15:55:40 +00:00
David Shin
9184cb608d Bug 1879731: Correctly fill out previous last border information at row and column edges in border-collapsed tables. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D202232
2024-02-27 15:55:40 +00:00
David Shin
6d96ef707d Bug 1873473: Part 4 - Update documentation in CalcBCBorders. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D197933
2024-02-13 18:37:04 +00:00
David Shin
a11082fca6 Bug 1873473: Part 3 - Rename variables using physical corners in CalcBCBorders to logical corners. r=layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D197932
2024-02-13 18:37:03 +00:00
David Shin
da3519452d Bug 1873473: Part 2 - Move variables in CalcBCBorders to be more scope-specific where possible. r=layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D197931
2024-02-13 18:37:03 +00:00
David Shin
02b1a97bd5 Bug 1873473: Part 1 - Refactor lastBStartBorder in nsTableFrame::CalcBCBorders to be Maybe<T> r=TYLin
This is only used to calculate the block-start border of the overall table,
not and is unused after. Use `Maybe<>` to reflect it as such.

Differential Revision: https://phabricator.services.mozilla.com/D197930
2024-02-13 18:37:02 +00:00
Ting-Yu Lin
d2705889ee Bug 1879371 Part 2 - Add a helper for placing repeated table footer avoid code duplication. r=jwatt
This patch shouldn't change behavior. There was a callsite missed
`SetRepeatable(false)` when the repeated table footer is not allowed, but I
think it was an oversight rather than intentional.

Differential Revision: https://phabricator.services.mozilla.com/D201136
2024-02-12 21:55:34 +00:00
Ting-Yu Lin
77fd9972c1 Bug 1879371 Part 1 - Move a comment closer to its code in nsTableFrame::ReflowChildren(). r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D201135
2024-02-12 21:55:33 +00:00
Ting-Yu Lin
1055b1302e Bug 1875600 - Use nsIFrame::PresShell() to simply some callers. r=layout-reviewers,emilio
Those callers who using the pointer immediately after getting from
`GetPresShell()` can be replaced with `PresShell()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D199164
2024-01-23 00:30:53 +00:00
Ting-Yu Lin
ba6d212459 Bug 1871608 Part 3 - Remove one addition unused methods and cleanup a comment. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D197209
2023-12-22 22:53:51 +00:00
Ting-Yu Lin
5374b8b9dd Bug 1871608 Part 2 - Remove unused setters and member variables for continuous BC borders in table parts. r=jwatt
With Part 1, these unused setters and member variables can also be removed.

Differential Revision: https://phabricator.services.mozilla.com/D197208
2023-12-22 22:53:50 +00:00
Ting-Yu Lin
77c5c07bab Bug 1867916 - Fix initialization of available block-size in TableReflowInput. r=emilio,layout-reviewers
This is a bug introduced by bug 1866836 Part 1
https://hg.mozilla.org/mozilla-central/rev/845986cc0a8d

`AdvanceBCoord()` will modify `mAvailSize.BSize()`, so we really should
initialize `mAvailSize.BSize()` first.

Differential Revision: https://phabricator.services.mozilla.com/D195332
2023-12-02 18:56:30 +00:00
Ting-Yu Lin
1cf1c68a91 Bug 1866836 Part 2 - Pass border and padding down from nsTableFrame::Reflow(). r=layout-reviewers,emilio
In Bug 1863421, we'll apply ApplySkipSides() for `borderPadding`. This patch
ensures we use the correct skipped border and padding everywhere.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D194789
2023-11-27 23:10:40 +00:00
Ting-Yu Lin
61ae4fb8ad Bug 1866836 Part 1 - Consolidate available size computation in TableReflowInput's constructor. r=layout-reviewers,emilio
Before this patch, we get available block-size in `Reflow()` and available
inline-size in `ReflowTable()`. Then we adjust them in TableReflowInput's
constructor. This patch moves all the computation into TableReflowInput's
constructor.

This is a preparation for bug 1863421, and doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D194788
2023-11-27 23:10:39 +00:00
Jonathan Kew
f22792227f Bug 1442018 - Avoid crashing in BCPaintBorderIterator if mCellMap was not found. r=layout-reviewers,emilio
This does not fix the underlying issue, which is that when the table
got fragmented, we failed to maintain the cellmap (attached to the
first-in-flow) to keep track of the additional rowgroup frame created
to go in the overflowing part of the table.

So this is a wallpaper patch just to prevent the crash here (confirmed
with testcase 5); it'll still throw NS_ASSERTIONs in a debug build,
and in the "bad" case (which depends on details of scaling) some of
the borders will be missing from the print preview/output, but that
seems preferable to crashing.

Differential Revision: https://phabricator.services.mozilla.com/D193660
2023-11-15 16:24:48 +00:00
Ting-Yu Lin
67d9c2fb7b Bug 1863837 Part 10 - Improve ergonomics of TableReflowInput. r=layout-reviewers,emilio
- Better encapsulation.
- Add `AdvanceBCoord()` to adjust block-offset and available block-size at
  once.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D193149
2023-11-13 22:36:16 +00:00
Ting-Yu Lin
44d862821f Bug 1863837 Part 9 - Remove unnecessary logic in nsTableFrame::ReflowChildren(). r=layout-reviewers,emilio
Remove `nextRowGroupFrame` variable since `childX + 1` is a valid index of
rowGroups and rowGroups never containing nullptr, `nextRowGroupFrame` is always
valid.

Differential Revision: https://phabricator.services.mozilla.com/D193148
2023-11-13 22:36:16 +00:00
Ting-Yu Lin
b0009550de Bug 1863837 Part 8 - Revise methods that calculate table frame's block-size. r=layout-reviewers,emilio
Make `CalcDesiredBSize()` return `nscoord`, and revise the documentation.

Note: `CalcDesiredBSize` is a helper method for `Reflow`. I removed the
unnecessary for-loop computing child overflow because we're going to compute it
again in `Reflow()` [1], just right after we adjust the children's positions in
vertical-rl writing-mode.

This patch doesn't change behavior.

[1] https://searchfox.org/mozilla-central/rev/636f037a59d3fa41e27fee05742eb3679f76a366/layout/tables/nsTableFrame.cpp#1805-1811

Differential Revision: https://phabricator.services.mozilla.com/D193147
2023-11-13 22:36:16 +00:00
Ting-Yu Lin
9b80a327a8 Bug 1863837 Part 7 - Use table frame's writing-mode in some helpers. r=layout-reviewers,emilio
Table frame and its table row group children have the same writing-mode [1], so
this patch doesn't change behavior.

Since these helpers use data such as `TableReflowInput::mAvailSize`, which is in
table's writing-mode. Let's change these `wm` variables to initialize from
`GetWritingMode()` to avoid confusion.

[1] https://searchfox.org/mozilla-central/rev/02841791400cf7cf5760c0cfaf31f5d772624253/layout/tables/nsTableRowGroupFrame.h#54

Differential Revision: https://phabricator.services.mozilla.com/D193146
2023-11-13 22:36:15 +00:00
Ting-Yu Lin
31a87e10e6 Bug 1863837 Part 6 - Convert table header and footer reflow to use logical coordinates. r=layout-reviewers,emilio
This patch might fix table fragmentation when table's writing-mode is vertical.
But I'm in the process of fixing fragmentation, so I don't bother adding
testcase for it.

Differential Revision: https://phabricator.services.mozilla.com/D193145
2023-11-13 22:36:15 +00:00
Ting-Yu Lin
77925882bb Bug 1863837 Part 4 - Always push overflow table row groups to overflow list. r=layout-reviewers,emilio
Putting overflow child frames into the overflow list is a convention in other
layout frame types.

In non-incremental table reflow like printing, a table frame won't have a
continuation until the table wrapper's parent created it. Even if a table does
have a continuation when calling `PushChildren()`, it's totally fine to put
pushed child frames into overflow list since we've called
`MoveOverflowToChildList()` at the beginning of `nsTableFrame::Reflow()` so that
a table continuation can pull them into its principal child list.

Also, rename `PushChildren()` to `PushChildrenToOverflow()` in order to reflect
its purpose and match its counterpart in
`nsContainerFrame::PushChildrenToOverflow()`.

This patch shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D193143
2023-11-13 22:36:14 +00:00
Ting-Yu Lin
a2db328714 Bug 1863837 Part 3 - Rename cellSpacingI/cellSpacingB to colSpacing/rowSpacing. r=layout-reviewers,emilio
The methods were renamed in
https://hg.mozilla.org/mozilla-central/rev/778616c8f74e, so should the
variables.

Differential Revision: https://phabricator.services.mozilla.com/D193142
2023-11-13 22:36:14 +00:00
Ting-Yu Lin
dd7bef0239 Bug 1863837 Part 2 - Make OrderRowGroups() return RowGroupArray. r=layout-reviewers,emilio
It's more ergonomic to return RowGroupArray directly. While I'm here, improve
its documentation and rename it to `OrderedRowGroups()` since we do not actually
reorder children in table frame's principal child list.

Differential Revision: https://phabricator.services.mozilla.com/D193141
2023-11-13 22:36:13 +00:00
Ting-Yu Lin
84409099da Bug 1861539 - Use logical ReflowChild() and FinishReflowChild() to reflow table column group & table column. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D192041
2023-11-02 18:37:10 +00:00
Ting-Yu Lin
f1fe0fa667 Bug 1861562 Part 7 - Remove unneeded GetChildAreaOffset(). r=layout-reviewers,jfkthame
In the previous part, we've fixed `GetIncludedOuterBCBorder()` so that it won't
return empty result while calling from a table's continuation. That means, when
table wrapper frame creates reflow input for a border-collapsed table frame [1],
the computed border and padding is correct for all table continuations. Hence,
when we need border and padding, it is sufficient to get from `ReflowInput`
instead of `GetChildAreaOffset()`.

In `BCPaintBorderIterator` where there is no reflow input, we can call
`GetIncludedOuterBCBorder` directly.

[1] https://searchfox.org/mozilla-central/rev/40d51bef58b8e901d6ab4b60dd280f372a0e417d/layout/tables/nsTableWrapperFrame.cpp#626-633

Differential Revision: https://phabricator.services.mozilla.com/D192054
2023-10-27 18:38:09 +00:00
Ting-Yu Lin
2822603c9a Bug 1861562 Part 6 - Ensure TableBCData is accessible from table's continuations. r=layout-reviewers,jfkthame
`TableBCData` is essential for methods like `GetOuterBCBorder`,
`GetIncludedOuterBCBorder`, etc. We need to ensure all the table's continuations
can access it in order to get the border-collapsing border correctly. This patch
changes `GetTableBCData` to reach the first-in-flow for the data (similar to
`GetCellMap()`).

While I'm here, I rename the property, struct, and helpers to make them
consistent, and move the struct to mozilla namespace.

This patch potentially changes behavior when a border-collapsed table is
fragmented, but the layout is very broken (bug 1861575) that I don't feel its
worth writing a test.

Differential Revision: https://phabricator.services.mozilla.com/D192053
2023-10-27 18:38:08 +00:00
Ting-Yu Lin
d63958c5d6 Bug 1861562 Part 5 - Don't set table frame's desired inline size repeatedly. r=layout-reviewers,jfkthame
We set `aDesiredSize.ISize(wm)` again after calling `ReflowTable()`. Since no
other variable depending on the desired inline-size, there's no point set it
near the beginning of `Reflow()` and in `ReflowTable()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D192052
2023-10-27 18:38:08 +00:00
Ting-Yu Lin
0f1f90c224 Bug 1861562 Part 2 - Remove redundant kidRG variable. r=layout-reviewers,jfkthame
`kidFrame` is already a `nsTableRowGroupFrame*`.

Differential Revision: https://phabricator.services.mozilla.com/D192049
2023-10-27 18:38:07 +00:00
Emilio Cobos Álvarez
25c0d10932 Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Cosmin Sabou
fbfcb4b40a Backed out changeset c20fe6f0a048 (bug 1825384) for causing table related reftest failures. CLOSED TREE 2023-09-11 19:51:30 +03:00