Re: positioned elements: center

fantasai wrote:
> 
> Brad Kemper wrote:
>>
>> On Jan 7, 2008, at 3:01 PM, David Woolley wrote:
>>
>>> My guess, in the case of vertical centering, the problem is the 
>>> problem is
>>> that it breaks incremental rendering. ...
>>
>> We already have vertical centering in absolutely positioned elements. 
>> Of top or bottom edges, by setting them to 50%. The proposal would let 
>> you set the center of an element in exactly the same way as you 
>> currently center any of the edges. Or set it to any other value that 
>> you can set edges to, using the same units.
>> So don't "guess" what the imaginary problems are that would allow you 
>> to argue against it, just because you are compelled to argue against 
>> everything, David. There is no problem with this proposal, and the 
>> implementors could implement it in their sleep, tonight, if they so 
>> chose.
> 
> Actually, David Woolley's point is valid. Vertical centering "breaks"
> incremental rendering even in absolute positioning not because the
> containing block's height is unknown but because the height of the
> content is unknown. I believe that's why in CSS2.1 'auto' margins
> can't vertically center absolutely-positioned non-replaced content,
> even though they can center replaced content (e.g. images).
> 

Problem of incremental rendering makes sense to discuss in context of 
long documents only.

If you want to center something in the view then you
will prepare block that will (usually) fit in the view in the whole.
Thus, it is highly probable that your document will be contained
in the very first http buffer (4k or so) in the whole.

Inability to calculate margin-top/bottom:auto; is not related to
incremental rendering problem.

margin-top:auto require additional position adjustment to be made
after computation of vertical autos. That adjustment is not
possible if your document has floats. The only feasible case
is if you are adjusting elements that are float containers.
In HTML these are table cells only. That is why all UAs
support <table height=100%> based layouts.


> This doesn't mean we shouldn't consider vertical centering: I think
> vertical centering is an important ability to include in CSS (outside
> of table cells). But however we do it, it is going to "break" incremental
> rendering in that the final position of earlier content won't be known
> until later content is loaded. As long as most designers don't use it on
> the main content of long pages, though, it shouldn't be a huge problem--
> and I don't expect that they will. Vertical centering is mostly useful
> for short bits of content in navigation and on pages that fit above the
> fold.
> 
> Advanced Layout breaks incremental rendering in a much more troublesome
> way, because it reorders content and is expected to affect almost all
> content on long pages.
> 
> ~fantasai
> 
> 

-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Tuesday, 8 January 2008 17:21:12 UTC