Skip to content

Conversation

@Loirooriol
Copy link
Contributor

LayoutBox::clear_fragment_layout_cache() was just redirecting to the clear_fragment_layout_cache() method of inner structures, until reaching LayoutBoxBase where the work is actually done.

So this patch gets the LayoutBoxBase first, and then calls the method on it. To do so, LayoutBox::with_base_fold() is added as a non-mutable version of the existing LayoutBox::with_base_mut_fold(). But since we the return value doesn't matter, LayoutBox::with_each_base() is also added as a tiny helper around LayoutBox::with_base_fold().

Testing: Not needed, no behavior change

`LayoutBox::clear_fragment_layout_cache()` was just redirecting to the
`clear_fragment_layout_cache()` method of inner structures, until
reaching `LayoutBoxBase` where the work is actually done.

So this patch gets the `LayoutBoxBase` first, and then calls the method
on it. To do so, `LayoutBox::with_base_fold()` is added as a non-mutable
version of the existing `LayoutBox::with_base_mut_fold()`. But since
we the return value doesn't matter, `LayoutBox::with_each_base()` is
also added as a tiny helper around `LayoutBox::with_base_fold()`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
@Loirooriol Loirooriol requested a review from nicoburns as a code owner October 21, 2025 00:10
@Loirooriol Loirooriol added the A-layout/2020 https://github.com/servo/servo/wiki/Layout-2020 label Oct 21, 2025
@Loirooriol Loirooriol requested a review from mrobinson as a code owner October 21, 2025 00:10
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 21, 2025
Copy link
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Oct 25, 2025
@Loirooriol Loirooriol added this pull request to the merge queue Oct 25, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 25, 2025
Merged via the queue into servo:main with commit 7e39dfd Oct 25, 2025
36 checks passed
@Loirooriol Loirooriol deleted the cleanup-clear_fragment_layout_cache branch October 25, 2025 16:28
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-layout/2020 https://github.com/servo/servo/wiki/Layout-2020

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants