mirror of
https://github.com/servo/servo.git
synced 2025-06-13 19:04:30 +00:00
This adds the infrastructure necessary to support stacking contexts that are not containing blocks for absolutely-positioned elements. Our infrastructure did not support that before. This minor revamp actually ended up simplifying the logic around display list building and stacking-relative position computation for absolutely-positioned flows, which was nice.
48 lines
629 B
HTML
48 lines
629 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<!-- Tests that `opacity` causes a new stacking context to be formed. -->
|
|
<style>
|
|
section {
|
|
position: absolute;
|
|
width: 100px;
|
|
height: 100px;
|
|
}
|
|
|
|
#a {
|
|
background: red;
|
|
top: 0;
|
|
left: 0;
|
|
z-index: 2;
|
|
}
|
|
|
|
#b {
|
|
background: #00ff00;
|
|
top: 25px;
|
|
left: 25px;
|
|
z-index: 1;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
#c {
|
|
background: blue;
|
|
top: 50px;
|
|
left: 50px;
|
|
z-index: 3;
|
|
}
|
|
|
|
#container {
|
|
width: 200px;
|
|
height: 200px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<section id=a></section>
|
|
<section id=c></section>
|
|
<div id=container>
|
|
<section id=b></section>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|