Bug 1252256, part 8 - Use Currying in testOnWheelProperty subtest. r=masayuki

This commit is contained in:
Andrew McCreight 2016-03-08 07:18:19 -08:00
Родитель 20baf11d59
Коммит 5112b5e3fc
1 изменённых файлов: 8 добавлений и 5 удалений

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

@ -726,11 +726,14 @@ var gOnWheelPropHandled = new Array;
function testOnWheelProperty()
{
window.onwheel = function (e) { gOnWheelPropHandled["window"] = true; }
document.onwheel = function (e) { gOnWheelPropHandled["document"] = true; }
document.documentElement.onwheel = function (e) { gOnWheelPropHandled["html"] = true; };
document.body.onwheel = function (e) { gOnWheelPropHandled["body"] = true; };
gScrollableElement.onwheel = function (e) { gOnWheelPropHandled["div"] = true; };
const handleOnWheelProp = prop => e => gOnWheelPropHandled[prop] = true;
window.onwheel = handleOnWheelProp('window');
document.onwheel = handleOnWheelProp('document');
document.documentElement.onwheel = handleOnWheelProp('html');
document.body.onwheel = handleOnWheelProp('body');
gScrollableElement.onwheel = handleOnWheelProp('div');
var target = document.getElementById("onwheel");
synthesizeWheel(gScrollableElement, 10, 10,
{ deltaMode: WheelEvent.DOM_DELTA_LINE,