Commit graph

833 commits

Author SHA1 Message Date
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
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
Ting-Yu Lin
26c26e265f Bug 1888535 Part 4 - Remove DISPLAY_PREF_INLINE_SIZE and DISPLAY_MIN_INLINE_SIZE. r=layout-reviewers,emilio
The two macros are used in `GetPrefISize()` and `GetMinISize()` implementations.
After removing them, we could further simplify some implementations because we
don't need a `result` variable in many cases.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D206316
2024-04-02 19:03:04 +00:00
Ting-Yu Lin
72b3afbd86 Bug 1888535 Part 3 - Remove DISPLAY_REFLOW_CHANGE used only in nsTableCellFrame. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D206315
2024-04-02 19:03:04 +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
a32338de71 Bug 1648947 - Force table-cells to use 'vertical-align:top' in printing. r=dholbert
When printing tables, if a table row group is split across the page boundary,
its table-cell descendants with `vertical-align:baseline|middle|bottom|` do not
align as expected and there might be data loss. Currently, we reflow the table
row frames first, and then call DidResize() [1] to move table cells to their
vertical-align positions via BlockDirAlignChild() [2] . This is fine if the
table is in gallery mode or can fit in one page, but it doesn't work if it is
across the page boundary.

To fix this properly, we need to rewrite the table fragmentation code so that
the a table cell is reflowed in its aligned position with a correct constrained
available bsize. In the meantime, this patch works around the data loss by
forcing table-cells to use `vertical-align:top`. This is a hack, but it also
matches Google Chrome's current behavior. I feel this is a good interim solution
to improve our printing quality.

[1] https://searchfox.org/mozilla-central/rev/2537e5eaafaab9a7ef6be5cfc8e9b1e2c747fdfd/layout/tables/nsTableRowGroupFrame.cpp#1119-1125
[2] https://searchfox.org/mozilla-central/rev/2537e5eaafaab9a7ef6be5cfc8e9b1e2c747fdfd/layout/tables/nsTableRowFrame.cpp#370-372

Differential Revision: https://phabricator.services.mozilla.com/D205538
2024-03-26 02:41:07 +00:00
Ting-Yu Lin
a650fa9870 Bug 1886942 Part 2 - Initialize nsTableCellFrame members in the declaration. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205418
2024-03-23 17:06:05 +00:00
pstanciu
28ae7c4730 Backed out 3 changesets (bug 1886942) for causing build bustages on nsMathMLmtableFrame.h
Backed out changeset cf8f333d8f5e (bug 1886942)
Backed out changeset 83878f41b5e9 (bug 1886942)
Backed out changeset 195908957031 (bug 1886942)
2024-03-23 05:33:20 +02:00
Ting-Yu Lin
941a4850b6 Bug 1886942 Part 2 - Initialize nsTableCellFrame members in the declaration. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205418
2024-03-22 22:06:26 +00:00
Emilio Cobos Álvarez
4cb01a3837 Bug 1883694 - Minor cleanups to some table alignment code. r=dshin,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D203620
2024-03-06 12:59:09 +00:00
David Shin
1651b9477b Bug 1880405: Post cell span restyle event for border-collapsed MathML table cells. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D202455
2024-02-26 15:35:39 +00:00
Emilio Cobos Álvarez
605a4e159c Bug 1880550 - Propagate explicit heights to scrolled table cells as min-heights. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D202242
2024-02-22 12:23:09 +00:00
Stanca Serban
9d9ee992e1 Backed out changeset d83939746c70 (bug 1880550) for causing reftests failures bug785684-x.html. CLOSED TREE 2024-02-21 16:23:52 +02:00
Emilio Cobos Álvarez
b1eb6f63e8 Bug 1880550 - Propagate explicit heights to scrolled table cells as min-heights. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D202242
2024-02-21 12:18:35 +00:00
Emilio Cobos Álvarez
c7516dc3c0 Bug 1876745 - Propagate explicit content sizes to inner scrolled frame. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D199862
2024-01-30 12:46:21 +00:00
Emilio Cobos Álvarez
7316ded6ad Bug 221154 - Fix non-unified build.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2024-01-23 17:00:48 +01:00
Emilio Cobos Álvarez
d43c5c300e Bug 221154 - Make overflow work on table cells. r=dholbert
Depends on D198786

Differential Revision: https://phabricator.services.mozilla.com/D197978
2024-01-23 09:45:26 +00:00
Emilio Cobos Álvarez
f8af170983 Bug 221154 - Make ::-moz-table-content inherit padding from the table cell. r=dholbert
This doesn't change behavior but it's a prerequisite to supporting a
scrollframe properly (since we want the padding inside the scrolled
area).

This follows a bit what nsFieldSetFrame does.

Differential Revision: https://phabricator.services.mozilla.com/D198786
2024-01-23 09:45:25 +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
Narcis Beleuzu
0a22cd4d4f Backed out 2 changesets (bug 221154) for causing crashtests. CLOSED TREE
Backed out changeset 166b593890ef (bug 221154)
Backed out changeset 274f73457318 (bug 221154)
2024-01-19 20:17:38 +02:00
Emilio Cobos Álvarez
cf08a0330a Bug 221154 - Make overflow work on table cells. r=dholbert
Depends on D198786

Differential Revision: https://phabricator.services.mozilla.com/D197978
2024-01-19 16:33:54 +00:00
Emilio Cobos Álvarez
a11e359103 Bug 221154 - Make ::-moz-table-content inherit padding from the table cell. r=dholbert
This doesn't change behavior but it's a prerequisite to supporting a
scrollframe properly (since we want the padding inside the scrolled
area).

This follows a bit what nsFieldSetFrame does.

Differential Revision: https://phabricator.services.mozilla.com/D198786
2024-01-19 16:33:53 +00:00
Jonathan Kew
2ba7f19c6c Bug 1859523 - For table with collapsed borders, restrict painting of positioned cell background to the size inside the borders. r=layout-reviewers,emilio
The spec doesn't address this, AFAICT, but this makes our rendering better
match Chrome and Safari, and fixes the "disappearing" borders that have been
reported a number of times.

Differential Revision: https://phabricator.services.mozilla.com/D195044
2023-11-30 12:39:32 +00:00
Jonathan Kew
0203b5780c Bug 1867252 - Remove no-longer-used ns[BC]TableCellFrame::PaintBackground method. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D194977
2023-11-29 12:47:26 +00:00
Ting-Yu Lin
15c43e1a6f Bug 1859446 Part 6 - Remove unused nsresult return value from various table methods. r=layout-reviewers,jfkthame
We never communicate error status via the `nsresult` return value, and they
always return `NS_OK`. Hence the removal.

Differential Revision: https://phabricator.services.mozilla.com/D191156
2023-10-17 17:30:02 +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
David Shin
751f217d5e Bug 1825384 - Use app units in border-collapsed table data, not dev pixels. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D187140
2023-09-11 14:23:01 +00:00
Emilio Cobos Álvarez
aefd1ddb30 Bug 1851787 - Plumb a DestroyContext through all functions that can destroy frames. r=dholbert
This prevents anonymous content getting destroyed at weird times
during frame destruction.

Differential Revision: https://phabricator.services.mozilla.com/D187693
2023-09-08 15:11:17 +00:00
Emilio Cobos Álvarez
a7cc63588d Bug 1852076 - Simplify table part frame-destruction, to remove the need for a destruct root. r=dholbert
This is in order to eventually remove the destruct root.

This is a performance optimization to avoid doing the work of
registration if the table is about to go away anyways. The only thing
this wants to check is whether the first continuation is getting
destroyed. We can do that much more easily, explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D187677
2023-09-08 09:26:25 +00:00
Emilio Cobos Álvarez
52d097c513 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-07 11:46:30 +00:00
Narcis Beleuzu
77ba6cde90 Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00
Emilio Cobos Álvarez
59766eeba4 Bug 1851868 - Refactor nsIFrame::Destroy to pass a single DestroyContext parameter. r=dholbert
This shouldn't change behavior, but it packs the two arguments to
DestroyFrom into a single thing, and makes nsIFrame::Destroy not so easy
to call without a previous context.

This is a prerequisite to pass aDestroyContext to various things that
right now just mint one, which can cause badness, see bug 1851787 and
related bugs.

It's also a bit nicer to add things there if we need to in the future.

Differential Revision: https://phabricator.services.mozilla.com/D187578
2023-09-06 22:34:35 +00:00
Emilio Cobos Álvarez
b1fe05281f Bug 1834487 - Simplify border snapping. r=Oriol
Make the computed value of border-like properties app units (which is
effectively what happens in Gecko already), and clamp at computed value
time.

Differential Revision: https://phabricator.services.mozilla.com/D179481
2023-05-31 08:49:14 +00:00
Emilio Cobos Álvarez
e18c9b7ad6 Bug 1815552 - Make positioned table parts deal correctly with switching position without being reframed. r=TYLin,layout-reviewers
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.

Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.

Depends on D169127

Differential Revision: https://phabricator.services.mozilla.com/D170969
2023-03-01 19:04:17 +00:00
Cristina Horotan
e15f3e3295 Backed out 2 changesets (bug 1815552) for causing Bp-hybrid bustages at ComputedStyle.h on a CLOSED TREE
Backed out changeset da0f9295df91 (bug 1815552)
Backed out changeset cda1ee891058 (bug 1815552)
2023-03-01 16:05:19 +02:00
Emilio Cobos Álvarez
029e62f738 Bug 1815552 - Make positioned table parts deal correctly with switching position without being reframed. r=TYLin,layout-reviewers
While looking at the backout, I noticed table parts relied on reframing
on abspos-container-ness changes in a subtle way, see the test, which
fails with the first patch of this bug applied without these changes.

Make the NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN mean the same for table parts
as for everything else. Instead, keep the registration status on each
relevant frame class individually.

Depends on D169127

Differential Revision: https://phabricator.services.mozilla.com/D170969
2023-03-01 10:36:54 +00:00
Emilio Cobos Álvarez
c8200e7d27 Bug 1818851 - Minor cleanups to table classes. r=TYLin
Remove redundant virtual keywords, and initialize stuff in the declaration
when possible.

Differential Revision: https://phabricator.services.mozilla.com/D170968
2023-02-25 00:42:48 +00:00
Emilio Cobos Álvarez
673df6949e Bug 1809061 - Simplify background painting. r=tnikkel,layout-reviewers
The issue here is that DealWithWindowsAppearanceHacks doesn't run unless
we're actually painting a background because we look at
`mDefaultAppearance` and nsIFrame only checks `HasAppearance`.

However this code can be simplified a bit, now that we cleaned up
background propagation in bug 1665476.

Enter in AppendBackgroundItemsToTop unconditionally, and clean up a bit
while at it.

Differential Revision: https://phabricator.services.mozilla.com/D166352
2023-01-21 18:05:39 +00:00
Ting-Yu Lin
8f8ddadd2f Bug 1803863 Part 3 - Simplify the usages for ReflowOutput. r=emilio
- Remove unnecessary calls to ClearSize() after declaring a fresh ReflowOutput.
- Use ReflowOutput::SetSize() in nsTableFrame::FixupPositionedTableParts().

Differential Revision: https://phabricator.services.mozilla.com/D163763
2022-12-03 18:35:43 +00:00
Martin Robinson
abb5044ca7 Bug 1803377 - Rename the values of the IntrinsicDirty enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D163607
2022-12-02 12:27:31 +00:00
Ting-Yu Lin
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
Timothy Nikkel
dcbaa086e2 Bug 1792643. Set clip on background items for table cols and colgroups, when the table row, rowgroup or table has captured clip. r=mstange
Exactly like bug 1735265 except a frame other then the cell, between the
cell and the table frame is a stacking context.

Differential Revision: https://phabricator.services.mozilla.com/D158471
2022-10-05 22:03:29 +00:00
David Shin
13d8c567da Bug 1786353 - Use logical sides when calculating table cell baseline. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D155396
2022-08-23 17:11:44 +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
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
Daniel Holbert
94532509a5 Bug 1774879 part 5: Remove ComputedStyle* param from nsDisplayBackgroundImage::AppendBackgroundItemsToTop, since all callers pass nullptr (implicitly or explicitly). r=emilio
This patch doesn't change behavior.

I was initially going to promote this param to be const (which is an
improvement that's unlocked by earlier patches this series), but in doing so
I realized the param is entirely unnecessary. So, let's just remove it.

Differential Revision: https://phabricator.services.mozilla.com/D149678
2022-06-18 21:20:51 +00:00
Daniel Holbert
bb5d1b73f6 Bug 1767131: run clang-format on the layout/ directory. r=emilio DONTBUILD
This patch does not impact behavior; it's just formatting changes.

This patch was automatically generated by the following command:
    ./mach clang-format -p layout

Differential Revision: https://phabricator.services.mozilla.com/D145163
2022-04-30 15:25:29 +00:00
Miko Mynttinen
bf27b1182d Bug 1735265 - Part 1: Set clip on background items for table cols and colgroups, when the table cell has captured clip r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D129681
2022-03-22 18:40:51 +00:00