Bug 424390 - Implement MouseEvent.x / MouseEvent.y (for CSSOM View). r=smaug
authorOri Avtalion <ori@avtalion.name>
Wed, 02 Nov 2016 21:49:18 +0200
changeset 322498 e8c6f15ad696c9cbe868c92cf5eb201fdf09d2ce
parent 322497 d2b391690334c24b5c002a6dd6f3762e6f7f6d22
child 322499 8a98388a60bd515c21647f4e57c750b32c9cce0c
push id83892
push usercbook@mozilla.com
push dateTue, 15 Nov 2016 07:51:16 +0000
treeherdermozilla-inbound@c861b79fc961 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs424390
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 424390 - Implement MouseEvent.x / MouseEvent.y (for CSSOM View). r=smaug
dom/webidl/MouseEvent.webidl
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/cssom-view/mouseEvent.html
--- a/dom/webidl/MouseEvent.webidl
+++ b/dom/webidl/MouseEvent.webidl
@@ -11,16 +11,20 @@
  */
 
 [Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
 interface MouseEvent : UIEvent {
   readonly attribute long           screenX;
   readonly attribute long           screenY;
   readonly attribute long           clientX;
   readonly attribute long           clientY;
+  [BinaryName="clientX"]
+  readonly attribute long           x;
+  [BinaryName="clientY"]
+  readonly attribute long           y;
   readonly attribute long           offsetX;
   readonly attribute long           offsetY;
   readonly attribute boolean        ctrlKey;
   readonly attribute boolean        shiftKey;
   readonly attribute boolean        altKey;
   readonly attribute boolean        metaKey;
   readonly attribute short          button;
   readonly attribute unsigned short buttons;
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -14911,16 +14911,20 @@
         "path": "cssom-view/elementScroll.html",
         "url": "/cssom-view/elementScroll.html"
       },
       {
         "path": "cssom-view/elementsFromPoint.html",
         "url": "/cssom-view/elementsFromPoint.html"
       },
       {
+        "path": "cssom-view/mouseEvent.html",
+        "url": "/cssom-view/mouseEvent.html"
+      },
+      {
         "path": "cssom-view/negativeMargins.html",
         "url": "/cssom-view/negativeMargins.html"
       },
       {
         "path": "cssom-view/scrolling-no-browsing-context.html",
         "url": "/cssom-view/scrolling-no-browsing-context.html"
       },
       {
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/cssom-view/mouseEvent.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<meta charset=utf-8>
+<head>
+<title>CSSOM MouseEvent tests</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+test(function () {
+    var mouseEvent = new MouseEvent('mousedown', {clientX: 10, clientY: 20});
+    assert_equals(mouseEvent.x, 10);
+    assert_equals(mouseEvent.y, 20);
+    mouseEvent = new MouseEvent('mousedown', {clientX: 30, clientY: 40});
+    assert_equals(mouseEvent.x, 30);
+    assert_equals(mouseEvent.y, 40);
+}, 'MouseEvent\'s x and y must be equal to clientX and clientY.');
+</script>
+</head>