Re: Insufficient margins/padding for list-items/quotes/etc. next to floats

On Sat, Dec 26, 2009 at 7:54 PM, L. David Baron <dbaron@dbaron.org> wrote:
> Hmmm.  I think I know the problem you're talking about, but I don't
> see it in your testcase.

It got mangled by line breaks.  This should work better:

data:text/html,<!doctype html>
<div style="float: left;padding:1em;margin:0 1em 1em 0;
border:1px solid black;height:5em">Floated text</div>
<ul><li>Badly-displayed bullet</li></ul>
<p>A paragraph.</p>
<ul style="clear:left"><li>Properly-displayed  bullet</li></ul>
<p>Another paragraph</p>

> There was actually a proposal for this in old drafts of css3-box:
> http://www.w3.org/TR/2002/WD-css3-box-20021024/#the-float-displace
> (See also my comments on it in
> http://lists.w3.org/Archives/Public/www-style/2008Feb/thread.html#msg116 .)

Ah, this is exactly what I want.

> I think the biggest question is whether there's a good-enough
> solution for automatically determining the relevant ancestor (in
> your wording, E) or whether (as in the original proposal cited
> above, but not my modifications to it) that ancestor needs to be
> specified explicitly.

Specifying the ancestor explicitly isn't a good requirement.  I'd
really like to be able to drop something like blockquote, ul, ol, dl,
li { float-displace: indent } -- or maybe even * { float-displace:
indent } -- into my global stylesheet and have it work everywhere.  My
initial thought was to have the extra space be the space between the
content edge of the innermost block containing the line box, and the
padding edge of the most distant ancestor that isn't an ancestor of
the float.  That should work for the Wikipedia use cases I can think
of off the top of my head, but I don't know if it's ideal for other
cases.  You'd have to remove margins from your floats for this to work
nicely, but that seems reasonable.

Other than for compatibility with existing content, is there any
reason authors would *want* the current behavior?  It seems to me like
it would have been better if this were the behavior of floats from the
beginning, assuming it's possible to spec some kind of sane automatic
value here.  If I'm right, the feature should be specced with an eye
to users just dumping some rule in their stylesheets that means "use
the new behavior everywhere", like * { float-displace: indent }.

Received on Sunday, 27 December 2009 01:25:23 UTC