layout: Stop splitting inline boxes when they contain block-levels #56903
+37
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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