Re: Proposal for overflow painting order

Tab Atkins Jr. wrote:
 > On Wed, Feb 4, 2009 at 10:46 PM, Andrew Fedoniouk
 > <news@terrainformatica.com> wrote:
 >> I think we have bug in specification regarding negative margins and 
stacking
 >> order.
 >>
 >> Attached is the illustration that demonstrates layout of three
 >> DOM elements with the one in the middle having
 >>
 >> margin-top: -10px;
 >> margin-bottom: -10px;
 >>
 >> I think that its stacking order is slightly larger (as shown on the
 >> illustration) than its normal siblings thus it will be drawn on
 >> top of *both*, previous and next, its siblings.
 >
 > Do you mean you *want* it to have a higher stacking order?  Right now
 > it seems to definitely follow normal stacking order.

I meant "it should" draw that way.

 >
 > Is there any particular reason that you think margins should affect
 > stacking order here?  I would find that *highly* unintuitive, not to
 > mention probably page-breaking at this point.

Consider this:

<div style="background:green; height:100px">
<div #neg style="margin:-10px 0; background:red; height:100px">
<div style="background:yellow; height:100px">

Here effect of drawing elements with negative
margins is non-symmetrical for top and bottom margins of div#neg element.

 >
 > If you *do* want your behavior, it can be achieved by simply setting
 > the middle element to be position:relative and z-index:2, in addition
 > to the margins.

Specification introduced overlapping of elements by using negative 
margins. That overlapping *must* be specified. As simply as that.

Current "not defined" spec produces following overlap (lateral view of 
tree elements with the one in the middle having negative margins):

<pre>

   \
---\
     \-----
      \

</pre>

But possible options are:

Negative on top:
<pre>

    =====
----   ----

</pre>

Negative underneath:
<pre>

----   ----
    =====

</pre>

As many people as many ideas of what is more intuitive here.

 >
 > ~TJ
 >
 >


-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Thursday, 5 February 2009 17:19:12 UTC