RESOLVED FIXED 266801
REGRESSION(264248@main): A floating element can cause a list item’s bullet to be orphaned on overconstrained lines
https://bugs.webkit.org/show_bug.cgi?id=266801
Summary REGRESSION(264248@main): A floating element can cause a list item’s bullet to...
Brad Andalman
Reported 2023-12-21 18:10:39 PST
Created attachment 469167 [details] HTML showing a bullet orphaned from its list item on Sonoma In the attached HTML, I have a floating div followed by a single, bulleted list item. When rendered in Safari on Sonoma 14.2.1, the bullet appears within the floating element, and is orphaned from its list item. The same (incorrect) behavior appears in 14.3b1 as well as the latest Safari Technology Preview. I’ve attached a screenshot of the correct behavior in Chrome and Firefox, and Safari on Ventura renders this case correctly as well.
Attachments
HTML showing a bullet orphaned from its list item on Sonoma (271 bytes, text/html)
2023-12-21 18:10 PST, Brad Andalman
no flags
Screenshot showing incorrect behavior in Safari (correct in Chrome and Firefox) (196.23 KB, image/png)
2023-12-21 18:11 PST, Brad Andalman
no flags
Patch (6.79 KB, patch)
2023-12-22 06:38 PST, alan
no flags
Patch (6.92 KB, patch)
2023-12-22 07:40 PST, alan
no flags
[fast-cq]Patch (6.92 KB, patch)
2023-12-22 07:42 PST, alan
no flags
Brad Andalman
Comment 1 2023-12-21 18:11:37 PST
Created attachment 469168 [details] Screenshot showing incorrect behavior in Safari (correct in Chrome and Firefox)
Radar WebKit Bug Importer
Comment 2 2023-12-21 18:40:58 PST
alan
Comment 3 2023-12-21 18:41:36 PST
Thank you Brad! Looking into this...
Brad Andalman
Comment 4 2023-12-21 18:47:07 PST
Thanks, Alan! Also, I wanted to clarify something I wrote in my initial description. I mentioned that “Safari on Ventura renders this case correctly.” That’s true, because I’m running Safari 16.6 on my Ventura install. However, Safari 17.2.1 on Ventura will also exhibit the bug.
alan
Comment 5 2023-12-21 18:51:44 PST
(In reply to Brad Andalman from comment #4) > Thanks, Alan! > > Also, I wanted to clarify something I wrote in my initial description. I > mentioned that “Safari on Ventura renders this case correctly.” That’s true, > because I’m running Safari 16.6 on my Ventura install. However, Safari > 17.2.1 on Ventura will also exhibit the bug. Make sense (btw, great bug reports with awesome test reductions!)
alan
Comment 6 2023-12-21 19:17:33 PST
alan
Comment 7 2023-12-21 19:29:17 PST
This seems to be happening on overconstrained lines where the list marker gets disconnected from the list item.
alan
Comment 8 2023-12-21 19:39:19 PST
from 264248@main: "Both Chrome and Firefox consider the position _after_ the list marker as a soft wrap opportunity..." previously there was no line breaking opportunity between list markers and the associated list items (no chance of separating them). I guess the negative start margin on the list marker makes it fit even on an overconstrained line.
alan
Comment 9 2023-12-21 20:20:29 PST
interestingly this works: <div style="width: 100px;"> <div style="float: left; width: 100px; height: 10px;"></div> <li>foobar</li> </div> while embedding <li> inside a <ul> triggers the bug <div style="width: 100px;"> <div style="float: left; width: 100px; height: 10px;"></div> <ul> <li>foobar</li> <ul> </div>
alan
Comment 10 2023-12-21 20:56:52 PST
(In reply to zalan from comment #9) > interestingly this works: > > <div style="width: 100px;"> > <div style="float: left; width: 100px; height: 10px;"></div> > <li>foobar</li> > </div> > > while embedding <li> inside a <ul> triggers the bug > > <div style="width: 100px;"> > <div style="float: left; width: 100px; height: 10px;"></div> > <ul> > <li>foobar</li> > <ul> > </div> yeah, so this is indeed about the negative horizontal margin on the list marker (8px wide content box and a -20px margin start produce a 0px wide box). This negative margin essentially makes the list marker a non-space-taking item. It'll fit any line including overconstrained ones. When the <li> is by itself, we don't put such margins on the list marker (there's no need to pull it in to the parent <ul>'s space) <div style="outline: 1px solid red"><ul style="outline: 5px solid green"><li style="outline: 10px solid blue">list item vs. <div style="outline: 1px solid red"><li style="outline: 10px solid blue">list item (notice how the list marker is pull into the <ul>)
alan
Comment 11 2023-12-22 06:38:31 PST
alan
Comment 12 2023-12-22 06:44:44 PST
This may need some rebaselining. will see.
alan
Comment 13 2023-12-22 07:26:55 PST
(In reply to zalan from comment #12) > This may need some rebaselining. will see. yup, these 2 tests need new expectations fast/lists/li-br.html fast/replaced/ul-li-word-break-break-word.html
alan
Comment 14 2023-12-22 07:40:52 PST
alan
Comment 15 2023-12-22 07:41:19 PST
(In reply to zalan from comment #13) > (In reply to zalan from comment #12) > > This may need some rebaselining. will see. > yup, these 2 tests need new expectations > > fast/lists/li-br.html > fast/replaced/ul-li-word-break-break-word.html or just quirk it more. :/
alan
Comment 16 2023-12-22 07:42:25 PST
Created attachment 469173 [details] [fast-cq]Patch
EWS
Comment 17 2023-12-22 08:53:34 PST
Committed 272451@main (ba97ecf43187): <https://commits.webkit.org/272451@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 469173 [details].
Brad Andalman
Comment 18 2023-12-22 11:10:55 PST
Thanks so much for jumping on this fix!!
alan
Comment 19 2023-12-22 12:59:58 PST
(In reply to Brad Andalman from comment #18) > Thanks so much for jumping on this fix!! Thank you for filing it! Now we have a regression test on overconstrained lines with list items!
Note You need to log in before you can comment on or make changes to this bug.