Skip to content
Snippets Groups Projects
Commit e70a61f0 authored by Hiroyuki Ikezoe's avatar Hiroyuki Ikezoe
Browse files

Bug 1777052 - Skip counting scroll events where the scroll position is...

Bug 1777052 - Skip counting scroll events where the scroll position is unchanged in test_mousecapture.xhtml. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D174050
parent 5f419053
No related branches found
No related tags found
No related merge requests found
......@@ -73,10 +73,22 @@ function selectionScrollCheck() {
var element = otherWindow.document.documentElement;
var count = 0;
let previousScrollPosition = 0;
function selectionScrollDone() {
// Don't count unchanged scroll position.
// There's a bug that scroll events get fired during reconstructing scroll
// frames even if the scroll position is unchanged (bug 1825470). We need to
// ignore the unchanged scroll events here.
if (otherWindow.scrollY == previousScrollPosition) {
return;
}
previousScrollPosition = otherWindow.scrollY;
// wait for 6 scroll events to occur
if (count++ < 6)
if (count++ < 6) {
return;
}
otherWindow.removeEventListener("scroll", selectionScrollDone);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment