Bug 1276107 - Add a test for scrolling an inactive subframe with z-index. r=kats

MozReview-Commit-ID: 6HcYkrmgLFw

--HG--
extra : rebase_source : 10887de280b21cd8b2c77e687a8cc829819b4d91
extra : source : d48c76e7c8fc9db9d47d3553685c188c6dde0b88
extra : histedit_source : 7f62e28b81ba42b78798573928380ecd6a335f0e
This commit is contained in:
Botond Ballo 2016-06-01 19:56:49 -04:00
parent c9bf1aead5
commit e9a73ef16a
3 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,47 @@
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<title>Wheel-scrolling over inactive subframe with z-index</title>
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
<script type="application/javascript">
function* test(testDriver) {
var subframe = document.getElementById('scroll');
// scroll over the middle of the subframe, and make sure that it scrolls,
// not the page
var scrollPos = subframe.scrollTop;
yield moveMouseAndScrollWheelOver(subframe, 100, 100, testDriver);
dump("after scroll, subframe.scrollTop = " + subframe.scrollTop + "\n");
ok(subframe.scrollTop > scrollPos, "subframe scrolled after wheeling over it");
}
waitUntilApzStable()
.then(runContinuation(test))
.then(subtestDone);
</script>
<style>
#scroll {
width: 200px;
height: 200px;
overflow: scroll;
}
#scrolled {
width: 200px;
height: 1000px; /* so the subframe has room to scroll */
z-index: 2;
background: linear-gradient(red, blue); /* so you can see it scroll */
transform: translateZ(0px); /* to force active layers */
will-change: transform; /* to force active layers */
}
</style>
</head>
<body>
<div id="scroll">
<div id="scrolled"></div>
</div>
<div style="height: 5000px;"></div><!-- So the page is scrollable as well -->
</body>
</head>

View File

@ -21,6 +21,7 @@ support-files =
helper_touch_action.html
helper_touch_action_regions.html
helper_scroll_inactive_perspective.html
helper_scroll_inactive_zindex.html
tags = apz
[test_bug982141.html]
[test_bug1151663.html]

View File

@ -22,7 +22,8 @@ var prefs = [
var subtests = [
{'file': 'helper_scroll_on_position_fixed.html', 'prefs': prefs},
{'file': 'helper_bug1271432.html', 'prefs': prefs},
{'file': 'helper_scroll_inactive_perspective.html', 'prefs': prefs}
{'file': 'helper_scroll_inactive_perspective.html', 'prefs': prefs},
{'file': 'helper_scroll_inactive_zindex.html', 'prefs': prefs}
];
if (isApzEnabled()) {