Bug 1447131 - Mochitest for hit-testing over backface-visibility:hidden element. r=kats

MozReview-Commit-ID: EeQlvluPQD1

--HG--
extra : rebase_source : 074ba63d6c4d9a69393cce691988697def556818
This commit is contained in:
Botond Ballo 2018-03-28 14:22:54 -04:00
Родитель 1b44d973ee
Коммит 38444e7793
4 изменённых файлов: 68 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,65 @@
<!DOCTYPE HTML>
<html>
<head>
<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 type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
<meta name="viewport" content="width=device-width"/>
<style>
body,html{
height: 100%;
}
body{
margin: 0;
transform-style: preserve-3d;
}
#back, #front{
backface-visibility: hidden;
position: absolute;
width: 100%;
height: 100%
}
#front{
overflow-y:auto;
}
#content{
width: 100%;
height: 200%;
background: linear-gradient(blue, green);
}
#back{
transform: rotateY(180deg);
}
</style>
</head>
<body>
<div id="front">
<div id="content"></div>
</div>
<div id="back"></div></body>
<script type="application/javascript">
function* test(testDriver) {
var config = getHitTestConfig();
if (config.isWebRender) {
ok(true, "This test is only enabled for non-WebRender");
subtestDone();
return;
}
var subframe = document.getElementById('front');
var subframeViewId = config.utils.getViewId(subframe);
var {hitInfo, scrollId} = hitTest(centerOf(subframe));
is(scrollId, subframeViewId,
"hit the scroll frame behind the backface-visibility:hidden element");
subtestDone();
}
waitUntilApzStable().then(runContinuation(test));
</script>
</html>

Просмотреть файл

@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Various tests to exercise the APZ hit-testing codepaths</title>
<title>APZ hit-testing with floated subframe</title>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>

Просмотреть файл

@ -21,6 +21,7 @@
helper_iframe_pan.html
helper_iframe1.html
helper_iframe2.html
helper_hittest_backface_hidden.html
helper_hittest_basic.html
helper_hittest_checkerboard.html
helper_hittest_subframe_float.html

Просмотреть файл

@ -30,6 +30,7 @@ var subtests = [
{'file': 'helper_hittest_basic.html', 'prefs': prefs},
{'file': 'helper_hittest_subframe_float.html', 'prefs': prefs},
{'file': 'helper_hittest_checkerboard.html', 'prefs': prefs},
{'file': 'helper_hittest_backface_hidden.html', 'prefs': prefs}
];
if (isApzEnabled()) {