Skip to content

layout: Make lines non-phantom if they have inline padding/border/margin - #54833

Merged
servo-wpt-sync merged 1 commit into
web-platform-tests:masterfrom
servo:servo_export_39058
Sep 16, 2025
Merged

servo-wpt-sync merged 1 commit into
web-platform-tests:masterfrom
servo:servo_export_39058

Conversation

@servo-wpt-sync

@servo-wpt-sync servo-wpt-sync commented Sep 14, 2025 •

Copy link
Copy Markdown
Collaborator

According to https://drafts.csswg.org/css-inline/#invisible-line-boxes, if a line box contains non-zero inline-axis margins, padding or borders, then it can't be phantom.

Therefore, this patch makes adds a has_inline_pbm flag to the line. Note that we can't use the has_content flag, because that would add a soft wrap opportunity between the padding/border/margin and the first content of the line.

The patch also renames InlineFormattingContext::had_inflow_content to has_line_boxes, which is what we care about for collapsing margins through.

Testing: Adding new tests
Fixes: #39057
Reviewed in servo/servo#39058

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

Copy link
Copy Markdown
Collaborator

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_39058 branch 2 times, most recently from 12482d4 to 88c1de7 Compare September 14, 2025 08:56
According to https://drafts.csswg.org/css-inline/#invisible-line-boxes,
if a line box contains non-zero inline-axis margins, padding or borders,
then it can't be phantom.

Therefore, this patch makes adds a `has_inline_pbm` flag to the line.
Note that we can't use the `has_content` flag, because that would add
a soft wrap wrap opportunity between the padding/border/margin and the
first content of the line.

The patch also renames `InlineFormattingContext::had_inflow_content` to
`has_line_boxes`, which is what we care about for collapsing margins
through.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
@servo-wpt-sync
servo-wpt-sync merged commit bc09e43 into web-platform-tests:master Sep 16, 2025
18 checks passed
@servo-wpt-sync
servo-wpt-sync deleted the servo_export_39058 branch September 16, 2025 22:50
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