Bug 265216

Summary: (REGRESSION: 267587@main) Text indent is incorrect when paragraph is affected by a floating element
Product: WebKit Reporter: Brad Andalman <bya>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, bw, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 14   
Attachments:
Description Flags
HTML that shows a too-large text-indent
none
HTML rendered using Safari Technology Preview 183, Chrome, and Firefox
none
HTML rendered in Safari 17.1 and STP 183
none
[fast-cq]Patch none

Description Brad Andalman 2023-11-21 13:56:23 PST
Created attachment 468716 [details]
HTML that shows a too-large text-indent

I’ve attached HTML that exhibits this issue. In it, you’ll see a green bar that begins 120 pixels from the left edge of the window. The paragraph above the green bar is affected by a floating element of 100px and has a text indent of 20px. Thus, we’d expect the text to start at the same position as the green bar. In the latest Safari Technology Preview (183) and in Sonoma 14.2b3, the text now starts some distance away from the start of the green bar.

This is similar enough to Bug #263698 that I wondered whether that fix also addresses this issue. Sadly, it does not.
Comment 1 Brad Andalman 2023-11-21 13:57:53 PST
Created attachment 468717 [details]
HTML rendered using Safari Technology Preview 183, Chrome, and Firefox
Comment 2 Brad Andalman 2023-11-21 14:03:31 PST
I tested in the WebKit nightly builds back to 268549@main (which is the oldest one I could find), and the bug still appears.
Comment 3 Brad Andalman 2023-11-21 14:37:23 PST
Created attachment 468719 [details]
HTML rendered in Safari 17.1 and STP 183

I wanted to make it extra clear that this bug is recent: Safari 17.1 works as expected, but Safari Technology Preview 183 is broken.
Comment 4 zalan 2023-11-21 18:15:49 PST
Thank you for filing this bug. It looks like we indent the inline content twice as much.
Comment 5 Radar WebKit Bug Importer 2023-11-21 18:16:20 PST
<rdar://problem/118701491>
Comment 6 zalan 2023-11-22 07:45:09 PST
Sadly regressed by a refactoring change (https://commits.webkit.org/267587@main)
Comment 7 zalan 2023-11-22 19:25:02 PST
Created attachment 468737 [details]
[fast-cq]Patch
Comment 8 EWS 2023-11-23 06:49:47 PST
Committed 271080@main (b741d4c7aa56): <https://commits.webkit.org/271080@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 468737 [details].
Comment 9 Brad West 2023-12-06 15:27:49 PST
Thank you for addressing this bug so quickly. Do you have an idea of when this will be available to users? We're testing the Sonoma 14.2 Release Candidate and still see this in Safari as well as in embedded uses (like Books).