Bug 1292067 - Make width/height of pointer default to 1. f=bevistseng. r=smaug
authorStone Shih <sshih@mozilla.com>
Wed, 10 Aug 2016 13:04:33 +0800
changeset 311202 aebc13fe16b3dfe2f8a3b5cc8e88856fb3b9589d
parent 311201 521e476f0c714ff4e92c7220e81b40e56972f58c
child 311203 ab461807ca14d4ad55d9f83ec975d87065a24419
push id30603
push userkwierso@gmail.com
push dateThu, 25 Aug 2016 23:59:44 +0000
treeherdermozilla-central@8f6cbb5a8f4a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1292067
milestone51.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 1292067 - Make width/height of pointer default to 1. f=bevistseng. r=smaug
dom/events/test/pointerevents/pointerevent_attributes_mouse-manual.html
testing/web-platform/tests/pointerevents/pointerevent_attributes_mouse-manual.html
widget/MouseEvents.h
--- a/dom/events/test/pointerevents/pointerevent_attributes_mouse-manual.html
+++ b/dom/events/test/pointerevents/pointerevent_attributes_mouse-manual.html
@@ -71,16 +71,24 @@
                             }, event.type + "'s ClientX and ClientY attributes are correct.");
                         }
 
                         // Test isPrimary
                         test(function () {
                             assert_equals(event.isPrimary, true, "isPrimary should be true");
                         }, event.type + ".isPrimary attribute is correct.");
 
+                        // Test width and height
+                        test(function () {
+                            assert_equals(event.width, 1, "width of mouse should be 1");
+                        }, event.type + ".width attribute is correct.");
+                        test(function () {
+                            assert_equals(event.height, 1, "height of mouse should be 1");
+                        }, event.type + ".height attribute is correct.");
+
                         check_PointerEvent(event);
                         detected_eventTypes[event.type] = true;
                         if (Object.keys(detected_eventTypes).length == eventList.length)
                             test_pointerEvent.done();
                     });
                 });
             }
         </script>
--- a/testing/web-platform/tests/pointerevents/pointerevent_attributes_mouse-manual.html
+++ b/testing/web-platform/tests/pointerevents/pointerevent_attributes_mouse-manual.html
@@ -70,16 +70,24 @@
                             }, event.type + "'s ClientX and ClientY attributes are correct.");
                         }
 
                         // Test isPrimary
                         test(function () {
                             assert_equals(event.isPrimary, true, "isPrimary should be true");
                         }, event.type + ".isPrimary attribute is correct.");
 
+                        // Test width and height
+                        test(function () {
+                            assert_equals(event.width, 1, "width of mouse should be 1");
+                        }, event.type + ".width attribute is correct.");
+                        test(function () {
+                            assert_equals(event.height, 1, "height of mouse should be 1");
+                        }, event.type + ".height attribute is correct.");
+
                         check_PointerEvent(event);
                         detected_eventTypes[event.type] = true;
                         if (Object.keys(detected_eventTypes).length == eventList.length)
                             test_pointerEvent.done();
                     });
                 });
             }
         </script>
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -680,18 +680,18 @@ public:
     , mWidth(0)
     , mHeight(0)
     , mIsPrimary(true)
   {
   }
 
   explicit WidgetPointerEvent(const WidgetMouseEvent& aEvent)
     : WidgetMouseEvent(aEvent)
-    , mWidth(0)
-    , mHeight(0)
+    , mWidth(1)
+    , mHeight(1)
     , mIsPrimary(true)
   {
     mClass = ePointerEventClass;
   }
 
   virtual WidgetEvent* Duplicate() const override
   {
     MOZ_ASSERT(mClass == ePointerEventClass,