2422 Commits
Author SHA1 Message Date
Ting-Yu Lin 1b99f231da Bug 2041516 Part 1 - Assert fresh reflow status at the beginning of AbsoluteContainingBlock::Reflow(). r=layout-reviewers,emilio
This patch enforces the invariant for `AbsoluteContainingBlock::Reflow()` that
most of the `Reflow()` functions already have.

Differential Revision: https://phabricator.services.mozilla.com/D302429
2026-05-26 19:07:08 +00:00
Ting-Yu Lin 1e2c727426 Bug 489100 - Compute inline absolute containing block rect from its first and last continuation. r=layout-reviewers,dholbert
In order to compute the rect, we need to have all the inline continuations
reflowed and placed. Therefore, this patch introduces a new phase in
`nsBlockFrame::Reflow()` to reflow all the absolute descendants under inline
containing blocks, and adds the absolute descendants' overflow areas into inline
frames and lines' overflow areas.

Differential Revision: https://phabricator.services.mozilla.com/D301184
2026-05-23 20:23:51 +00:00
Hiroyuki Ikezoe b42414c3c0 Bug 1950303 - Convert nsContainerFrame::ConsiderChildOverflow's bool parameter to OverflowAreaUnionFlags enum. r=layout-reviewers,emilio
This is a preparatory refactor for a follow-up commit that introduces a new
flag (for absolutely positioned children). Using a bit-flag enum makes call
sites self-documenting and lets us add more orthogonal options without
expanding the parameter list.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D299915
2026-05-12 04:18:04 +00:00
Ting-Yu Lin 1a4668757b Bug 2038366 - Add a child frame iterator for nsLineBox, and adapt callers. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D299505
2026-05-09 13:56:59 +00:00
Timothy Nikkel 706ca7fd37 Bug 2034989. Use UniquePtr to manage TextOverflow objects in nsBlockFrame::BuildDisplayList to save some stack space. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D296518
2026-04-25 15:41:01 +00:00
Emilio Cobos Álvarez 34b249c82e Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-16 17:09:40 +00:00
Serban Stanca 5d4176345b Revert "Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin" for causing several failures.
This reverts commit 81ef425716.
2026-04-16 09:31:32 +00:00
Emilio Cobos Álvarez 81ef425716 Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-16 08:10:39 +00:00
agoloman dfead40619 Revert "Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin" for causing crashtest assertions @399262.html.
This reverts commit 51d51c3b33.
2026-04-16 00:28:13 +00:00
Ting-Yu Lin 2f6171db5c Bug 2030432 - Fix abspos painting in wrong column when its containing block has transform. r=layout-reviewers,dshin
When a transformed absolute containing block fragments across multi-column,
abspos children could paint in the wrong column. This happened because the
abspos display item was built when its placeholder was encountered during
display list traversal, and the placeholder could end up in a different column
than where the abspos should paint.

Extend `DisplayPushedAbsoluteFrames` (now renamed to
`DisplayAbsoluteFramesNotBuiltByPlaceholder`) to also directly build abspos
frames whose placeholder lived in a different continuation subtree. Skip
building those abspos frames when they are later traversed via their
placeholders.

Differential Revision: https://phabricator.services.mozilla.com/D294312
2026-04-15 23:27:08 +00:00
Emilio Cobos Álvarez 51d51c3b33 Bug 2031757 - Rejigger text input / textarea rendering to make field-sizing easier. r=layout-reviewers,devtools-reviewers,fxview-reviewers,firefox-style-system-reviewers,ochameau,jsudiaman,dshin
This also should fix bug 1881942 (placeholder is now scrollable
alongside the textarea).

This makes nsTextControlFrame a subclass of ScrollContainerFrame (with
an inner block), and tweaks layout to match.

It lays out the inner content using block layout and align-content,
rather than bespoke reflow primitives. This makes field-sizing trivial
to implement on top.

This is a bit scary, but simpler in most ways. In particular, it needs
to teach ScrollContainerFrame of the button, because that goes outside
the scrollable area, like scrollbars. That said it needs less
special-cases added than those removed, and it should also be faster
(needs less frames to layout an input with placeholder etc), and match
other browsers better.

The general set-up is:

  <text-control-editing-root/>
  <placeholder/>
  <autofill-preview/>

text-control-editing-root is always inline-block and always displayed
(since it's what grabs the focus / shows the caret). If the
autofill-preview or placeholder are displayed, the editing-root is
zero-width and clipped (note that for placeholder that's guaranteed
because placeholder is only shown with an empty value, but
autofill-preview needs it).

placeholder and autofill-preview are hidden via `display` rather than
visibility. This doesn't make a difference with this patch but it
matters for bug 1977176.

Caret painting needs an extra hop to paint atop the placeholder (no
observable behavior change, but worth calling out).

There is one subtle behavior change, which is that single-line inputs
never report scrollable overflow in the block axis. This matches other
browsers (see the tweak in nsBlockFrame's overflow computation) and is
needed to avoid regressing scrollable-overflow-padding-input.html.

The changes in window_composition_text_querycontent.xhtml are needed
because before this patch, the height of the control editing root was
always the height of the whole textarea. The characters you're composing
might legitimately be taller than the line. Bump the line height so that
that doesn't happen in this test.

Differential Revision: https://phabricator.services.mozilla.com/D293666
2026-04-15 23:25:11 +00:00
agoloman 83610050c8 Revert "Bug 2030432 - Fix abspos painting in wrong column when its containing block has transform. r=layout-reviewers,dshin" for causing failures @anchor-position-multicol-fixed-001.html.
This reverts commit d7c27ff2a1.
2026-04-15 21:00:00 +00:00
Ting-Yu Lin d7c27ff2a1 Bug 2030432 - Fix abspos painting in wrong column when its containing block has transform. r=layout-reviewers,dshin
When a transformed absolute containing block fragments across multi-column,
abspos children could paint in the wrong column. This happened because the
abspos display item was built when its placeholder was encountered during
display list traversal, and the placeholder could end up in a different column
than where the abspos should paint.

Extend `DisplayPushedAbsoluteFrames` (now renamed to
`DisplayAbsoluteFramesNotBuiltByPlaceholder`) to also directly build abspos
frames whose placeholder lived in a different continuation subtree. Skip
building those abspos frames when they are later traversed via their
placeholders.

Differential Revision: https://phabricator.services.mozilla.com/D294312
2026-04-15 20:04:19 +00:00
serge-sans-paille eccc9787f4 Bug 2029001 - Remove or guard inclusion of fmt/format.h when possible r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D291866
2026-04-04 10:59:59 +00:00
serge-sans-paille 43f9567997 Bug 2028388 - Fix miscellaneous loop range conversion in DEBUG mode r=emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D291417
2026-04-02 08:51:38 +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 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
Ting-Yu Lin ebb38c0eb1 Bug 1775003 - Reset block frame completion status if it is going to be reflow again by ancestor due to clearance. r=layout-reviewers,dshin
This patch also prevents triggering the following assertion when multicol
performs a measuring reflow in an incremental reflow scenario (Bug 2011462) with
`layout.abspos.fragmentainer-aware-positioning.enabled=true`.

```
###!!! ASSERTION: Shouldn't be incomplete if availableBSize is UNCONSTRAINED.:
'aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE',
```

Differential Revision: https://phabricator.services.mozilla.com/D280856
2026-01-30 21:34:01 +00:00
David Shin 9462427f28 Bug 2013139: Paint pushed absolute frames and after painting children. r=emilio,layout-reviewers
See discussion in
https://phabricator.services.mozilla.com/D272401#inline-1485354

We seem to rely on the timing of overflow containers display items for e.g.
Pagination.

DisplayList will be sorted by z-index, but it's a stable sort that relies on
items being added in document order.

`out-of-flow-in-multicolumn-paint-order-003.html` fails due to us not
fragmenting grid items needs fragmentation.

Differential Revision: https://phabricator.services.mozilla.com/D281028
2026-01-30 14:02:16 +00:00
Emilio Cobos Álvarez 077d88e977 Bug 2011213 - Remove FMT_STRING() usage. r=padenot
Should not be needed now that we build with C++20.

Differential Revision: https://phabricator.services.mozilla.com/D279521
2026-01-19 15:12:33 +00:00
Emilio Cobos Álvarez 555cad41c3 Bug 2000981 - Deal with clamping to end of block. r=jfkthame,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D277323
2025-12-29 20:44:27 +00:00
Ting-Yu Lin 9aa23feec4 Bug 2007058 Part 2 - Paint pushed abspos frames with NS_FRAME_IS_PUSHED_OUT_OF_FLOW bit in DisplayPushedAbsoluteFrames(). r=layout-reviewers,dholbert
Mark abspos next-in-flows with the `NS_FRAME_IS_PUSHED_OUT_OF_FLOW` bit, and
adjust the display item generation code accordingly.

In Bug 1994346, pushed abspos first-in-flow will get the bit as well.

Differential Revision: https://phabricator.services.mozilla.com/D277138
2025-12-19 21:05:37 +00:00
Ting-Yu Lin 37912600c5 Bug 2007058 Part 1 - Generalize NS_FRAME_IS_PUSHED_FLOAT bit to NS_FRAME_IS_PUSHED_OUT_OF_FLOW. r=layout-reviewers,emilio
We need a similar concept to mark an abspos frame that is pushed to a later
absolute-containing-block continuation. A frame is either a float or an abspos
and thus lives in a different frame child list, so the same bit can be used in
both scenarios without conflicts.

Differential Revision: https://phabricator.services.mozilla.com/D277137
2025-12-19 21:05:34 +00:00
Emilio Cobos Álvarez cb259a9996 Bug 1999100 - Don't clip overflow by default on replaced images. r=jwatt
This implements overflow-clip-box: <visual-box>, and uses it to allow
overflow on replaced elements.

Differential Revision: https://phabricator.services.mozilla.com/D274759
2025-12-10 09:40:55 +00:00
Serban Stanca 29933f495e Revert "Bug 1999100 - Don't clip overflow by default on replaced images. r=jwatt" for causing wpt failures in multicol-on-broken-image-alt-text.html.
This reverts commit ab74c24e55.
2025-12-10 01:38:55 +00:00
Emilio Cobos Álvarez ab74c24e55 Bug 1999100 - Don't clip overflow by default on replaced images. r=jwatt
This implements overflow-clip-box: <visual-box>, and uses it to allow
overflow on replaced elements.

Differential Revision: https://phabricator.services.mozilla.com/D274759
2025-12-09 22:22:14 +00:00
Sandor Molnar df1dba1932 Revert "Bug 1999100 - Don't clip overflow by default on replaced images. r=jwatt" for causing multiple failures
This reverts commit c95e29f358.
2025-12-08 15:46:13 +00:00
Emilio Cobos Álvarez c95e29f358 Bug 1999100 - Don't clip overflow by default on replaced images. r=jwatt
This implements overflow-clip-box: <visual-box>, and uses it to allow
overflow on replaced elements.

Differential Revision: https://phabricator.services.mozilla.com/D274759
2025-12-08 13:13:55 +00:00
Jonathan Kew 1267c6b0ea Bug 2003765 - Use C++20's 'default' to implement simple comparison operators in /layout/. r=layout-reviewers,firefox-style-system-reviewers,emilio
Just cleans up the code a bit; should not change any behavior.

Differential Revision: https://phabricator.services.mozilla.com/D274907
2025-12-04 01:25:04 +00:00
Ting-Yu Lin b5aa6faa00 Bug 2001781 - Return nullptr from GetAbsoluteContainingBlock() when a frame is not an absolute container. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D273941
2025-11-25 13:02:21 +00:00
Ting-Yu Lin 80e7aa39a2 Bug 1994083 - Generate display items for frames in absolute child list. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D272401
2025-11-24 20:48:15 +00:00
Ting-Yu Lin 1b8e2204f5 Bug 1994083 - Allow AbsoluteContainingBlock to reflow all abspos continuations. r=dholbert
This patch consists of several parts:

- Introduce `PushedAbsolute` frame list (i.e. `mPushedAbsoluteFrames`) in
  AbsoluteContainingBlock. This list is a temporary list used during reflow,
  to store abspos frames that need to be reflowed by the delegating frame's
  next-in-flow.

- For an absolute containing block frame, ensure its continuations also have
  absolute containing block.

- Ensure that the position of abspos continuation is correct by adjusting
  border, available block-size, etc. in
  `AbsoluteContainingBlock::ReflowAbsoluteFrame()`.

- Cache `layout.abspos.fragmentainer-aware-positioning.enabled` pref at the time
  when `nsPresContext` is initialized such that the pref value is stable across
  the lifetime of `nsPresContext`. This is to ensure the frame tree structure
  hygiene.

Differential Revision: https://phabricator.services.mozilla.com/D272400
2025-11-24 20:48:12 +00:00
Cristina Horotan 8317428fcd Revert "Bug 1994083 - Add WPTs for abspos fragmentation in vertical-rl writing-mode. r=dholbert" for causing Wr failures nsFrameList::ContinueRemoveFrame related
This reverts commit 0bb89a9e15.

Revert "Bug 1994083 - Adjust existing WPT expectations. r=dholbert"

This reverts commit a716c30e8f.

Revert "Bug 1994083 - Generate display items for frames in absolute child list. r=dholbert,layout-reviewers"

This reverts commit 1da35cc35d.

Revert "Bug 1994083 - Allow AbsoluteContainingBlock to reflow all abspos continuations. r=dholbert,layout-reviewers"

This reverts commit 643eec9921.
2025-11-23 05:31:49 +00:00
Ting-Yu Lin 1da35cc35d Bug 1994083 - Generate display items for frames in absolute child list. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D272401
2025-11-22 23:34:19 +00:00
Ting-Yu Lin 643eec9921 Bug 1994083 - Allow AbsoluteContainingBlock to reflow all abspos continuations. r=dholbert,layout-reviewers
This patch consists of several parts:

- Introduce `PushedAbsolute` frame list (i.e. `mPushedAbsoluteFrames`) in
  AbsoluteContainingBlock. This list is a temporary list used during reflow,
  to store abspos frames that need to be reflowed by the delegating frame's
  next-in-flow.

- For an absolute containing block frame, ensure its continuations also have
  absolute containing block.

- Ensure that the position of abspos continuation is correct by adjusting
  border, available block-size, etc. in
  `AbsoluteContainingBlock::ReflowAbsoluteFrame()`.

- The change in `nsPresContext` is to force reconstruct frame tree when flipping
  `layout.abspos.fragmentainer-aware-positioning.enabled` pref, to ensure frame
  tree structure hygiene.

Differential Revision: https://phabricator.services.mozilla.com/D272400
2025-11-22 23:34:15 +00:00
Ting-Yu Lin 00f9daab91 Bug 1999396 - Relax an assertion in nsBlockFrame::RemoveFloat(). r=layout-reviewers,emilio
`nsFloatingFirstLetterFrame` might lose its floating style after calling
`nsBlockFrame::UpdateFirstLetterStyle()`. I believe we have existing issues with
`::first-letter` and `::first-line` styling. It's probably related to bug 13610
or bug 548836.

Differential Revision: https://phabricator.services.mozilla.com/D272674
2025-11-15 05:57:13 +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 834918e43e Bug 1999366 - Use block frame's writing-mode to construct absolute containing block rect. r=layout-reviewers,dholbert
The motivation is:
1. The `parentWM` is misleading, because the parent frame can create
   `ReflowOutput` with this block frame's writing-mode, e.g. flex container did
   this [1].

2. If this block frame is fragmented, to get the correct cb rect, we'll have to
   apply the skip side for the border, which operates on this block's
   writing-mode. This will be done in bug 1994083.

3. This does not change behavior, because we only use physical `containingBlock`
   as the parameter to `AbsoluteContainingBlock::Reflow()`.

[1] https://searchfox.org/firefox-main/rev/931471037b8a4f16ce3ccfa864310540cac255c1/layout/generic/nsFlexContainerFrame.cpp#6431

Differential Revision: https://phabricator.services.mozilla.com/D272075
2025-11-11 18:05:26 +00:00
Ting-Yu Lin 315371a4b0 Bug 1998869 - Remove unused nsBlockFrame::kReflowCommandType. r=layout-reviewers,tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D271736
2025-11-10 21:29:33 +00:00
Ting-Yu Lin 2e9b491a3c Bug 1998869 - Improve noisy reflow log. r=layout-reviewers,dholbert
* At the beginning of `ReflowAbsoluteFrame()`, instead of printing the
  delegating frame's computed size, it now prints the original containing block
  rect, which is a more important information in abspos reflow.
* Use `MOZ_DEFINE_ENUM_TOSTRING_FUNC` to implement `LineReflowStatus` to string
  helper.
* Add an indent when printing `LineReflowStatus`.

Differential Revision: https://phabricator.services.mozilla.com/D271734
2025-11-10 21:29:29 +00:00
David Shin cfcfba76de Bug 1996832: Pass in border-offset padding rect for abspos cb computation. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio
This gets confusing because insets are computed against the padding rect, but
we store all frame rect information w.r.t. border rect - Add documentation to
make that fact more explicit.

Differential Revision: https://phabricator.services.mozilla.com/D271230
2025-11-07 17:59:21 +00:00
David Shin 9af10c3578 Bug 1997418: Simplify nsBlockFrame's abspos cb computation. r=layout-reviewers,emilio,TYLin
Most paths in the removed function returns the frame's padding
rect size. It doesn't seem that the single path that further
modifies the value is used.

This was added as Bug 282754, to account for scroll frames' behaviour
then.

Differential Revision: https://phabricator.services.mozilla.com/D270727
2025-11-01 00:37:52 +00:00
Ting-Yu Lin e7545a3c99 Bug 1997502 - Simplify two nsBlockFrame methods that remove frames. r=layout-reviewers,emilio
`DoRemoveFrame()` is used only to remove `Principal` and `NoReflowPrincipal`
child list, so this patch removes the dead code that handles removal of
out-of-flow frames and overflow containers.

Similarly, `DoRemoveOutOfFlowFrame()` is used only to remove float elements, so
rename it accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D270798
2025-10-31 10:55:48 +00:00
Ting-Yu Lin 35f00baf95 Bug 1996146 Part 2 - Rename FrameChildListID::Bullet to FrameChildListID::Marker. r=layout-reviewers,dshin
This is a follow-up of Bug 205202.

Differential Revision: https://phabricator.services.mozilla.com/D269900
2025-10-24 16:31:58 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00