It does not make much sense to break line after a list marker, the behaviour does not match other browsers either.
Created attachment 4284 [details] test case
Created attachment 4285 [details] patch this fixes the problem for list markers only, however there might be a need for more generic fix based on this comment in the code: // FIXME: This does not match WinIE, Opera, and Mozilla. They treat replaced elements // like characters in a word, and require spaces between the replaced elements in order // to break.
Comment on attachment 4285 [details] patch r=me
Comment on attachment 4285 [details] patch I'm minusing this, since I think the code needs better commenting, and because as you discovered, this problem is not unique to list markers. I'd rather see this fixed for replaced elements and list markers together than to just have some special-case code introduced for list markers.
I think this may need a consult from Hixie actually. When considering ordered lists, there is an actual space generated between the "1." and the rest of the text, so it seems logical to me that this would provide a breaking opportunity. However, as you pointed out, it looks ugly. Hixie, what do you think?
If we do decide that "1. " should not break despite having a space, then it probably is ok to special-case list markers. :)
Comment on attachment 4285 [details] patch Bah, let's just land it and if it turns out to be wrong we can fix it later. :)
I don't think it matters whether the list marker has space in it or not. It is treated as a replaced element so the space there is not a factor at all. Anyway, the patch only changes behaviour for forced line breaks, if the algorithm finds a normal break point then that is handled as before.
If it's list-style-position: inside then it's just an inline element on the line and it should obey 'white-space' (the space is in the ::marker, and the property inherits from the display:list-item element). If it's list-style-position: outside then it should not wrap, it should be on the first line box, before the start of that line box, and thus should not be affected by wrapping or anything (and it's an inline-block, so white-space would only affect within the ::marker box anyway). HTH.
Comment on attachment 4285 [details] patch Ok, so sounds like only outside list markers should ignore white-space rules, from what you're saying, so that's how we should refine this. Minusing for a new patch that checks listStylePosition
Created attachment 4317 [details] updated test case
Created attachment 4318 [details] updated patch Allow breaks after marker for list-style-position:inside. This should give the right behaviour. Markers are pretty much a hack, real (CSS3) markers would require some work.
Comment on attachment 4318 [details] updated patch r=me
I committed the fix for this bug.