Bug 73068

Summary: css :hover doesn't work on initially onscreen absolute positioned divs with negative z-index
Product: WebKit Reporter: Mike Lawther <mikelawther>
Component: UI EventsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bfulgham, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Testcase none

Description Mike Lawther 2011-11-23 21:03:34 PST
As reported at http://code.google.com/p/chromium/issues/detail?id=83533;

An absolutely positioned div with a negative zindex that is initially visible without scrolling doesn't have hover applied to it.

----------
<style>
div {
    width: 50px;
    height: 50px;
    position: absolute;
    background-color: blue;
    z-index: -1;
}

div:hover {
	background-color:green;
}
</style>   

<div style="top: 200px;"></div>
<div style="top: 400px;"></div>
<div style="top: 600px;"></div>
<div style="top: 800px;"></div>
------------

In the above testcase, any div that is initially offscreen (ie requiring scrolling) will correctly turn green on hover. The ones that are initially onscreen don't.

Note you need to load this directly - pasting into something like jsfiddle.net does not repro the problem.

Browsers Tested (MacOS):
 - WebKit Nightly r101106: BAD
 - Firefox 8.0 : OK
 - Opera 11.52: OK
Comment 1 Alexey Proskuryakov 2011-11-24 12:52:09 PST
See also: bug 25943.
Comment 2 Simon Fraser (smfr) 2011-11-28 11:41:32 PST
Created attachment 116794 [details]
Testcase
Comment 3 Brent Fulgham 2022-07-11 16:47:48 PDT
This continues to be an issue in 2022. Blink and WebKit have the same (broken) behavior.
Comment 4 Radar WebKit Bug Importer 2022-07-11 16:47:58 PDT
<rdar://problem/96850674>