Synthetic events created using the MouseEvent or PointerEvent constructors have incorrect pageX and pageY coordinates

Issue #11208119 • Assigned to Travis L.

Details

Author
Philip G.
Created
Mar 8, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
38.14393
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Test Case:

var options = {
    screenX: 100,
    screenY: 200,
    clientX: 100,
    clientY: 200
};

// *** BROKEN: MouseEvent Constructor ***
var e = new MouseEvent('mousedown', options);

// expected: "100 200"
// actual:  "1 2"
console.log(e.pageX, e.pageY);

// *** BROKEN: PointerEvent Constructor ***
var e = new PointerEvent('pointerdown', options);

// expected: "100 200"
// actual:  "1 2"
console.log(e.pageX, e.pageY);

// *** WORKS OK: deprecated createEvent/initMouseEvent method ***
e = document.createEvent("MouseEvents");
e.initMouseEvent("click", true, true, window, 0, 100, 200, 100, 200, false, false, false, false, 0, null);

// expected: "100 200"
// actual:  "100 200"
console.log(e.pageX, e.pageY);

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Assigned To to “Travis L.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in