Skip to content

Conversation

@servo-wpt-sync
Copy link
Collaborator

TextRuns use their parent style to render. Previously, these styles
were cloned and stored directly in the box tree TextRun and resulting
TextFragments. This presents a problem for incremental layout.
Wrapping the style in another layer of shared ownership and mutability
will allow updating all TextFragments during repaint-only incremental
layout by simply updating the box tree styles of the original text
parents.

This adds a new set of borrows when accessing text styles, but also
makes it so that during box tree block construction
InlineFormattingContexts are created lazily and now
InlineFormattingContextBuilder::finish consumes the builder, making
the API make a bit more sense. This should also improve performance of
box tree block construction slightly.

Testing: This should not change observable behavior and thus is covered
by existing WPT tests.

Reviewed in servo/servo#36896

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Servo project.

`TextRun`s use their parent style to render. Previously, these styles
were cloned and stored directly in the box tree `TextRun` and resulting
`TextFragment`s. This presents a problem for incremental layout.
Wrapping the style in another layer of shared ownership and mutability
will allow updating all `TextFragment`s during repaint-only incremental
layout by simply updating the box tree styles of the original text
parents.

This adds a new set of borrows when accessing text styles, but also
makes it so that during box tree block construction
`InlineFormattingContext`s are created lazily and now
`InlineFormattingContextBuilder::finish` consumes the builder, making
the API make a bit more sense. This should also improve performance of
box tree block construction slightly.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
@servo-wpt-sync servo-wpt-sync merged commit 5ddceef into web-platform-tests:master May 12, 2025
19 checks passed
@servo-wpt-sync servo-wpt-sync deleted the servo_export_36896 branch May 12, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants