Re: Question on clear applying to run-ins

On 22/09/2010 15:44, fantasai wrote:
> On 09/22/2010 06:02 AM, fantasai wrote:
>> On 09/07/2010 06:18 PM, Boris Zbarsky wrote:
>>> This doesn't actually answer my question (though it does eliminate tome
>>> possible answers). Here's what I'm asking about:
>>>
>>> <span style="display: run-in; clear: right;"></span>
>>> <div style="clear: left"></div>
>>>
>>> What should the <div> be clearing? Right floats? Left floats? Both? For
>>> right floats that come between the run-in and the block, should the
>>> block be clearing them (sounds like "yes")?
>>
>> Proposal A:
>>
>> Change
>> # For run-in boxes, this property applies to the final block box to
>> # which the run-in box belongs.
>> to
>> | For a run-in element that is rendered as an 'inline' element,
>> | this property combines with the 'clear' value on the block box
>> | that contains it, resulting in used 'clear' value that honors
>> | the requirements of both elements: 'left' and 'none' combine
>> | to 'left', 'right' and 'none' combine to 'right, 'left' and
>> | 'right' combine to 'both', and 'both' and any other value
>> | combine to 'both'.
>>
>> Proposal B:
>>
>> Change
>> # For run-in boxes, this property applies to the final block box to
>> # which the run-in box belongs.
>> to
>> | Note that while this property applies to 'run-in' elements that
>> | render as 'block' boxes, it does not apply to 'run-in' elements
>> | that render as 'inline' boxes.
>
> Oh, and Proposal C:
>
> Remove
> # For run-in boxes, this property applies to the final block box to
> # which the run-in box belongs.
>
> Change
> # Applies to: block-level elements
> to
> | Applies to: block-level elements except elements with 'display: run-in'.
>
> This has the advantage of being more predictable (whether clear applies
> doesn't depend on the surrounding content).

Practically speaking, B is horrible for pages where content generation 
is out of the control of the stylesheet author.  In the simple case of a 
tall float next to some text, a heading and <something>, and I want a 
run-in heading which clears the float, I don't want the result of 
whether the clear is honoured to depend on what ends up being inserted 
as the <something> (ie, to depend on whether the heading runs in or not).

Of the remaining two proposals, A is obviously the more useful.

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Wednesday, 22 September 2010 21:16:34 UTC