diff options
Diffstat (limited to 'gfx/layers/apz/test/mochitest/helper_hittest_sticky_bug1478304.html')
-rw-r--r-- | gfx/layers/apz/test/mochitest/helper_hittest_sticky_bug1478304.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gfx/layers/apz/test/mochitest/helper_hittest_sticky_bug1478304.html b/gfx/layers/apz/test/mochitest/helper_hittest_sticky_bug1478304.html new file mode 100644 index 0000000000..395c688a12 --- /dev/null +++ b/gfx/layers/apz/test/mochitest/helper_hittest_sticky_bug1478304.html @@ -0,0 +1,58 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>APZ hit-testing with sticky element inside a transform (bug 1478304)</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"/> + <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> |