mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 06:05:02 +00:00

Elements are now collected according to paint order as spec says, replacing the depth-first traversal of the paint tree with hit-testing on each box. This change resolves a FIXME in an existing test and adds a new previously non-working test.
37 lines
771 B
HTML
37 lines
771 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
.box {
|
|
width: 100px;
|
|
height: 100px;
|
|
position: absolute;
|
|
}
|
|
|
|
#a {
|
|
background-color: magenta;
|
|
z-index: 1;
|
|
transform: translate(110px, 10px);
|
|
}
|
|
|
|
#b {
|
|
background-color: mediumaquamarine;
|
|
z-index: 2;
|
|
transform: translate(120px, 20px);
|
|
}
|
|
|
|
#c {
|
|
background-color: greenyellow;
|
|
z-index: 3;
|
|
transform: translate(130px, 30px);
|
|
}
|
|
</style>
|
|
<div id="a" class="box"></div>
|
|
<div id="b" class="box"></div>
|
|
<div id="c" class="box">hello</div>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
for (const element of document.elementsFromPoint(150, 50)) {
|
|
printElement(element)
|
|
}
|
|
});
|
|
</script>
|