Commit Graph

3207 Commits

Author SHA1 Message Date
Ting-Yu Lin
b4a0842882 Bug 1824877 Part 3 - Change ScrollContainerFrame's type from Scroll to ScrollContainer. r=dholbert
This effectively changes the `IsScrollFrame()` helper to
`IsScrollContainerFrame()`.

Differential Revision: https://phabricator.services.mozilla.com/D210357
2024-05-15 17:50:49 +00:00
David Shin
558610b3b0 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
4ae445ed3d 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
c708bef960 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
5e870f6bd5 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
7b4e1c313a 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
8a77ebbb16 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
319fc12b73 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
512cea0dbf 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
sid
568f27d168 Bug 1825386 - Converted LogicalAxis to enum class and type casted where necessary. r=TYLin
LogicalAxis is one of the Logical* enums. Converting it from enum to
enum class increases type safety. To run with the pre-existing code,
type casting was added when needed. Comments have been edited where
needed.

Differential Revision: https://phabricator.services.mozilla.com/D206108
2024-03-30 16:20:37 +00:00
flowejam
9d4992fcc6 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
9bad1041af 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
1c8592d312 Bug 1886942 Part 3 - Inline simple getter/setters in nsTableCellFrame. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205419
2024-03-23 17:06:05 +00:00
Ting-Yu Lin
069c15f2bd 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
Ting-Yu Lin
8bd0b3625c Bug 1886942 Part 1 - Remove typedefs in nsTableCellFrame. r=layout-reviewers,emilio
These typedefs are either not used, or used only a few times.

Differential Revision: https://phabricator.services.mozilla.com/D205417
2024-03-23 17:06:05 +00:00
pstanciu
8388ab36d8 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
018c93cf49 Bug 1886942 Part 3 - Inline simple getter/setters in nsTableCellFrame. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D205419
2024-03-22 22:06:26 +00:00
Ting-Yu Lin
6dc0dc413f 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
Ting-Yu Lin
3dc081b5c3 Bug 1886942 Part 1 - Remove typedefs in nsTableCellFrame. r=layout-reviewers,emilio
These typedefs are either not used, or used only once or twice.

Differential Revision: https://phabricator.services.mozilla.com/D205417
2024-03-22 22:06:25 +00:00
Emilio Cobos Álvarez
0f046c7136 Bug 1883813 - Implement table cell height quirk as per spec. r=dshin
That is, don't force the width to be content-box. That matches other
implementations and the spec.

Differential Revision: https://phabricator.services.mozilla.com/D204812
2024-03-20 21:32:01 +00:00
Ting-Yu Lin
42fe4966fa 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
Frédéric Wang
89782dfedc Bug 1883606 - Export more MathML crashtests to WPT. r=emilio
Follow-up of bug 1795630 for some crashtests that were not in `mathml`
directories. The list was extracted in a subjective way from [1] by
looking at some tests that seem to contain essentially MathML with
some simple HTML or CSS. The changes to `crashtest.list` files have
been generated by [2].

[1] https://searchfox.org/mozilla-central/search?q=%3Cmath%7Cmathml&path=crashtest&case=true&regexp=true
[2] `for file in $(^Ct ~/list-of-tests.txt); do D=$(dirname $file); F=$(filename $file); sed -i "/$F/d" $D/crashtests.list; done`

Differential Revision: https://phabricator.services.mozilla.com/D203614
2024-03-08 15:40:22 +00:00
Ting-Yu Lin
38414bb841 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
2d5719f996 Backed out changeset 2960ea3e50ca (bug 1881157) for causing crashtest assertion failures. CLOSED TREE 2024-03-06 21:01:06 +02:00
Ting-Yu Lin
567c398b05 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
d0d7d7b42e 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
Emilio Cobos Álvarez
09d3f65e7e 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
6cd1400e8a 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
275655e413 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
dc04a6d198 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
Joel Maher
5742640e64 Bug 1879538 - cleanup unnecessary and redundant reftest conditions. r=aryx,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D201794
2024-02-22 23:04:45 +00:00
Emilio Cobos Álvarez
32fa10b50c 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
0efdd25891 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
ccb3fffa4a 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
David Shin
d6b7304705 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
744ba2519b 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
4b1dab0a64 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
e488d77db2 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
4802877b67 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
a9e6818c64 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
Emilio Cobos Álvarez
3a5ae295b4 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
30920df687 Bug 221154 - Fix non-unified build.
MANUAL PUSH: Trivial orange fix CLOSED TREE
2024-01-23 17:00:48 +01:00
Emilio Cobos Álvarez
11a2ea7000 Bug 221154 - Tweak a few crashtest assertion counts. r=dholbert
The padding changes causes some sizes in the child to not exactly be
nscoord_MAX when overflowing, but a slightly smaller value, not hitting
the width == nscoord_MAX || height == nscoord_MAX condition in
FinishStoreOverflow().

The other one is similar, where an nscoord_MAX value gets to bidi
reordering, where it didn't before. It doesn't seem problematic /
anything that wouldn't otherwise happen with a regular block with
padding.

Tweak while at it some of the overflow areas assertions, mostly
to make it simpler, but also because I'm not super-positive about
the compiler being able to optimize it away entirely on opt builds.

Depends on D197978

Differential Revision: https://phabricator.services.mozilla.com/D199241
2024-01-23 09:45:26 +00:00
Emilio Cobos Álvarez
d79ce67c15 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
9c21689673 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
e9151ca0ee 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
600cbc7a39 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
3bab568d66 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
d99cfc4491 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
Masayuki Nakano
3ebea49269 Bug 1872410 - Make nsTableRowGroupFrame::FindLineContaining allow callers to set aFrame to an out-of-flow child r=emilio
If the table-row-group is styled by CSS and it does not have proper table row
children, anonymous table rows and cells are generated and the real content is
rendered in a placeholder.  In this case, the parent of out-of-flow child frame
is the table-row-group frame even though the table-row-group frame has only
anonymous table-row child frame.  Therefore, it fails to query `nsTableRowFrame`
and access `nsIFrame` methods with `nullptr`.

This patch allows the method users to set an out-of-flow child frame and
makes the method return "not found".

Differential Revision: https://phabricator.services.mozilla.com/D197983
2024-01-10 03:13:15 +00:00