Re: [CSS21] stack level definitions in 9.9.1

Hello,
I see two use-cases for a "position-stack" property.
One of the two can be work-aroundable but the second one need total change 
of the structure of the page.

================

UC 1 :

This property will allow designer to do such type of things :

<html><body><div>
    Some content :
    <div style="inline:block; height: 1.12em; width: 100px; position-stack: 
create-new;">
        <img class="top left corner" />
        <img class="top right corner" />
        <img class="bottom left corner" />
        <img class="bottom right corner" />
    </div>. It worked great !
</div></body></html>

.top {
    position: absolute;
    top: 0px; width: 50px;
    height: 3px;
}

.left {
    position: absolute;
    left: 0px; width: 50px;
    height: 3px;
}

...

Currently, there's a work-around but it's not beautiful :

<html><body><div>
    Some content :
    <div style="inline:block; height: 1.12em; width: 100px;"><div 
style="width: 100px; height: 1.12em; position: relative">
        <img class="top left corner" />
        <img class="top right corner" />
        <img class="bottom left corner" />
        <img class="bottom right corner" />
    </div></div>. It worked great !
</div></body></html>

"Position: relative" is used to create a new stacking context but it can 
breaks some other things.

============================

UC 2 :

They're also problems if you have something like :
<div class="relative" style="z-index: 1">
    A : I want to be above B
    <div class="absolute">C : I want to be below D
</div>
<div class="relative">
    B : I want to be below A
    <div class="absolute" style="z-index: 2">D : I want to be above C
</div>

If we can avoid the creation of a new stacking context inside the "relative" 
elements, the problem would be solvable (if we consider that
the inner blocks must have the absolute positions relatives to the 
grand-parent and not the parent.

Currently, there's no work-around. We must change the structure of the DOM, 
if it's possible.

Fremy

--------------------------------------------------
From: "Alan Gresley" <alan@css-class.com>
Sent: Wednesday, August 20, 2008 5:38 AM
To: "François REMY" <fremycompany_pub@yahoo.fr>
Cc: "L. David Baron" <dbaron@dbaron.org>; "Anton Prowse" 
<prowse@moonhenge.net>; <www-style@w3.org>
Subject: Re: [CSS21] stack level definitions in 9.9.1

> François REMY wrote:
>>
>> I propose that we also can have a "position-stack"
>> property with the following values :
>>
>>    - [initial] "auto" : A new local stacking context is
>>    created as the rules are defined in CSS 2.1/3.0
>>    (computed to "create-new" if a new stacking context is
>>    needed, to "keep-old" otherwhise).
>>
>>    - "create-new" : A new local stacking context is created
>>    anytime (top/left/right/bottom of children now refer
>>    to positions relatives to the element, even if these
>>    element is not a float or absolutely positionned
>>    element)
>>
>>    - "keep-old" : No new stacking context is created even
>>    if the element is absolutely positionned or floated
>>    (top/left/right/bottom of children now refer to
>>    positions relatives to the nearest stacking context).
>>
> [..]
>
>
> Francoiss, can you clearly state why there are problems in the current 
> spec for the *block formating context* (with test cases). I can only see 
> issues concerning *overflow*.
>
>
> -- 
> Alan http://css-class.com/
>
> Nearly all men can stand adversity, but if you want to test a man's 
> character, give him power - Abraham Lincoln
>
> Save the Internet - http://www.savetheinternet.com/ 

Received on Wednesday, 20 August 2008 08:45:32 UTC