Commit Graph
1665 Commits
Author SHA1 Message Date
serge-sans-paille 03b0f2574c Bug 2040876 - Activate modernize-use-bool-literals clang-tidy check r=emilio,webrtc-reviewers,cookie-reviewers,places-reviewers,layout-reviewers,mak,bwc
Differential Revision: https://phabricator.services.mozilla.com/D301473
2026-05-25 21:13:49 +00:00
Daniel Holbert 47356193e7 Bug 2037693: Use MakeAndAddRef instead of 'new' to construct objects stored in local nsCOMPtrs, in various places in layout. r=layout-reviewers,jfkthame
Motivation: MakeAndAddRef forces us to store the result in a refcounted
pointer, which is a nice safety/strictness improvement.  Also, migrating lets
us reduce the number of manual 'new' invocations, which reduces our audit
surface for memory-allocation/lifetime issues.

Differential Revision: https://phabricator.services.mozilla.com/D299010
2026-05-07 08:34:49 +00:00
Daniel Holbert 8ce7475f6e Bug 2036989: Use GetOrCreateDeletableProperty to reduce manual 'new' invocations in layout code. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D298481
2026-05-06 22:29:33 +00:00
Atila Butkovits e611117715 Revert "Bug 2036989: Use GetOrCreateDeletableProperty to reduce manual 'new' invocations in layout code. r=layout-reviewers,emilio" on suspicion of causing assertion failure in browser/components/sidebar/tests/browser/browser_customize_sidebar.js.
This reverts commit 300ed0d12a.
2026-05-05 13:52:41 +00:00
Daniel Holbert 300ed0d12a Bug 2036989: Use GetOrCreateDeletableProperty to reduce manual 'new' invocations in layout code. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D298481
2026-05-05 07:58:49 +00:00
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
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 1e7c1504ae Bug 343048 - Get rid of ColGroup list. r=layout-reviewers,dshin
Having two lists that the frame constructor is not aware is a quirk that
causes correctness issues like bug 2021043.

Instead, sort rowgroups and colgroups once in the common case during
table layout. This also fixed some visibility collapse things because
now we compute overflow just once after collapsing. It also caused some
unexpected passes in some editing tests.

Add a test for bug 2021043, which is fixed by this.

Differential Revision: https://phabricator.services.mozilla.com/D286457
2026-03-12 09:37:21 +00:00
Emilio Cobos Álvarez 30b7a3d89a Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 07:39:54 +00:00
Norisz Fay 27f4694604 Revert "Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika" for causing bustage @ ElementAnimationData.h
This reverts commit c70290c619.
2026-02-06 05:34:42 +00:00
Emilio Cobos Álvarez c70290c619 Bug 2014922 - Untangle pseudo-element and anon box definitions. r=firefox-style-system-reviewers,xpcom-reviewers,layout-reviewers,dshin,nika
I looked at this because in bug 2014331 I need to mark more pseudos as
element-backed, and it's kinda silly the state our setup is in right
now.

This is all a somewhat historical mess, because in the old style system
pseudo-elements were just atoms, and we had that different types of atom
setup. The source of truth for these right now lives in a header macro
file, which isn't very flexible.

But now we have PseudoStyleType which represents both pseudos and anon
boxes, and is similar to the rust side PseudoElement enum.

Plus, the ::-moz-tree pseudo-elements are defined as anon boxes which
doesn't make any sense, so move them to pseudo-elements while at it.

Unify this in a similar way we treat CSS properties: Source of truth is
in pseudo_elements.toml / anon_boxes.toml, and we generate Rust and C++
as needed. This allows removing the nsStaticAtom subclass thing from
XPCOM, too.

This avoids some nasty duplication around which pseudos are pref-gated
and what not as well.

Differential Revision: https://phabricator.services.mozilla.com/D282076
2026-02-06 03:42:45 +00:00
serge-sans-paille cb423addae Bug 2011352 - Remove usage of DeprecatedAbs in layout/tables/nsTableFrame.cpp r=layout-reviewers,emilio
Turns out we have the guarantee of a positive value, so calling abs is
not needed at all.

Make it clear by moving local variables closer to their usage, and
assert.

Differential Revision: https://phabricator.services.mozilla.com/D279623
2026-01-20 10:08:22 +00:00
Jonathan Watt 23ba459f0e Bug 2004072. Pass a SizeComputationInput to nsIFrame::ComputeSize etc instead of a gfxContext. r=dshin,layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D275519
2025-12-09 06:59:12 +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
Ting-Yu Lin 2fe4a381eb Bug 1996146 Part 4 - Store positioned table parts using nsContainerFrame pointer. r=layout-reviewers,dshin
Table parts are all `nsContainerFrame`. This is a preparation for a later patch
to avoid type-casting.

Differential Revision: https://phabricator.services.mozilla.com/D269902
2025-10-24 16:32:03 +00:00
Narcis Beleuzu 9884ff2637 Revert "Bug 1993171 - Cleanup mfbt/MathAlgorithms.h r=emilio,win-reviewers,layout-reviewers,gstoll" for bustages on TestJSHandleRootedTypedef
This reverts commit 7fef278653.
2025-10-22 09:05:40 +00:00
serge-sans-paille 7fef278653 Bug 1993171 - Cleanup mfbt/MathAlgorithms.h r=emilio,win-reviewers,layout-reviewers,gstoll
- Remove DeprecatedAbs, replacing its usage by Abs or std::abs + explicit
  MOZ_ASSERT where it makes sense

- Use std::numeric_limits<...> instead of equivalent C headers

Differential Revision: https://phabricator.services.mozilla.com/D267914
2025-10-22 08:54:46 +00:00
Serban Stanca 04f2aead1f Revert "Bug 1993171 - Cleanup mfbt/MathAlgorithms.h r=emilio,win-reviewers,layout-reviewers,gstoll" for causing spidermonkey bustages in TestCeilingFloor.cpp.
This reverts commit aad24563c3.
2025-10-08 16:59:09 +00:00
serge-sans-paille aad24563c3 Bug 1993171 - Cleanup mfbt/MathAlgorithms.h r=emilio,win-reviewers,layout-reviewers,gstoll
- Remove DeprecatedAbs, replacing its usage by std::abs + explicit
  MOZ_ASSERT where it makes sens

- Use std::numeric_limits<...> instead of equivalent C headers

Differential Revision: https://phabricator.services.mozilla.com/D267914
2025-10-08 16:18:22 +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 ad5f8e7fd0 Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256291
2025-07-14 21:28:26 +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 27a56d04a1 Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256291
2025-07-11 15:21:45 +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 0b615836cf Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256291
2025-07-10 20:58:24 +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 8897bdc924 Bug 1971135: Use anchor resolution params in place of position property. r=TYLin
... The full resolution that makes use of additional parameters will follow
shortly.

Differential Revision: https://phabricator.services.mozilla.com/D253175
2025-06-16 20:35:30 +00:00
David Shin 20c44d3414 Bug 1964120: Remove unneeded aConstrainBSize flag in FinishReflowWithAbsoluteFrames and ReflowAbsoluteFrames. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D248268
2025-05-13 21:29:49 +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
Timothy Nikkel cbfdc953c7 Bug 1958219. Remove some unused scroll parent fields. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D244302
2025-04-04 10:50:26 +00:00
Timothy Nikkel 292af322c3 Bug 1933440. Make all display item destructors default and mark all display items final that can be. r=layout-reviewers,jfkthame
This just makes things nice and consistent and lets the compiler optimize if it can.

Differential Revision: https://phabricator.services.mozilla.com/D230249
2024-12-06 13:22:11 +00:00
Jonathan Watt 3095067f70 Bug 1931748. Fix some readability-else-after-return issues in layout code. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D229259
2024-11-17 12:09:57 +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
longsonr 843d861ed7 Bug 1929338 - convert more mozilla:clamped to std:clamp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D228069
2024-11-05 18:52:41 +00:00
serge-sans-paille 262f78c07f Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-28 08:21:19 +00:00
Alexandru Marc a5eb905bf4 Backed out changeset d92f391b3b0c (bug 1922838) for backing out bug 1915351 2024-10-25 16:42:33 +03:00
serge-sans-paille 07101ac24d Bug 1922838 - Replace ArrayLength, ArrayEnd and MOZ_ARRAY_LENGTH by standard alternative r=glandium,necko-reviewers,jgilbert,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,anti-tracking-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,bytesized,janv,dimi,daisuke,karlt,gstoll,canaltinova,timhuang
Namely std::size, std::end and std::size. This drops C support for
MOZ_ARRAY_LENGTH but it wasn't used anyway.

Differential Revision: https://phabricator.services.mozilla.com/D224611
2024-10-24 09:06:01 +00:00