Source code

Revision control

Copy as Markdown

Other Tools

<title>APZ hit-testing with backface-visibility:hidden</title>
<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"/>
height: 100%;
margin: 0;
transform-style: preserve-3d;
#back, #front{
backface-visibility: hidden;
position: absolute;
width: 100%;
height: 100%
width: 100%;
height: 200%;
background: linear-gradient(blue, green);
transform: rotateY(180deg);
<div id="front">
<div id="content"></div>
<div id="back"></div></body>
<script type="application/javascript">
async function test() {
var config = getHitTestConfig();
var subframe = document.getElementById("front");
// Set a displayport to ensure the subframe is layerized.
// This is not required for exercising the behavior we want to test,
// but it's needed to be able to assert the results reliably.
config.utils.setDisplayPortForElement(0, 0, 1000, 1000, subframe, 1);
await promiseApzFlushedRepaints();
var subframeViewId = config.utils.getViewId(subframe);
var {scrollId} = hitTest(centerOf(subframe));
is(scrollId, subframeViewId,
"hit the scroll frame behind the backface-visibility:hidden element");
.then(subtestDone, subtestFailed);