Bug 315222

Summary: REGRESSION (Safari 18 -> 26): Outer inline element renders above nested inline-block containing a block-level image, causing layout shift and truncation
Product: WebKit Reporter: Jacob Goldman <jmgoldman>
Component: CSSAssignee: alan <zalan>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: koivisto, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 26   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=315324
Attachments:
Description Flags
Bug repro HTML file.
none
Screenshot (Safari -> Chrome -> Fix) none

Jacob Goldman
Reported 2026-05-20 12:50:17 PDT
Created attachment 479742 [details] Bug repro HTML file. There is a rendering regression between Safari v18 and Safari v26 involving the interaction of display: inline containers, nested display: inline-block elements, and deeply nested display: block elements. This affects certain display advertising creative that end up truncated due to the iframe overflow hidden constraints. In Safari v18, the outer display: inline <div> shares the same baseline/line-box with its nested inline-block <ins> and the block-level <img> it contains. In Safari v26, the outer inline <div> is suddenly allocated its own line box or block space above the nested content. Because the container has overflow: hidden and strict dimensions (e.g., simulating a cross-origin ad iframe), this newly added vertical space at the top pushes the 100px-tall <img> downwards, pushing it partially outside the truncation boundary. Attached is an illustration of the issue. Expected: blue line is drawn inline within the 320x100 img. Actual: blue line is drawn on-top of the img and pushes the content down, causing truncation.
Attachments
Bug repro HTML file. (1.51 KB, text/html)
2026-05-20 12:50 PDT, Jacob Goldman
no flags
Screenshot (Safari -> Chrome -> Fix) (354.54 KB, image/png)
2026-05-21 16:20 PDT, alan
no flags
Radar WebKit Bug Importer
Comment 1 2026-05-20 14:33:39 PDT
alan
Comment 2 2026-05-21 16:20:41 PDT
Created attachment 479765 [details] Screenshot (Safari -> Chrome -> Fix) I think this has already (partially) progressed on trunk and the missing piece is a baseline alignment bug (see bug 315324). After landing the baseline alignment fix, Safari will be matching Chrome's rendering (so we won't be matching Safari 18 anymore but it's progression).
alan
Comment 3 2026-05-22 18:15:41 PDT
The fix for bug 315324 got landed at 313769@main. WebKit matches Blink now -> I am marking this as config changed.
Note You need to log in before you can comment on or make changes to this bug.