Commit Graph
793 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
serge-sans-paille d58c18b09a Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 10:05:25 +00:00
Silaghi 81930b22ee Revert "Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato" for causing build bustages at style/nsStyleUtil
This reverts commit b97e69b590.
2026-04-09 08:09:15 +00:00
serge-sans-paille b97e69b590 Bug 2030235 - Decouple ServoStyleConsts from nsGkAtoms.h r=emilio,necko-reviewers,geckoview-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,kershaw,m_kato
And remove unused includes of nsGkAtoms.h in the process. The few
dependencies have been moved to ServoStyleConstsInlines.h

The used command to remove the now unused dependency was:

git grep -l nsGkAtoms.h | while read line; do grep -v nsGkAtoms.h $line | grep -q -E '\<nsGkAtoms\>' || sed -i -e '/nsGkAtoms.h/d' $line  ; done

Differential Revision: https://phabricator.services.mozilla.com/D292697
2026-04-09 06:41: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 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
Emily McDonough 2490e6d383 Bug 1994516 - Make nsILineIterator::FindLineContaining take a const nsIFrame*. r=layout-reviewers,TYLin
This requires making nsTHashtable::Contains and nsFrameList::IndexOf accept
const pointers.

Differential Revision: https://phabricator.services.mozilla.com/D268778
2025-10-16 18:14:53 +00:00
Lando f7e038bbdc Bug 1990448: apply code formatting via Lando
# ignore-this-changeset
2025-09-24 15:11:36 +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
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 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
Sylvestre Ledru a3ea006705 Bug 1519636 - Reformat recent changes to the Google coding style r=emilio,necko-reviewers,geckoview-reviewers,application-update-reviewers,media-playback-reviewers,devtools-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,migration-reviewers,padenot,mconley,nchevobbe,kershaw,gstoll,mstange,bytesized,m_kato
This new version of clang 17 also slightly changed the formatting.

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D215914
2024-07-17 11:15:31 +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
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
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
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 8553e48557 Bug 1863837 Part 5 - Always push overflow table rows to overflow list. r=layout-reviewers,emilio
Similar to Part 4, but for table row frames.

This patch shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D193144
2023-11-13 22:36:14 +00:00
Ting-Yu Lin 2bcef56cb0 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 a4f8b4b599 Bug 1861562 Part 4 - Micro optimization in nsTableRowGroupFrame::InitChildReflowInput(). r=layout-reviewers,jfkthame
We don't need the type-casting if `aBorderCollapse` is false.

Differential Revision: https://phabricator.services.mozilla.com/D192051
2023-10-27 18:38:08 +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 ac41a2729e Bug 1678767 Part 4 - Convert nsTableRowGroupFrame::SplitSpanningCells() to use logical coordinates. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D191370
2023-10-23 18:38:01 +00:00
Ting-Yu Lin 301fd1b5b8 Bug 1678767 Part 3 - Convert nsPresContext and frame arguments from references to pointers. r=dshin
In layout code, we almost always operate on frames via pointers. With this
patch, we can eliminate extra `&` and `*`.

Differential Revision: https://phabricator.services.mozilla.com/D191369
2023-10-23 18:38:00 +00:00
Ting-Yu Lin 759e7cf504 Bug 1678767 Part 2 - Convert nsTableRowGroupFrame::SplitRowGroup() to logical coordinates. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D191368
2023-10-23 18:38:00 +00:00
Ting-Yu Lin 28c1cac16e Bug 1678767 Part 1 - Convert nsTableRowGroupFrame::Reflow() to logical coordinates. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D191367
2023-10-23 18:37:59 +00:00
Ting-Yu Lin f733dff414 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
Ting-Yu Lin 4ecc4b5aa9 Bug 1859446 Part 5 - Make CreateContinuingRowFrame() return newly created table row frame. r=layout-reviewers,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D191155
2023-10-17 17:30:02 +00:00
Ting-Yu Lin 201aec3ce6 Bug 1859446 Part 4 - Rename desiredSize variable for table row children. r=layout-reviewers,jfkthame
Add "kid" prefix for table row's desired size so that it won't be confused with
`aDesiredSize` output argument.

Differential Revision: https://phabricator.services.mozilla.com/D191154
2023-10-17 17:30:01 +00:00
Ting-Yu Lin c1988278c3 Bug 1859446 Part 3 - Rename member vars in TableRowGroupReflowInput to match coding style. r=layout-reviewers,jfkthame
Also, remove `using TableRowGroupReflowInput` statement since it helps my editor
jump directly to `TableRowGroupReflowInput`'s definition rather than to the
alias.

Differential Revision: https://phabricator.services.mozilla.com/D191153
2023-10-17 17:30:01 +00:00
Ting-Yu Lin c1e9dcd8c9 Bug 1859446 Part 2 - Remove TableRowGroupReflowInput::tableFrame. r=layout-reviewers,jfkthame
`tableFrame` is seldom used, and all the functions that need the table frame
have already got it via `GetTableFrame()` helper.

Differential Revision: https://phabricator.services.mozilla.com/D191152
2023-10-17 17:30:01 +00:00
Ting-Yu Lin f609a78727 Bug 1859446 Part 1 - Remove haveRow variable in nsTableRowGroupFrame::ReflowChildren(). r=layout-reviewers,jfkthame
We don't need set `haveRow` to `true` in every iteration in the loop over table
rows. It is sufficient to check `GetFirstRow()`.

Differential Revision: https://phabricator.services.mozilla.com/D191151
2023-10-17 17:30:00 +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 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 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
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
Emilio Cobos Álvarez 0698c96bd1 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