Re: Lists around floats

Once upon a time, a long, long time ago, L. David Baron wrote:
> The CSS spec's rules for rendering floats and the rules for rendering
> lists yield what seems to me a strange conclusion.  Here is the
> problem.  If a list has an element floating to its left (in ltr text),
> the block elements (i.e., those with display block or list-item) are
> not changed by the floating element; only the line boxes within them
> are.  However, markers are offset (according to the marker-offset
> property) from the border-edge of the list item.  Even if the section
> on markers is ignored (as it can be for list-style-position: outside),
> the marker must still be outside of the principal block box for the LI
> element.

This problem actually occurs with all marker boxes -- list-items are
merely block boxes with an implied ":before { display: marker; }" and the
relevant numbering business done with anonymous counters. (And for
list-style-position:inside this would also imply an additional text-indent
and a negative marker-offset, but let`s not get dragged down into
details).

In fact, the CSS2 spec points this problem out explicitly. See paragraph 7
of section 12.6.1.
  http://www.w3.org/TR/REC-CSS2/generate.html#markers
...the text in question is after an emphasised "Note":

# If a marker flows to the right of a float in a left-to-right formatting
# context, the principal box will flow down the float`s right side, but
# the marker boxes will appear to the left of the float. [...]

I suggest that instead of "marker-offset" being relative to the border
edge of the principal box, it be relative to the first (last) line box of
the principal box, with the value of marker-offset being added to the
padding-left (padding-right) and border-left (border-right) properties.

This would result in no difference when there are no floats, but when
floats are present it would result in the marker being to the right (left)  
of the left (right) floating floats rather than to the right (left) of
them. In other words, markers would be near their text.

I have drawn a diagram on paper here, with all margins, paddings, borders,
line boxes, marker boxes, float paddings, float margins and everything
carefully drawn, however drawing it in ASCII over a telnet connection with
500ms latency is not something I want to do.

Ok, I know what, I`ll make it into PNGs.

http://www.bath.ac.uk/%7Epy8ieh/internet/projects/wwwstyle/MarkerNearFloatSuggestion.html

That page has diagrams that are explained by this message.

-- 
Ian Hickson

Received on Sunday, 20 December 1998 19:34:39 UTC