Commit Graph
780 Commits
Author SHA1 Message Date
Eugeniusz Lewandowski fc8097fcc3 Bug 1650944 - Remove ReflowInput.h include from nsIFrame.h r=firefox-style-system-reviewers,layout-reviewers,emilio
Removed the Reflow Input in nsIFrame. Added includes for ReflowInput as
necessary in cpp files. Also Forward Declared nsLineLayout in 3 header
files.

Differential Revision: https://phabricator.services.mozilla.com/D298203
2026-05-04 12:06:23 +00:00
Sajid Anwar e9f3ef742a Bug 2029867 - Use default fallback baseline synthesis for tables. r=layout-reviewers,dshin
Updates tables to use the default margin-based baseline synthesis instead of its
existing, separate fallback. Also implements baseline export for table rows in
central baseline writing modes. WPTs are updated to test the difference between
table cell baseline export and synthesis in central baseline writing modes.

Differential Revision: https://phabricator.services.mozilla.com/D293645
2026-04-24 18:40:07 +00:00
rperta 39e7a3043e Revert "Bug 2029867 - Use default fallback baseline synthesis for tables. r=layout-reviewers,dshin" for causing reftest failures at 1966466.html
This reverts commit cc6c0c9099.

This reverts commit d2148eedc8.

This reverts commit 6f4a9dd2eb.

This reverts commit 7de5c26642.

This reverts commit baf0863064.
2026-04-24 13:12:08 +00:00
Sajid Anwar cc6c0c9099 Bug 2029867 - Use default fallback baseline synthesis for tables. r=layout-reviewers,dshin
Updates tables to use the default margin-based baseline synthesis instead of its
existing, separate fallback. Also implements baseline export for table rows in
central baseline writing modes. WPTs are updated to test the difference between
table cell baseline export and synthesis in central baseline writing modes.

Differential Revision: https://phabricator.services.mozilla.com/D293645
2026-04-24 10:58:28 +00:00
Silaghi 6deafabdf7 Revert "Bug 2029867, Bug 2029864 - Use default fallback baseline synthesis for tables. r=layout-reviewers,dshin" for causing reftests failures at 1966466.html
This reverts commit 656073d672.

Revert "Bug 2029867 - Unify synthesis of margin-based and content/padding/border-based box baselines. r=layout-reviewers,dshin"

This reverts commit 40a9b5db71.

Revert "Bug 2029864 - Adjust 1083848-3-inline-background-repeat.html with more robust font size handling. r=layout-reviewers,dshin"

This reverts commit 708a2904ee.

Revert "Bug 2029864 - Adjust 1115916-1-vertical-metrics.html reftest with more robust Ahem font size. r=layout-reviewers,dshin"

This reverts commit 677a5812f8.

Revert "Bug 2029864 - Adjust WPT tests for text-emphasis line heights. r=layout-reviewers,dshin"

This reverts commit c50c152a44.
2026-04-23 06:24:07 +00:00
Sajid Anwar 656073d672 Bug 2029867 - Use default fallback baseline synthesis for tables. r=layout-reviewers,dshin
Updates tables to use the default margin-based baseline synthesis instead of its
existing, separate fallback. Also implements baseline export for table rows in
central baseline writing modes. WPTs are updated to test the difference between
table cell baseline export and synthesis in central baseline writing modes.

Differential Revision: https://phabricator.services.mozilla.com/D293645
2026-04-23 05:20:36 +00:00
Silaghi c1288cc070 Revert "Bug 2029867, Bug 2029864 - Use default fallback baseline synthesis for tables. r=layout-reviewers,dshin" for causing reftest failures at base/Baseline
This reverts commit 57ab38fd30.

Revert "Bug 2029867 - Unify synthesis of margin-based and content/padding/border-based box baselines. r=layout-reviewers,dshin"

This reverts commit 2c125c7bae.

Revert "Bug 2029864 - Adjust 1083848-3-inline-background-repeat.html with more robust font size handling. r=layout-reviewers,dshin"

This reverts commit 79a72f0bba.

Revert "Bug 2029864 - Adjust 1115916-1-vertical-metrics.html reftest with more robust Ahem font size. r=layout-reviewers,dshin"

This reverts commit 1e038f073e.

Revert "Bug 2029864 - Adjust WPT tests for text-emphasis line heights. r=layout-reviewers,dshin"

This reverts commit bf7b7bf2d3.
2026-04-21 16:28:51 +00:00
Sajid Anwar 57ab38fd30 Bug 2029867 - Use default fallback baseline synthesis for tables. r=layout-reviewers,dshin
Updates tables to use the default margin-based baseline synthesis instead of its
existing, separate fallback. Also implements baseline export for table rows in
central baseline writing modes. WPTs are updated to test the difference between
table cell baseline export and synthesis in central baseline writing modes.

Differential Revision: https://phabricator.services.mozilla.com/D293645
2026-04-21 15:47:33 +00:00
Sylvestre Ledru 55481ac4b5 Bug 2023419 - Remove Emacs/Vim modelines from layout/ r=emilio,firefox-style-system-reviewers,layout-reviewers
replaced by .editorconfig

Differential Revision: https://phabricator.services.mozilla.com/D287852
2026-03-17 12:05:43 +00:00
Emilio Cobos Álvarez f1dea2d65d Bug 2013141 - Remove custom_consts specialness from CSS keywords. r=firefox-style-system-reviewers,layout-reviewers,dshin
Just name the things like in CSS.

Differential Revision: https://phabricator.services.mozilla.com/D281001
2026-01-30 21:12:51 +00:00
Sajid Anwar b55def8635 Bug 2008335 - Decouple table cell alignment enum from CSS vertical-align enum. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D277747
2026-01-02 09:20:27 +00:00
Emilio Cobos Álvarez 4bbf8598d1 Bug 1998125 - Remove a lot of now unused view code. r=layout-reviewers,firefox-style-system-reviewers,dshin
No need to reposition views during layout and so on, now that we don't
use views for either popups nor subdocuments.

No need for nsView to have parent / sibling / children either.

Differential Revision: https://phabricator.services.mozilla.com/D271205
2025-11-12 01:53:45 +00:00
Emilio Cobos Álvarez 764938320e Bug 1993353 - Remove NS_FRAME_HAS_VIEW. r=tnikkel,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D268103
2025-10-09 11:22:21 +00:00
Emilio Cobos Álvarez 67ec7b59e0 Bug 1990448 - Do content-visibility checks on the container. r=layout-reviewers,dshin
No behavior change, but this saves some per-child work and conceptually
is the right thing to do. HidesContent() is non-trivial.

Add an assertion to make sure we don't enter BuildDisplayListForChild
at all if content is hidden.

I audited all the callers, and the ones I didn't touch can't have
content-visibility (things like the viewport / pages / etc).

Differential Revision: https://phabricator.services.mozilla.com/D265956
2025-09-24 15:11:22 +00:00
David Shin 8090f17c2b Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-14 21:28:23 +00:00
pstanciu 7a21072acf Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing failures @ anchor-name-003.html
This reverts commit 5e12720896.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 27a56d04a1.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 69b2bd0242.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 23c707d5a7.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit c0d1d8808d.
2025-07-12 02:02:55 +00:00
David Shin 69b2bd0242 Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-11 15:21:42 +00:00
Atila Butkovits 0b2944a3d2 Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing bustages at GeckoBindings.cpp.
This reverts commit 49a7b8afce.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 0b615836cf.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 359badb60e.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 17f7f64cd8.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit 47197ef7ab.
2025-07-11 01:18:14 +00:00
David Shin 359badb60e Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-10 20:58:21 +00:00
Emilio Cobos Álvarez a8a2311474 Bug 1976457 - Sort includes in layout/. r=janv,dshin
Interesting bit is layout/.clang-format, the rest is all automated.

Differential Revision: https://phabricator.services.mozilla.com/D256616
2025-07-09 13:24:00 +00:00
Jonathan Kew 7ae452b85e Bug 1961753 - Handle alignment properly in orthogonal table cells without an explicit inline-size. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D246976
2025-04-29 07:32:46 +00:00
Jonathan Kew 183c59ae36 Bug 1958022 - For cells that are orthogonal to the table structure, do a final reflow after the cell size is known, to properly align content. r=dshin
We can't get text-align right during the initial table reflow because the
inline-size within which the cell content is to be aligned is not yet known
(it'll come from the block-size we compute for the parent row).

So to deal with this, we record during tableRowFrame reflow whether any
cells with orthogonal writing mode were present; and if so, at the end of
the row reflow, we make another pass over the orthogonal cells and reflow
them to properly align their content within the computed cell size.

Differential Revision: https://phabricator.services.mozilla.com/D245615
2025-04-16 18:40:46 +00:00
David Shin 85c922b0dd Bug 1923959: Resolve anchor for (max) sizes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240864
2025-04-08 02:29:18 +00:00
Jonathan Kew e9a13b8343 Bug 1957710 - Use the correct writing-mode to handle vertical-align within table cells. r=layout-reviewers,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D244363
2025-04-07 20:02:39 +00:00
Emilio Cobos Álvarez 585d705bd2 Bug 1936549 - Make empty cells more thoroughly not participate on baseline alignment. r=dshin
This matches other browsers, and was kinda what was intended with the
content empty check and such, I believe.

Differential Revision: https://phabricator.services.mozilla.com/D232375
2024-12-17 20:22:49 +00:00
Jonathan Watt 6a6a264e38 Bug 1931736. Add missing braces around if/loop statements in layout/tables/. r=layout-reviewers,emilio
Depends on D229254

Differential Revision: https://phabricator.services.mozilla.com/D229255
2024-11-17 05:04:01 +00:00
Emilio Cobos Álvarez a24a2ef5c4 Bug 1923201 - Make table row height not influenced by baseline of child cell. r=dshin
This matches Blink, and WebKit trunk[1], and prevents regressions when landing
bug 1922900.

[1]: https://github.com/WebKit/WebKit/commit/35080913a8857664e7d08a58b8739c64a71e4098

Differential Revision: https://phabricator.services.mozilla.com/D224805
2024-10-07 20:57:45 +00:00
Emilio Cobos Álvarez 501f63a2fd Bug 1907289 - Reflow table cell if collapsed borders have changed. r=dshin
A potentially better approach could be to call FrameNeedsReflow from
nsBCTableCellFrame::SetBorderWidth... But it seems that might
over-invalidate quite a lot when recalculating borders, since it seems
we reset the relevant ones and then accumulate directly on the frame.

If that seems like a better approach, happy to give that a try. This
should be less risky for performance changes in general tho.

Differential Revision: https://phabricator.services.mozilla.com/D216409
2024-07-12 15:05:32 +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 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
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
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
Ting-Yu Lin ad72f90b4b 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 55855ab468 Bug 1861562 Part 3 - Use GetFirstCell() to avoid extra do_QueryFrame again. r=layout-reviewers,jfkthame
Similar to https://phabricator.services.mozilla.com/D190375, convert more loops.

Differential Revision: https://phabricator.services.mozilla.com/D192050
2023-10-27 18:38:07 +00:00
Ting-Yu Lin bc953608c1 Bug 1861562 Part 1 - Replace GetRowBefore() with GetPrevRow(). r=layout-reviewers,jfkthame
We really don't need to call `GetNextRow()` repeatedly from `aStartRow` until
reaching `aRow`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D192048
2023-10-27 18:38:06 +00:00
Ting-Yu Lin 7d2e810399 Bug 1857585 Part 7 - Revise the helper computing table cell's block-size. r=dholbert
* It used to return useless `nsresult`. Change it to return the block-size
  instead of modifying the argument to return value.
* Shorten its name to `CalcCellActualBSize` to match `CalcBSize`.

Differential Revision: https://phabricator.services.mozilla.com/D190377
2023-10-08 01:05:14 +00:00
Ting-Yu Lin bbb3e7eb86 Bug 1857585 Part 6 - Use GetFirstRow() to avoid extra do_QueryFrame. r=dholbert
While I'm here, revise GetFirstRow(), GetLastRow(), and GetNextRow(), and add
assertions to them to ensure the correctness of table frame tree structure.

Differential Revision: https://phabricator.services.mozilla.com/D190376
2023-10-08 01:05:14 +00:00
Ting-Yu Lin 8844a8807d Bug 1857585 Part 5 - Use GetFirstCell() to avoid extra do_QueryFrame. r=dholbert
nsTableRowFrame's children are all nsTableCellFrame, and `GetFirstCell()` has an
assertion for that. Hence, we can delete the unreachable code dealing with
non-cell frames.

Differential Revision: https://phabricator.services.mozilla.com/D190375
2023-10-08 01:05:13 +00:00
Ting-Yu Lin 85e1c8e57a Bug 1857585 Part 4 - Simplify unpaginated block-size helpers. r=dholbert
We don't ever remove `NS_TABLE_ROW_HAS_UNPAGINATED_BSIZE` bit, so let's set the
bit directly in `SetUnpaginatedBSize()`.

This patch doesn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D190374
2023-10-08 01:05:13 +00:00
Ting-Yu Lin c66f050c39 Bug 1857585 Part 3 - Remove nscoord parameter for ResetBSize(). r=dholbert
It is confusing for ResetBSize() to take a parameter to set the fixed
block-size. The caller can call `SetFixedBSize()` if needed.

Differential Revision: https://phabricator.services.mozilla.com/D190373
2023-10-08 01:05:12 +00:00
Ting-Yu Lin 04d4692a0c Bug 1857585 Part 2 - Remove a redundant writing-mode variable. r=dholbert
`wm` has been declared near the beginning of `nsTableCellFrame::Reflow()`.

Differential Revision: https://phabricator.services.mozilla.com/D190372
2023-10-08 01:05:12 +00:00
Ting-Yu Lin f0567a5caa Bug 1857585 Part 1 - Remove unused PresContext parameter. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D190371
2023-10-08 01:05:11 +00:00
Ting-Yu Lin 0785b3918a Bug 1856469 - Remove redundant GetTableFrame() call in nsTableRowFrame::DidResize(). r=dholbert
We've got `tableFrame` at the beginning of the method.

Differential Revision: https://phabricator.services.mozilla.com/D189865
2023-10-02 23:51:45 +00:00
Cosmin Sabou 5423c7bf02 Backed out changeset c20fe6f0a048 (bug 1825384) for causing table related reftest failures. CLOSED TREE 2023-09-11 19:51:30 +03:00
David Shin f516fc2773 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 0b366c953e 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 ac27a7dbe0 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 6c324c6d1b 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 33592fec5e Backed out changeset 55052ae7d067 (bug 1851868) for reftest failure on 1153695.html . CLOSED TREE 2023-09-07 02:42:25 +03:00