Bug 1304315 - [Pointer Event] Make all pointer events's default width/height to 1. f=bevistseng. r=smaug,masayuki.
authorStone Shih <sshih@mozilla.com>
Wed, 21 Sep 2016 16:26:21 +0800
changeset 317431 0edddcd4c24bfe075677520b3ed38c798e993265
parent 317430 db30a41cbab583183b5e1b72b2c64cef84e92809
child 317432 9fd0ce9fbf2bb74c2d922c59150ec49ba0e6f627
push id82648
push usercbook@mozilla.com
push dateTue, 11 Oct 2016 14:24:01 +0000
treeherdermozilla-inbound@9fd0ce9fbf2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, masayuki
bugs1304315
milestone52.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 1304315 - [Pointer Event] Make all pointer events's default width/height to 1. f=bevistseng. r=smaug,masayuki.
dom/events/test/pointerevents/mochitest.ini
dom/webidl/PointerEvent.webidl
testing/web-platform/meta/pointerevents/pointerevent_constructor.html.ini
widget/MouseEvents.h
--- a/dom/events/test/pointerevents/mochitest.ini
+++ b/dom/events/test/pointerevents/mochitest.ini
@@ -12,17 +12,16 @@ support-files =
   support-files = pointerevent_capture_mouse-manual.html
 [test_pointerevent_capture_suppressing_mouse-manual.html]
   support-files = pointerevent_capture_suppressing_mouse-manual.html
 [test_pointerevent_change-touch-action-onpointerdown_touch-manual.html]
   support-files = pointerevent_change-touch-action-onpointerdown_touch-manual.html
   disabled = disabled
 [test_pointerevent_constructor.html]
   support-files = pointerevent_constructor.html
-  disabled = should be investigated
 [test_pointerevent_element_haspointercapture-manual.html]
   support-files = pointerevent_element_haspointercapture-manual.html
 [test_pointerevent_element_haspointercapture_release_pending_capture-manual.html]
   support-files = pointerevent_element_haspointercapture_release_pending_capture-manual.html
 [test_pointerevent_gotpointercapture_before_first_pointerevent-manual.html]
   support-files = pointerevent_gotpointercapture_before_first_pointerevent-manual.html
 [test_pointerevent_lostpointercapture_for_disconnected_node-manual.html]
   support-files = pointerevent_lostpointercapture_for_disconnected_node-manual.html
--- a/dom/webidl/PointerEvent.webidl
+++ b/dom/webidl/PointerEvent.webidl
@@ -21,17 +21,17 @@ interface PointerEvent : MouseEvent
   readonly attribute long tiltY;
   readonly attribute DOMString pointerType;
   readonly attribute boolean isPrimary;
 };
 
 dictionary PointerEventInit : MouseEventInit
 {
   long pointerId = 0;
-  long width = 0;
-  long height = 0;
+  long width = 1;
+  long height = 1;
   float pressure = 0;
   long tiltX = 0;
   long tiltY = 0;
   DOMString pointerType = "";
   boolean isPrimary = false;
 };
 
--- a/testing/web-platform/meta/pointerevents/pointerevent_constructor.html.ini
+++ b/testing/web-platform/meta/pointerevents/pointerevent_constructor.html.ini
@@ -1,9 +1,3 @@
 [pointerevent_constructor.html]
   type: testharness
   prefs: [dom.w3c_pointer_events.enabled:true]
-  [default width]
-    expected: FAIL
-
-  [default height]
-    expected: FAIL
-
--- a/widget/MouseEvents.h
+++ b/widget/MouseEvents.h
@@ -660,29 +660,29 @@ private:
  ******************************************************************************/
 
 class WidgetPointerEvent : public WidgetMouseEvent
 {
   friend class mozilla::dom::PBrowserParent;
   friend class mozilla::dom::PBrowserChild;
 
   WidgetPointerEvent()
-    : mWidth(0)
-    , mHeight(0)
+    : mWidth(1)
+    , mHeight(1)
     , mIsPrimary(true)
   {
   }
 
 public:
   virtual WidgetPointerEvent* AsPointerEvent() override { return this; }
 
   WidgetPointerEvent(bool aIsTrusted, EventMessage aMsg, nsIWidget* w)
     : WidgetMouseEvent(aIsTrusted, aMsg, w, ePointerEventClass, eReal)
-    , mWidth(0)
-    , mHeight(0)
+    , mWidth(1)
+    , mHeight(1)
     , mIsPrimary(true)
   {
   }
 
   explicit WidgetPointerEvent(const WidgetMouseEvent& aEvent)
     : WidgetMouseEvent(aEvent)
     , mWidth(1)
     , mHeight(1)