Closed Bug 264357 Opened 20 years ago Closed 20 years ago

z-index ignored for block elements with position:absolute on hover event

Categories

(Core :: Web Painting, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: justin, Assigned: roc)

References

()

Details

Attachments

(1 file)

User-Agent:       Justin Koivisto Was Here. ----- Mozilla/5.0 (Windows XP Pro; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (Windows XP Pro; en-US; rv:1.7) Gecko/20040616

http://www.koivi.com/bugzilla/234788.html was an example of a mouseover/hover
bug that is reported as fixed in Moz 1.8a - however, the bit about the ignored
z-index was not.

When a hover event overlaps a block element with position:absolte (second column
in the menu example), the z-index is ignored and the hovered element is
displayed *behind* the absolute-positioned block element (that has a lower z-index).

Instead of the hovered element popping over the block, it gets obscured and the
user is unable to select the newly visible block.

Reproducible: Always
Steps to Reproduce:
1. Go to http://www.koivi.com/bugzilla/234788.html
2. Mouseover the second menu item.
3. Observe.

Actual Results:  
The hovered menu is hidden behind the absolute-positioned block element (z-index
is ignored)

Expected Results:  
The menu should appear on top of the block element (higher z-index as in
stylesheet).
Attached file Testcase HTML file
This is the same HTML source as the URL in the bug report - just in case I
accidently delete it from my server.
If I put position:relative; inside #dmenu, it is working.
I think what Mozilla is doing is correct here.
Look at:
http://www.w3.org/TR/CSS21/visuren.html#z-index

Especially this line of text:
"
Each box belongs to one stacking context. Each box in a given stacking context
has an integer stack level, which is its position on the z-axis relative to
other boxes in the same stacking context. Boxes with greater stack levels are
always formatted in front of boxes with lower stack levels. Boxes may have
negative stack levels. Boxes with the same stack level in a stacking context are
stacked bottom-to-top according to document tree order.

The root element forms the root stacking context. Other stacking contexts are
generated by any positioned element (including relatively positioned elements)
having a computed value of 'z-index' other than 'auto'. Stacking contexts are
not necessarily related to containing blocks. In future levels of CSS, other
properties may introduce stacking contexts, for example 'opacity'. 
"
Spot on! Moz is doing it right... I just overooked that there could be more than
one stacking context. Thanks! Bug marked as INVALID (because of my ignorance).
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: