Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<meta name="viewport" content="width=device-width"/>
<style>
#subframe {
width: 500px;
height: 200px;
overflow-y: auto;
}
#transform {
transform: translate(0);
}
#sticky {
background-color: white;
position: sticky;
top: 0;
}
#spacer {
width: 100px;
height: 1000px;
}
</style>
</head>
<body>
<div id="subframe">
<div id="transform">
<div id="sticky">sticky with transformed parent (click me or hover me and try a scroll)</div>
<div id="spacer"></div>
</div>
</div>
</body>
<script type="application/javascript">
async function test() {
var utils = getHitTestConfig().utils;
var subframe = document.getElementById("subframe");
var sticky = document.getElementById("sticky");
checkHitResult(
hitTest(centerOf(sticky)),
APZHitResultFlags.VISIBLE,
utils.getViewId(subframe),
utils.getLayersId(),
"subframe was successfully hit");
}
waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
</html>