Re: [css3-flexbox] Painting order

"Tab Atkins Jr." <jackalmage@gmail.com> writes:

> On Wed, Jun 27, 2012 at 6:34 AM, Morten Stenshorne <mstensho@opera.com> wrote:
>> Morten Stenshorne <mstensho@opera.com> writes:
>>> "Tab Atkins Jr." <jackalmage@gmail.com> writes:
>>>> On Mon, Jun 25, 2012 at 1:35 AM, Morten Stenshorne <mstensho@opera.com> wrote:
>>>>> fantasai <fantasai.lists@inkedblade.net> writes (in "[CSSWG] Minutes and Resolutions 2012-06-20"):
>>>>>>   - RESOLVED: order affects painting order
>>>>>
>>>>> Will 'flex-direction' and 'align-content' also affect painting order
>>>>> then?
>>>>
>>>> No, neither have any effect on painting order.
>>>
>>> Makes sense. Can you update the spec?
>>
>> But then again I can't really say I'm convinced that it's a good thing
>> that 'order' affects painting order at all.
>>
>>    <div style="display:flex;">
>>      <div id="a" style="order:3;">a</div>
>>      <div id="b" style="position:relative; order:2;">b</div>
>>      <div id="c" style="position:relative;">c</div>
>>      <div id="d" style="position:relative; z-index:-1; order:4;">d</div>
>>    </div>
>>
>> Painting order will here be d-a-c-b? So we have two levels of paint
>> ordering? Isn't this just confusing?
>
> Yes, that's the right painting order.  This correctly matches the
> visual order, as if you had written it in the order c-b-a-d.

I was thinking that we don't do the same paint reordering for
table-row-group, table-header-group and table-footer-group. (Well, both
IE and Opera do it, but I believe that's a bug, since there's nothing in
the spec that suggests such behavior). Then again, it's probably not so
interesting to change between those display types dynamically. But
consistency is nice. Why is it necessary to let 'order' affect painting
order for flex items, when there already exists a mechanism to do so
(z-index)?

Another related topic here is whether flex items should be treated as if
they sort of establish a new stacking context (except for descendants
that are positioned or create true stacking contexts on their own). I'm
talking about what http://www.w3.org/TR/CSS2/zindex.html has to say
about inline-block, inline-table and floats. This is unrelated to the
'order' property, though, and maybe we should start a new thread if it
needs to be discussed.

>> (doesn't sound very pleasant to implement, either)
>
> It was trivial on our side, as we make 'order' literally reorder the
> box tree (iiuc).

The box tree still needs to be traversed in logical order if you're
e.g. doing text selection, I suppose.

-- 
---- Morten Stenshorne, developer, Opera Software ASA ----
---- Office: +47 23692400 ------ Mobile: +47 93440112 ----
------------------ http://www.opera.com/ -----------------

Received on Wednesday, 27 June 2012 20:59:23 UTC