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

On Thu, Jun 16, 2011 at 6:44 AM, Øyvind Stenhaug <oyvinds@opera.com> wrote:
> On Wed, 15 Jun 2011 19:38:34 +0200, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>
>> On Wed, Jun 15, 2011 at 9:04 AM, Øyvind Stenhaug <oyvinds@opera.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> regarding the definition of "list-style-position: outside", I see there
>>> has
>>> been some back and forth. The latest WD (dated 24 May 2011), although
>>> still
>>> missing a lot of detail, seemed to show some promise w.r.t. picking a
>>> simple
>>> and predictable approach for horizontal alignment. Not sure about
>>> choosing
>>> the list item's *parent* as a reference, though. For instance, depending
>>> on
>>> which edge is actually referred to, it might not work well with current
>>> UA
>>> stylesheets for HTML (where the space needed by an 'outside' list marker
>>> is
>>> provided by padding on ul/ol).
>>
>> Using the parent of the list item for alignment was done specifically
>> to help match current UA stylesheets, so all the markers will sit in
>> the same gutter when you have mixed-direction content, rather than
>> some markers being on the left and some being on the right, depending
>> on the list item's direction.
>
> Right, but even if it uses the direction of the parent, it should use an
> edge of the list item itself. I see the ED does this in section 7 though, so
> let's just forget about the WD.

Hm, that's clearly broken in the WD.  Yeah, ignore that part.


>>> In the editor's draft, 'hanging' has been removed from section 4, but its
>>> behavior seems to have been transferred to 'outside'.
>>
>> No, I just transferred the part that was previous referenced by the
>> "As hanging, but..." line.  Any behavior currently in 'outside' was
>> always there.
>
> After coming back to it today I think I understand how it's meant to work
> now. Maybe I got confused by looking at both WD and ED, or maybe I just
> didn't read carefully enough. I was misled by the part that says "the
> ::marker pseudo-element is placed immediately before the first text or
> significant whitespace in the list item or its descendants". In actuality
> this seems to be only about placement in the formatting structure, which is
> not obvious given the previous references to boxes (e.g. "This property
> specifies the position of the ‘::marker’ pseudo-element's box in the list
> item"). Or it's about some temporary placement to be modified further, which
> again could probably be made more explicit. I think there should be a link
> to section 7 as well, since it's such a crucial part of the definition of
> 'outside'.

Indeed, that bit is just about the static position.  It makes the
vertical position work correctly, and also prevents the marker from
generating an extra linebox when the first child of the list item is a
block.

I see how you were confused, though.  I'll rephrase that section and
include a link to the position:marker definition.


> It's also a bit unexpected how "position: marker" actually means "position
> as a list marker outside the principal box". So, apparently, even when
> 'list-style-position' is 'inside', if ::marker has position:marker it will
> act exactly like 'outside' in many cases (and very similar to it in other
> cases).

Yes, if you go out of your way to do odd things with the marker, it
might act oddly.  ^_^  It's the same behavior you'd get if you made an
inline element be position:marker.


> For the border overlap thing, I think it still needs to specify exactly
> which edge is being referred to. It's the left or right (depending on parent
> element's direction) *border* edge of the list item's principal box,
> presumably. In contrast, the edge of the ::marker box referred to might need
> to be the margin edge?

Indeed, I should specify the edges.  You're right that it's the border
edge of the list item and the margin edge of the marker.

> I think there should be a link to the definition of "start"/"end", by the
> way.

kk

> The ::marker pseudo can still end up in the middle of a table, e.g. if the
> list-item's first child is a table element where only some of the cells
> contain text. But since this only affects vertical alignment maybe that's
> not worth worrying about, I don't know.

Hmm, looks like browsers don't descend into a table to place markers.
IE9 appears to stop at BFCs.  I dunno what Chrome is doing, but Webkit
is generally inconsistent and crazy about these things.

Sigh.  Now I have to decide if this is important behavior (it probably
is) and how to achieve it.

> One thing about section 7, it talks about a box's ancestor and "the parent
> of that box". But as far as I know there is still no definition of a box
> tree. Even if this is rewritten to use more correct terminology in terms of
> the element tree, one would run into issues with inline parents.

You're right.  Even with a box tree, this isn't what I really want.  I
want to talk about the principal boxes of the element and it's parent
element.


> I'm wondering if you need to define whether position:marker is absolute
> positioning/out of/in flow as well.

I do need to.  (It's out-of-flow.)

~TJ

Received on Thursday, 16 June 2011 18:06:12 UTC