159 Commits
Author SHA1 Message Date
Jonathan Kew a4aeccb1d3 Bug 2044844 - Don't call UpdateOverflow for frames that don't track it anyhow. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D304737
2026-06-04 14:10:52 +00:00
Ting-Yu Lin 96719fbe59 Bug 2041516 Part 2 - Remove local reflowStatus in AbsoluteContainingBlock::Reflow(). r=layout-reviewers,emilio
With the previous part, the output-param `aReflowStatus` is fresh, so we can
accumulate kid's reflow status to it directly. This matches the existing pattern
in `nsCanvasFrame::Reflow()`, `nsFlexContainerFrame::Reflow()`, etc.

Differential Revision: https://phabricator.services.mozilla.com/D302430
2026-05-26 19:07:12 +00:00
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 34834f4591 Bug 2033342 - Remove layout.abspos.fragmentainer-aware-positioning.enabled preference. r=layout-reviewers,dshin
The pref was enabled by default in bug 2002115 and shipped in Firefox 151. Since
it has been two releases, we can remove it to simplify the code path.

Differential Revision: https://phabricator.services.mozilla.com/D302349
2026-05-25 18:30:20 +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
David Shin 626c3c4620 Bug 1878994: Scoped lookup for @position-try rules. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D299242
2026-05-12 14:05:40 +00:00
Emilio Cobos Álvarez 7f29b8ded8 Bug 1878994 - Use TreeScoped for PositionTryFallbacks. r=dshin,firefox-style-system-reviewers,layout-reviewers
This will allow to implement tree-scoped lookups.

Differential Revision: https://phabricator.services.mozilla.com/D299382
2026-05-12 14:05:36 +00:00
Hiroyuki Ikezoe 8851ed32ff Bug 1950303 - Apply contain:layout overflow handling to absolutely positioned children in AbsoluteContainingBlock::ReflowAbsoluteFrame. r=layout-reviewers,emilio
When a containing block has `contain: layout`, scrollable overflow from its
children should not propagate to the parent. nsContainerFrame::ConsiderChildOverflow
already implements this by only unioning the child's ink overflow, but
AbsoluteContainingBlock::ReflowAbsoluteFrame took a separate code path that
unconditionally unioned the child's full overflow areas. As a result, a wide
absolutely positioned descendant of a `contain: layout` element could still
inflate the page's scrollable area (and the mobile viewport).

Extend OverflowAreaUnionFlags with ChildIsAbsPos so that ConsiderChildOverflow
performs OverflowAreas::UnionWithAbsoluteOverflowAreas (matching the prior
abspos behavior), and route ReflowAbsoluteFrame through ConsiderChildOverflow.
The contain:layout handling is then shared between in-flow and absolutely
positioned children.

Differential Revision: https://phabricator.services.mozilla.com/D299911
2026-05-12 04:18:08 +00:00
Emilio Cobos Álvarez c549b667cd Bug 1897279 - Record last successful fallback at ResizeObserver time. r=dshin,layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D297685
2026-04-30 21:33:41 +00:00
Emilio Cobos Álvarez cbd055339f Bug 2031110 - Remove -moz-scrolled-canvas and make viewport styles non-inheriting. r=jwatt
They never inherit anything (except background, but that is a no-op
because viewport inherits from nullptr, which is the initial style).

It seems in the past we relied on recomputing some of this for direction
propagation or so, according to the comments, but that's definitely no
longer true.

Also the comment about needing overflow: auto is wrong, because we've
since always created scrollbars for the root (and avoided reframes).

Similarly, the assertion about viewport is kinda unnecessary. It was
introduced in:

  https://hg.mozilla.org/mozilla-central/rev/8fd06045940a05d56d833a0488262fe2279d3702

But since then we always skip fixup for all anon boxes anyways, and
specify display: block explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D293710
2026-04-13 20:27:47 +00:00
agoloman ea033e9232 Revert "Bug 2031110 - Remove -moz-scrolled-canvas and make viewport styles non-inheriting. r=jwatt" for causing multiple failures.
This reverts commit e3869b3af5.
2026-04-13 16:47:39 +00:00
Emilio Cobos Álvarez e3869b3af5 Bug 2031110 - Remove -moz-scrolled-canvas and make viewport styles non-inheriting. r=jwatt
They never inherit anything (except background, but that is a no-op
because viewport inherits from nullptr, which is the initial style).

It seems in the past we relied on recomputing some of this for direction
propagation or so, according to the comments, but that's definitely no
longer true.

Also the comment about needing overflow: auto is wrong, because we've
since always created scrollbars for the root (and avoided reframes).

Differential Revision: https://phabricator.services.mozilla.com/D293710
2026-04-13 15:44:33 +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
Ting-Yu Lin 5e979f276d Bug 2021187 Part 2 - Ensure abspos frame continuations are in the correct order. r=layout-reviewers,emilio
Both the main child list and the pushed child list may contain continuations
of an abspos element. Therefore, when moving abspos continuations from the main
child list to the pushed child list, we must preserve the order of the
continuation chain.

This patch adds debug-only logic to check the continuation order. The crashtest
in Part 1 would trigger the newly added assertion if the other fixes in this
patch were not applied.

Differential Revision: https://phabricator.services.mozilla.com/D291043
2026-03-31 03:25:40 +00:00
Ting-Yu Lin 46718d1219 Bug 2021187 Part 1 - Allow abspos frames and their continuations in the pushed child list. r=layout-reviewers,emilio
It is valid for multiple continuations of the same element to be in the pushed
child list, since they are not reflowed there and are intended to be pulled by
subsequent absCB continuations. This patch relaxes the check.

Differential Revision: https://phabricator.services.mozilla.com/D291042
2026-03-31 03:25:38 +00:00
David Shin 3688b06084 Bug 2025540: Don't add overflow for abspos if its area is zero. r=layout-reviewers,emilio
Prior to Bug 1800907, abspos overflow contribution used `UnionWith`,
which ignored empty (i.e. width or height is zero) overflows. Post
Bug 1800907, the constraint was tightened so that both width and
height must be zero for any overflow to be ignored.

Differential Revision: https://phabricator.services.mozilla.com/D290147
2026-03-30 19:34:18 +00:00
Tiaan Louw fddf19e660 Bug 2027689 - Fix anchor() functions without position-anchor r=layout-reviewers,dshin
When an absolutely positioned element in a grid uses anchor() in itsets
without position-anchor, the grid container rect is used instead of the
grid-area.

Differential Revision: https://phabricator.services.mozilla.com/D290840
2026-03-30 16:28:33 +00:00
Emilio Cobos Álvarez 11be491237 Bug 2024942 - Reduce more includes of ServoStyleConsts. r=sergesanspaille
Use nsTArray + span for SendAsyncMessage since it allows for incomplete
types (std::vector on libc++ doesn't).

Differential Revision: https://phabricator.services.mozilla.com/D288906
2026-03-21 07:07:21 +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
Ting-Yu Lin 8c43740b57 Bug 2009643 - Remove an obsolete comment in AbsoluteContainingBlock::Reflow(). r=layout-reviewers,dshin DONTBUILD
See bug 2009643 comment 1 for the rationale for removing this comment.

Differential Revision: https://phabricator.services.mozilla.com/D284889
2026-02-25 21:03:07 +00:00
Ting-Yu Lin 19124a708f Bug 2009647 Part 2 - Add measuring reflow in printing scenarios for fragmentainer-aware abspos positioning. r=layout-reviewers,dshin
This extends the measuring reflow mechanism from multicol (Bug 1994346) to
printing scenarios. When absolutely positioned elements exist, we now perform
an initial measuring reflow with an unconstrained page height to compute
unfragmented positions, sizes, etc.

Each frame type (nsPageSequenceFrame, nsPageFrame, PrintedSheetFrame,
nsPageContentFrame) has their own logic to calculate the available size for its
child, and they do not derive the size from their own reflow input's available
size. To avoid substantial refactoring, this patch checks
`mIsInFragmentainerMeasuringReflow` and overrides the available block-size to
unconstrained when running a measuring reflow.

Differential Revision: https://phabricator.services.mozilla.com/D284550
2026-02-25 05:20:37 +00:00
Ting-Yu Lin 04b46f1dcc Bug 2009647 Part 1 - Rename mIsInColumnMeasuringReflow to mIsInFragmentainerMeasuringReflow. r=layout-reviewers,dshin
This renames the measuring reflow flag to use "fragmentainer" terminology,
making it applicable to both multicol and printing contexts. This doesn't change
behavior.

Differential Revision: https://phabricator.services.mozilla.com/D284549
2026-02-25 05:20:34 +00:00
Ting-Yu Lin ac2258bf79 Bug 2016959 - Allow abspos element with auto block-size to have fragmentation-imposed block-size growth. r=dshin,layout-reviewers
This patch also prevents WPT `/css/css-page/page-margin-004-print.html` from
failing when adding a measuring reflow to printing context.

Differential Revision: https://phabricator.services.mozilla.com/D284548
2026-02-24 17:54:31 +00:00
David Shin fc8e11ac72 Bug 2011777: Compute anchor-center taking the modified CB offset and scroll shift into account. r=layout-reviewers,TYLin
Differential Revision: https://phabricator.services.mozilla.com/D282638
2026-02-18 19:53:30 +00:00
Ting-Yu Lin 59e1a1c30c Bug 2009645 - Allow zero-height positioned element placed at the end of a fragmentainer. r=dholbert,layout-reviewers
In this patch, we allow a positioned element to reflow under zero available
block-size if its position is exactly at the block-end edge of the current
fragmentainer.

This prevents `block-end-aligned-abspos-nested.html` from failing by allowing
the outer zero-height `position:absolute` element to be placed at the block-end
edge of the first column.

Differential Revision: https://phabricator.services.mozilla.com/D283466
2026-02-16 10:46:45 +00:00
Ting-Yu Lin 70d9f4614f Bug 2013423 - Don't run SanityCheckChildListsBeforeReflow() when layout.abspos.fragmentainer-aware-positioning.enabled=false. r=layout-reviewers,emilio
When the pref is off, this sanity check is not needed, because it is only
meaningful when the pref is enabled. Skipping it also prevents the testcase from
triggering assertions in this helper.

The next patch will address the issue when the pref is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D282941
2026-02-12 20:44:18 +00:00
Emilio Cobos Álvarez 6f65f203f8 Bug 2015898 - Remove ChildListID::Fixed. r=dshin,TYLin,layout-reviewers
We already rely on one frame having at most one
absolute list, so there's no point in this distinction.

In the future, with position-visibility, we might want
to make fixed and abspos containing block effectively the same.

But one step at a time.

Differential Revision: https://phabricator.services.mozilla.com/D282681
2026-02-11 01:08:27 +00:00
David Shin 90d949ce75 Bug 1991489: During fragmentation of abspos frames, reuse anchor pos references populated during unfragmented reflow. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio,TYLin
This will cause an issue for evaluating fallbacks changing default anchors, but
that is something we can easily detect and handle down the line.

Differential Revision: https://phabricator.services.mozilla.com/D281718
2026-02-09 22:46:34 +00:00
agoloman 42a2833d9a Revert "Bug 1991489: Flip fragmentainer-aware positioning on for anchor-positioning WPTs that pass. r=layout-anchor-positioning-reviewers,emilio,TYLin" for causing ba failures @browser_anchor_positioning.js.
This reverts commit 962e149e3e.

Revert "Bug 1991489: Ensure that when checking for anchor visibility, the intersection root rect takes union of all of its in-flow rects. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"

This reverts commit 481e451d10.

Revert "Bug 1991489: Ensure that fragmented anchors are combined when checking for overflow. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio,TYLin"

This reverts commit d0f5ec1114.

Revert "Bug 1991489: During fragmentation of abspos frames, reuse anchor pos references populated during unfragmented reflow. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio,TYLin"

This reverts commit 4e522e9695.

Revert "Bug 1991489: nsIFrame::ComputeSize uses anchor resolution cache. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"

This reverts commit 4ec2727999.
2026-02-09 19:20:27 +00:00
David Shin 4e522e9695 Bug 1991489: During fragmentation of abspos frames, reuse anchor pos references populated during unfragmented reflow. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio,TYLin
This will cause an issue for evaluating fallbacks changing default anchors, but
that is something we can easily detect and handle down the line.

Differential Revision: https://phabricator.services.mozilla.com/D281718
2026-02-09 18:15:40 +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 18520f8286 Bug 2014221 - Use StyleSize::FromAppUnits() to simplify code in layout/. r=layout-reviewers,firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D281640
2026-02-04 19:36:36 +00:00
David Shin 4ac7af6481 Bug 2013408: Track size of unfragmented abspos frames for auto size resolution. r=TYLin,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D281243
2026-02-02 06:07:36 +00:00
David Shin 1009ef83bd Bug 2012842: Store unfragmented rects of abspos containing block during measuring reflow. r=TYLin,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D280843
2026-01-30 22:27:16 +00:00
Ting-Yu Lin ec3d2fe6b4 Bug 1994346 - Push abspos first-in-flow to next absCB continuation if it doesn't fit. r=layout-reviewers,dholbert,dshin
This patch implements the fragmentainer-aware positioning for abspos elements in
multicol. High-level changes include:

- Store abspos element's unfragmented position in
  `nsIFrame::UnfragmentedPositionProperty`.
- Add a measuring reflow phase in `nsColumnSetFrame` to compute abspos element's
  unfragmented position.
- Track cumulative containing block size across fragmentainer continuations.
- Adjust positioning logic with UnfragmentedPositionProperty().

A similar support for printing scenario is tracked in Bug 2009647.

Differential Revision: https://phabricator.services.mozilla.com/D276582
2026-01-23 04:18:11 +00:00
Sandor Molnar 09ea4ac109 Revert "Bug 1994346 - Add addition WPT for abspos fragmentation. r=dholbert" for causing WR failures
This reverts commit 2cead8c0d6.

Revert "Bug 1994346 - Adjust existing test expectations. r=layout-reviewers,dshin,dholbert"

This reverts commit 527178ed44.

Revert "Bug 1994346 - Push abspos first-in-flow to next absCB continuation if it doesn't fit. r=layout-reviewers,dholbert,dshin"

This reverts commit 8ccca3d28a.
2026-01-22 17:48:35 +00:00
Ting-Yu Lin 8ccca3d28a Bug 1994346 - Push abspos first-in-flow to next absCB continuation if it doesn't fit. r=layout-reviewers,dholbert,dshin
This patch implements the fragmentainer-aware positioning for abspos elements in
multicol. High-level changes include:

- Store abspos element's unfragmented position in
  `nsIFrame::UnfragmentedPositionProperty`.
- Add a measuring reflow phase in `nsColumnSetFrame` to compute abspos element's
  unfragmented position.
- Track cumulative containing block size across fragmentainer continuations.
- Adjust positioning logic with UnfragmentedPositionProperty().

A similar support for printing scenario is tracked in Bug 2009647.

Differential Revision: https://phabricator.services.mozilla.com/D276582
2026-01-22 13:58:15 +00:00
Jari Jalkanen 2136bb1d67 Bug 2006964: Use tree-scoped anchor names in Gecko code. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,dshin
Differential Revision: https://phabricator.services.mozilla.com/D278925
2026-01-22 11:47:05 +00:00
Jari Jalkanen c7fc0f51be Bug 2006964: Augment AnchorFunctions with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D278924
2026-01-22 11:47:02 +00:00
agoloman f194e440fb Revert "Bug 2006964: Fix test for :host pseudo elements. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,dshin" for causing wpt failures @anchor-scope.html.
This reverts commit 03c0249d4e.

Revert "Bug 2006964: Fix test for :host anchor scopes. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"

This reverts commit 8f2b951776.

Revert "Bug 2006964: Augment AnchorScopes with tree scopes. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,dshin"

This reverts commit 001b1a4c23.

Revert "Bug 2006964: Introduce logic to match tree-scoped references and names of anchors. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"

This reverts commit 40d8475186.

Revert "Bug 2006964: Switch ResolutionMap to use scoped atom as hash key. r=layout-anchor-positioning-reviewers,layout-reviewers,emilio"

This reverts commit 8ccd0275d0.

Revert "Bug 2006964: Use tree-scoped anchor names in Gecko code. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,dshin"

This reverts commit 6c2e9d558b.

Revert "Bug 2006964: Augment AnchorFunctions with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio"

This reverts commit db32e12aa8.

Revert "Bug 2006964: Augment PositionAnchors with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio"

This reverts commit b57c7e63b2.

Revert "Bug 2006964: Augment AnchorNames with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio,dshin"

This reverts commit 13144de3e9.

Revert "Bug 2006964: Add default factory method to generated StyleCascadeLevel. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit e5d2a17140.

Revert "Bug 2006964: Add TreeScoped type to attach CascadeLevel to AnchorNames. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,emilio"

This reverts commit 71138d7866.
2026-01-21 18:51:25 +00:00
Jari Jalkanen 6c2e9d558b Bug 2006964: Use tree-scoped anchor names in Gecko code. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio,dshin
Differential Revision: https://phabricator.services.mozilla.com/D278925
2026-01-21 15:41:47 +00:00
Jari Jalkanen db32e12aa8 Bug 2006964: Augment AnchorFunctions with tree scope. r=layout-anchor-positioning-reviewers,firefox-style-system-reviewers,layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D278924
2026-01-21 15:41:44 +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
David Shin ef26d7876b Bug 2009729: Ensure that we resolve fallback style with original style. r=emilio,firefox-style-system-reviewers,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D278855
2026-01-15 22:52:24 +00:00
David ShinandEmilio Cobos Álvarez d6a72910a4 Bug 2009225: Only contribute scroll-shifted overflow of anchor positioned elements. r=emilio,layout-anchor-positioning-reviewers,layout-reviewers
Previously contributed an additional overflow with normal position, which was
the positioned element's overflow when all scrollers are at their initial
positions.

Use `OverflowChangedTracker` to properly propagate overflow changes up the
ancestor chain.

Without anchor recalculation points, this change causes the scroller to
fluctuate as the positioned element moves around.

Adjust `position-visibility-no-overflow-scroll-002.html` - In this case,
due to the double rAF, positioned elements are evaluated with the scrollers
at its initial position. However, in this configuration, the computed position
area grid for `#target1` does not leave enough space to fit the element, so it
shifts up into fit within the containing block [1]. However, the test's
reference does not seem to expect this shifting behaviour. Prior to this patch,
Gecko would contribute the unscrolled overflow's space to expand the position
area grid, which made us pass this test (But this behaviour is not in spec).

So, change the test to force the computation of position-area grid to be after
scrolling, which still should preserve the purpose of the test. `anchor()`
functions could be used instead, but that's covered by
position-visibility-no-overflow-scroll.html.

[1]: https://drafts.csswg.org/css-anchor-position-1/#position-area-alignment

Co-authored-by: Emilio Cobos Álvarez <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D278989
2026-01-15 18:57:47 +00:00
Emilio Cobos Álvarez a700273d6b Bug 2009424 - Make containing block adjustment work for default anchored frames. r=layout-anchor-positioning-reviewers,layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D278497
2026-01-13 21:27:50 +00:00
Cristina Horotan a038c8d2a8 Revert "Bug 2009424 - Make containing block adjustment work for default anchored frames. r=layout-anchor-positioning-reviewers,layout-reviewers,dshin" for causing wpt failures on anchor-scroll-position-try-006.html
This reverts commit d8bd94aa64.
2026-01-09 17:14:56 +00:00
Emilio Cobos Álvarez d8bd94aa64 Bug 2009424 - Make containing block adjustment work for default anchored frames. r=layout-anchor-positioning-reviewers,layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D278497
2026-01-09 16:02:35 +00:00