Bug 329793

Summary: [layout box merge] Remove the anonymous inline wrappers around display: contents text
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/64668

Antti Koivisto
Reported 2026-11-02 04:37:44 PST
Text whose DOM parent is display: contents is wrapped in an anonymous inline box so it can have the style it inherits from that element. Text renderers now own their style, so the wrappers can go. The wrappers also affect line layout: the line-height of the display: contents element applies to its text and its font stretches the line for any line-height. Firefox (and css-inline-3) uses the line-height of the parent box instead, and the text's font stretches the line only when that line-height is normal. Chrome has the same wrappers as WebKit. Removing the wrappers switches WebKit to the Firefox behavior.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-11-02 04:37:54 PST
Antti Koivisto
Comment 2 2026-11-02 04:39:11 PST
EWS
Comment 3 2026-11-02 23:53:50 PST
Committed 325558@main (8ee260e9aa16): <https://commits.webkit.org/325558@main> Reviewed commits have been landed. Closing PR #79289 and removing active labels.
Antti Koivisto
Comment 4 2026-11-03 08:56:04 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/64668
Note You need to log in before you can comment on or make changes to this bug.