Bug 5318

Summary: forced line break should not be allowed after a list marker
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Severity: Normal CC: ian
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Description Flags
test case
hyatt: review-
updated test case
updated patch hyatt: review+

Description Antti Koivisto 2005-10-09 22:55:39 PDT
It does not make much sense to break line after a list marker, the behaviour does not match other 
browsers either.
Comment 1 Antti Koivisto 2005-10-09 22:56:20 PDT
Created attachment 4284 [details]
test case
Comment 2 Antti Koivisto 2005-10-09 23:02:05 PDT
Created attachment 4285 [details]

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 3 Darin Adler 2005-10-09 23:36:22 PDT
Comment on attachment 4285 [details]

Comment 4 Dave Hyatt 2005-10-10 02:24:42 PDT
Comment on attachment 4285 [details]

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.
Comment 5 Dave Hyatt 2005-10-10 02:27:02 PDT
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?
Comment 6 Dave Hyatt 2005-10-10 02:27:46 PDT
If we do decide that "1. " should not break despite having a space, then it probably is ok to special-case 
list markers. :)
Comment 7 Dave Hyatt 2005-10-10 02:29:29 PDT
Comment on attachment 4285 [details]

Bah, let's just land it and if it turns out to be wrong we can fix it later. :)
Comment 8 Antti Koivisto 2005-10-10 09:46:25 PDT
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. 
Comment 9 Ian 'Hixie' Hickson 2005-10-10 15:13:34 PDT
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).

Comment 10 Dave Hyatt 2005-10-10 16:27:37 PDT
Comment on attachment 4285 [details]

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
Comment 11 Antti Koivisto 2005-10-11 20:53:44 PDT
Created attachment 4317 [details]
updated test case
Comment 12 Antti Koivisto 2005-10-11 21:05:58 PDT
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 13 Dave Hyatt 2005-10-16 23:47:46 PDT
Comment on attachment 4318 [details]
updated patch

Comment 14 Beth Dakin 2005-10-24 10:47:44 PDT
I committed the fix for this bug.