Re: [css3-lists] list-style-position behavior

On Thu, May 12, 2011 at 6:56 AM, Øyvind Stenhaug <oyvinds@opera.com> wrote:
> On Fri, 04 Feb 2011 22:48:08 +0100, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>
>> There are two distinct behaviors for list-style-position:outside
>> between browsers.  One group (IE8, FF, Opera) positions the marker
>> relative to the first line box in the list item.  This means that it
>> cares about text-align, and will "follow" the text.  Another group
>> (IE9, Webkit) positions the marker relative to the list item itself,
>> so text-align is ignored.
>
> I think this is too simplified, the actual behaviors seem rather more
> complicated/quirky and diverging than that. Try for instance horizontal
> padding, floats and text-indent (for which there is a test in the CSS 2.1
> testsuite, unlike text-align, apparently).
>
> Also, positioning the marker relative to the line box does not make it
> "follow" the text when text-align changes, since the line box does not
> shrink to fit its contents.
>
>> Since IE changed behavior, I suppose that means there's not a
>> significant compat impact.  Is this true?
>>
>> Right now my plan is to spec the first (line-box-based) behavior as
>> "list-style-position:hanging", and the second (list-item-based)
>> behavior as "list-style-position:outside".
>
> Sounds like it could be a pretty clean model, though it differs from
> previous suggestions (e.g. [1], [2]) and I don't have any insights as to
> compat impact.
>
> The edit following this seems to have introduced more changes, though. For
> instance, for 'outside' it says that the marker of a list item in
> top-to-bottom block progression is aligned to the top edge (which one?).
> This doesn't sound particularly desirable, and the browsers I've tried all
> seem to connect the marker to a line box somehow and have it affect the line
> box height etc (as CSS 2.1 suggests may happen). Was it intentional/thought
> through?
>
> I see the positioning stuff is marked as an issue, but I don't remember
> seeing it discussed here, so maybe people haven't looked at (this section
> of) the ED much.

I've done some further experimentation with list items and alignment.
Every browser differs on at least some details, even when you account
for the fact that there are two distinct models being implemented
('hanging' vs 'outside').

You're right that every browser connects the marker to a linebox
somehow.  I've revised the definition of the -position values to work
by inserting a placeholder into an appropriate place in the content,
and then positioning relative to that.  This gives us a model where
'outside' is *almost* exactly what IE9 does, and 'hanging' is similar
to, but not exactly the same as, what Firefox and Opera do.

There are some areas of marker positioning that are simply insane
still.  I've marked them as issues for now, and will discuss how much
of the insanity is necessary and how much we can spec away.

I've submitted a publication request for a new WD of the draft, so
please comment further on what I've come up with!

~TJ

Received on Monday, 23 May 2011 20:17:01 UTC