Skip to content

Fix phantom positive implicit track for auto-start/definite-end placements - #1169

Merged
nicoburns merged 3 commits into
mainfrom
devin/1787702803-fix-phantom-implicit-track
Aug 26, 2026
Merged

Fix phantom positive implicit track for auto-start/definite-end placements#1169
nicoburns merged 3 commits into
mainfrom
devin/1787702803-fix-phantom-implicit-track

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 26, 2026

Copy link
Copy Markdown
Member

Objective

Fix the last two failing subtests of the WPT tests css/css-grid/parsing/grid-template-{columns,rows}-computed-implicit-track.html in Servo: with grid-template-columns: none and a child at grid-column: auto / 1, the resolved value serialized as 10px 0px instead of 10px — a phantom zero-sized positive implicit track leaked into DetailedGridTracksInfo.

Context

The bug is in the implicit grid size estimate, not serialization. In child_min_line_max_line_span, the (Auto, Line(track)) case computed min = track, ignoring that an auto-start/definite-end placement resolves to a span of 1 ending at that line (occupying [track - 1, track]):

// End track specified
- (Auto, Line(track)) => track,
+ (Auto, Line(track)) => track - 1,

(The symmetric (Line(track), Auto) max case already correctly used track + 1.)

With min under-counted, the estimate reported 0 negative implicit tracks, and the "adjust positive track estimate to fit the max span" step then compensated by adding a spurious positive implicit track. The negative track was later added correctly during placement via expand_to_fit_range, leaving one real track plus a phantom 0px track at the end (negative_implicit=1, explicit=0, positive_implicit=1). The wrong estimate also caused the auto-placement cursor to spuriously advance in the secondary axis (via the primary_span.start < primary_idx check), creating an extra implicit row as well.

Both WPT subtests are ported as gentest fixtures (grid_template_serialization_negative_implicit_{column,row}.html) — the generated expectations from Chrome assert resolved-columns="10px"/resolved-rows="10px", matching the WPT expectations exactly.

Verified: cargo test --workspace --all-features passes, cargo fmt / cargo clippy clean (one pre-existing MSRV warning unrelated to this change).

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/4946c92d12ba4edc933f5a8888f5584f
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/4946c92d12ba4edc933f5a8888f5584f?variant=devin-insiders
Requested by: @nicoburns

@staging-devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nicoburns
nicoburns merged commit b3b3871 into main Aug 26, 2026
28 checks passed
@nicoburns
nicoburns deleted the devin/1787702803-fix-phantom-implicit-track branch August 26, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant