Skip to content

Commit 2cc10c6

Browse files
trflynn89awesomekling
authored andcommitted
Base: Add test for a box placed over links with negative z-index
In this test, a set of links has a background box placed behind them via a negative z-index. The expectation is that a hit test on a link during a mouse-move event should select that link, and not the background box.
1 parent cbd62c4 commit 2cc10c6

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<style>
2+
ul {
3+
margin: 0;
4+
padding: 0;
5+
text-align: center;
6+
list-style-type: none;
7+
}
8+
a {
9+
color: black;
10+
text-decoration: none;
11+
}
12+
a:hover {
13+
text-decoration: underline;
14+
}
15+
#contents {
16+
position: relative;
17+
overflow: hidden;
18+
}
19+
#links {
20+
width: 110px;
21+
float: left;
22+
padding: 5px;
23+
}
24+
#background {
25+
width: 120px;
26+
position: absolute;
27+
float: left;
28+
left: 0;
29+
bottom: 0;
30+
top: 0;
31+
background: cyan;
32+
border: 1px solid black;
33+
z-index: -10000;
34+
}
35+
</style>
36+
<body>
37+
<div id=contents>
38+
<div id=links>
39+
<ul>
40+
<li><a href="welcome.html">Home 1</a></li>
41+
<li><a href="welcome.html">Home 2</a></li>
42+
<li><a href="welcome.html">Home 3</a></li>
43+
</ul>
44+
</div>
45+
<div id=background></div>
46+
</div>
47+
</body>

Base/res/html/misc/welcome.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ <h1>Welcome to the Serenity Browser!</h1>
3838
<p>This page loaded in <b><span id="loadtime"></span></b> ms</p>
3939
<p>Some small test pages:</p>
4040
<ul>
41+
<li><a href="link-over-zindex-block.html">link elements with background box placed with z-index</a></li>
4142
<li><a href="contenteditable.html">contenteditable</a></li>
4243
<li><a href="clear-1.html">clearing floats</a></li>
4344
<li><a href="float-1.html">floating boxes</a></li>

0 commit comments

Comments
 (0)