Closed Bug 14691 Opened 21 years ago Closed 19 years ago

z-index problems with overflow:scroll [POS]

Categories

(Core :: DOM: CSS Object Model, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: beard, Assigned: roc)

References

Details

(Keywords: css2, dom2, testcase)

Attachments

(2 files)

Trying to change style properties using
document.getElementById(id).style.setProperty('z-index', 1, '') doesn't work.
Nothing changes. I've also tried by assigning to style.zIndex, and others, such
as backgroundColor, but nothing changes.
Here's a test case that doesn't work for me:

<html>
<head>
<SCRIPT>
function raise(obj)
{
	var style = obj.style;
	style.setProperty('z-index', 1 + Number(style.zIndex), '');
	dump('z-index = ' + style.getPropertyValue('z-index') + '\r');
}
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form>
<div id="myDiv1"
onMouseOver="raise(document.getElementById('myDiv1'))"
style="position:absolute;z-index:1;top:10px;left:10px;background-color:gray;
width:100px;height:75px;overflow:scroll">
Hello<BR>Hello<BR>Hello<BR>Hello<BR>Hello<BR>
</div>
<div id="myDiv2"
onMouseOver="raise(document.getElementById('myDiv2'))"
style="position:absolute;z-index:0;top:40px;left:40px;background-color:blue;
width:100px;height:75px;overflow:scroll">
Hello<BR>Hello<BR>Hello<BR>Hello<BR>Hello<BR>
</div>
</form>
</body>
</html>
Summary: Changing style properties? → {css2} Changing style properties?
In an attempt to get my bug list in order again, marking all the bugs I have
currently as ASSIGNED.
Keywords: css2
Migrating from {css2} to css2 keyword. The {css1}, {css2}, {css3} and {css-moz}
radars should now be considered deprecated in favour of keywords.
I am *really* sorry about the spam...
Summary: {css2} Changing style properties? → Changing style properties?
This is only an issue if the DIV is scrollable. In that case, z-index is 
ignored, whether its in the original inline STYLE attribute or set later via the 
DOM. I'm attaching two test cases - one which works correctly (had to make some 
modifications to the original test) without overflow and the same test with 
overflow. Passing along to Eric Vaughn.
Assignee: vidur → evaughan
Status: ASSIGNED → NEW
Summary: Changing style properties? → z-index problems with overflow:scroll
targeting
Status: NEW → ASSIGNED
Target Milestone: --- → M16
Mass-moving all M16 non-feature bugs to M17, which we still consider to be 
part of beta2
Target Milestone: M16 → M17
nominating for beta2, we're not sure how common this is & would like PDT to 
make the call.
Keywords: nsbeta2
PDT needs info on how common this is to triage for beta2.
Whiteboard: [NEED INFO]
This is yet another absolute positioning bug with gfxscrollbars. Which I believe 
is already [beta2+]. Hopefully they are all the same root problem.
I don't think this is common within content, so it can be deferred for beta3 
from that standpoint. I don't understand what the other gfxscrollbars issues 
are or what the relationship to them would be. But those other bugs haven't been 
marked as depending on this.
Whiteboard: [NEED INFO]
Putting on [nsbeta2-] radar.  
Whiteboard: [nsbeta2-]
Mass-moving all nsbeta2- bugs to M20
Target Milestone: M17 → M20
To gary
Assignee: evaughan → garyf
Status: ASSIGNED → NEW
As per meeting with ChrisD today, taking QA.
QA Contact: vidur → py8ieh=bugzilla
I have this working now with my overhaul of nsViewManager2.
Could you take the bug Robert?  GaryF is no longer involved in this project.
Assignee: garyf → roc+moz
Reassigning to Robert, who has a fix pending review in bug 39621.
Depends on: 39621
OS: Mac System 8.6 → All
Hardware: Macintosh → All
Target Milestone: M20 → M18
Status: NEW → ASSIGNED
Summary: z-index problems with overflow:scroll → z-index problems with overflow:scroll [POS]
Rubber stamping [nsbeta3-], since Robert's fix is slated for the next release
do to high risk considerations.
Whiteboard: [nsbeta2-] → [nsbeta2-] [nsbeta3-]
Keywords: nsbeta2, nsbeta3mozilla0.9
Whiteboard: [nsbeta2-] [nsbeta3-]
Target Milestone: M18 → ---
Keywords: dom2
Component: DOM Level 2 → DOM Style
Taking QA Contact on all open or unverified DOM Style bugs...
*** Bug 71238 has been marked as a duplicate of this bug. ***
Target Milestone: --- → mozilla0.9
There's something a little bit strange going on here; it would be good to know
if the behaviour is correct.

When you move from the raised square to the unraised one, the unraised one
doesn't raise unless you are _not_ hovering over the text. This is in both
testcases.

Is that right?

Gerv 
I think that behaviour is correct. The Javascript tests "if (event.target ==
this)"; when you mouse over the text, event.target will be referring to the text
node, not the DIV node.

This bug is now fixed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
With 2001040120 on Windows 2000, the scrollbar on the gray div of the test case
with overflow displays two thumbs when I scroll down. (With the Classic skin, at
least. Haven't tried others.)
Hmm ... I found a repainting bug, but it doesn't belong here. I have filed bug 
74413 against myself.
Wow. http://bugzilla.mozilla.org/showattachment.cgi?attach_id=6234 works 
perfectly, and can I just say, it's really cool! :-)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.