Skip to content

Conversation

@servo-wpt-sync
Copy link
Collaborator

We now follow the same approach as Blink: sequences of block-levels in an inline formatting context get wrapped in an anonymous block, which is treated as a line item. Inline ancestors are no longer split.

This means that inline elements will now generate a single inline box, and the box tree makes more sense in general. This will help for incremental layout.

This also means that block-level elements will now be properly affected by effects like opacity of filters set on inline ancestors.

Recently, WebKit has done some similar work, but without the anonymous blocks. We might also consider removing them in the future.

Google's explainer: https://docs.google.com/document/d/15kgdIHhb9EVNup6Ir5NWwJxpzY5GH0ED7Ld3iMW3HlA/

Testing: Several tests are now passing
Fixes: #39813

Reviewed in servo/servo#41492

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.

@servo-wpt-sync servo-wpt-sync force-pushed the servo_export_41492 branch 3 times, most recently from a966134 to c54a035 Compare December 26, 2025 00:59
For an inline box that had already generated some fragment, we were
omitting additional fragments that would have had no content, padding,
border nor margin. This basically happened when the inline was split by
a block, e.g. `<span><div></div></span>`.

However, other browsers agree that JS APIs like `getClientRects()`
should include these empty fragments, so remove the optimization.

Signed-off-by: Oriol Brufau <[email protected]>
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.

3 participants