Граф коммитов

202 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano b8f3f296ed Bug 1844723 - Make `CreateMouseOrPointerWidgetEvent()` set `mButton` to "not pressed" value and compute `mButtons` if the source event has not been dispatched yet r=edgar,dom-core
`CreateMouseOrPointerWidgetEvent()` is designed to create `mouseenter`,
`mouseover`, `mouseout`, `mouseleave`, `pointerenter`, `pointerover`,
`pointerout` and `pointerleave` from a source event.

They are not button state change events, but the source event may be so.

According to the WPTs ([1], [2]) and the fact that the other browsers pass the
tests, the button state of pointer events of synthesizing events should be
synchronized with what the web apps notified (i.e., previous state of the
source event) if and only if the input source supports hover state and the
source event which changes a button state has not been dispatched into the DOM
yet.

1. https://searchfox.org/mozilla-central/rev/08d53deb2cf587e68d1825082c955e8a1926be73/testing/web-platform/tests/pointerevents/pointerevent_attributes_hoverable_pointers.html#44,51,60,63
2. https://searchfox.org/mozilla-central/rev/08d53deb2cf587e68d1825082c955e8a1926be73/testing/web-platform/tests/pointerevents/pointerevent_attributes_nohover_pointers.html#17,45,47,51

Differential Revision: https://phabricator.services.mozilla.com/D187644
2023-10-10 07:33:05 +00:00
Gregory Pappas 321f6d0ea4 Bug 1853832 - Remove dom.mouseevent.click.hack.use_legacy_non-primary_dispatch pref r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D188638
2023-09-20 08:38:04 +00:00
Sean Feng 4379a8876c Bug 1848409 - Tweak the UpdateDefaultPreventedOnContent call to only special case the HTMLEditorEventListener case r=masayuki,dom-core
Calling `UpdateDefaultPreventedOnContent` separately from
`PreventDefault()` is error-prone. This patch should make it
safer.

Differential Revision: https://phabricator.services.mozilla.com/D186052
2023-08-15 13:46:42 +00:00
Olli Pettay 32d9cd7454 Bug 1815273 - WidgetEvent::Duplicate triggers extra TimeStamp::Now() call, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D185608
2023-08-09 10:29:39 +00:00
Sean Feng caee73fc75 Bug 1817723 - Allow HTMLEditor can receive events when the focus is switched between elements in the same shadow tree. r=masayuki
The EditorEventListener for HTMLEditor is registered on document,
which is problematic because it can't receive events when the focus is
switched between elements in the same shadow tree due to shadow dom
encapsulation.

We fix this by moving the EditorEventListener to nsWindowRoot so the
events can always be received.

Differential Revision: https://phabricator.services.mozilla.com/D178215
2023-07-07 14:55:28 +00:00
Norisz Fay ace9aded9a Backed out changeset f9f8e7cfe057 (bug 1817723) as requested by dev for causing regressions CLOSED TREE 2023-06-27 01:22:11 +03:00
Sean Feng ddb6212fd9 Bug 1817723 - Allow HTMLEditor can receive events when the focus is switched between elements in the same shadow tree. r=masayuki
The EditorEventListener for HTMLEditor is registered on document,
which is problematic because it can't receive events when the focus is
switched between elements in the same shadow tree due to shadow dom
encapsulation.

We fix this by moving the EditorEventListener to nsWindowRoot so the
events can always be received.

Differential Revision: https://phabricator.services.mozilla.com/D178215
2023-06-19 17:58:15 +00:00
Sandor Molnar c06a989790 Backed out changeset 6a96bb1f430f (bug 1817723) for causing reftest crashes. CLOSED TREE 2023-05-24 17:31:13 +03:00
Sean Feng a7d8029535 Bug 1817723 - Allow HTMLEditor can receive events when the focus is switched between elements in the same shadow tree. r=masayuki
The EditorEventListener for HTMLEditor is registered on document,
which is problematic because it can't receive events when the focus is
switched between elements in the same shadow tree due to shadow dom
encapsulation.

We fix this by moving the EditorEventListener to nsWindowRoot so the
events can always be received.

Differential Revision: https://phabricator.services.mozilla.com/D178215
2023-05-24 13:31:57 +00:00
Sandor Molnar c7daca2e34 Backed out changeset e8b6a5dbf398 (bug 1817723) for causing mochitest failures in editor/libeditor/EditorEventListener.cpp CLOSED TREE 2023-05-24 10:03:39 +03:00
Sean Feng df6c9aefca Bug 1817723 - Allow HTMLEditor can receive events when the focus is switched between elements in the same shadow tree. r=masayuki
The EditorEventListener for HTMLEditor is registered on document,
which is problematic because it can't receive events when the focus is
switched between elements in the same shadow tree due to shadow dom
encapsulation.

We fix this by moving the EditorEventListener to nsWindowRoot so the
events can always be received.

Differential Revision: https://phabricator.services.mozilla.com/D178215
2023-05-23 22:57:16 +00:00
Emilio Cobos Álvarez 3d092ba60e Bug 1775062 - Implement ipdl reads without needing default ctors. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D149743
2023-02-04 11:12:36 +00:00
Edgar Chen 66a41e0e4c Bug 1809918 - Make WidgetPointerHelper use int32_t for twist; r=smaug
For Windows, the `twist` is from `POINTER_PEN_INFO::rotation`, https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer_pen_info,
which is `UINT32`, but the value is normalized in a range of 0 to 359, so it is
safe to convert into `int32_t`.

For Mac, the `twist` is from `NSEvent::rotation`, https://developer.apple.com/documentation/appkit/nsevent,
which is `Float`, but we normalize it in a range of 0 to 359.

Differential Revision: https://phabricator.services.mozilla.com/D166726
2023-01-13 08:35:44 +00:00
Edgar Chen 56e854ac62 Bug 1809918 - Make WidgetPointerHelper use int32_t for tiltX/tiltY; r=smaug
For Windows, the `tiltX`/`tiltY` are from `POINTER_PEN_INFO::tiltX`/`tiltY`,
https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-pointer_pen_info,
which are `INT32`.

For Mac, the `tiltX`/`tiltY` are from `NSEvent::tilt`, https://developer.apple.com/documentation/appkit/nsevent,
which is a `CGPoint`, https://developer.apple.com/documentation/corefoundation/cgpoint,
the properties are `Double`, using `int32_t` still makes more sense.

Differential Revision: https://phabricator.services.mozilla.com/D166725
2023-01-13 08:35:44 +00:00
Edgar Chen bacb13e934 Bug 1809920 - Make WidgetPointerEvent use int32_t for mWidth/mHeight; r=smaug
The value are assigned from `Touch::mRadius`, https://searchfox.org/mozilla-central/rev/893a8f062ec6144c84403fbfb0a57234418b89cf/dom/events/PointerEventHandler.cpp#550-551,
which is a `IntPointTyped<LayoutDevicePixel>`, https://searchfox.org/mozilla-central/rev/893a8f062ec6144c84403fbfb0a57234418b89cf/gfx/2d/Point.h#66.

Differential Revision: https://phabricator.services.mozilla.com/D166696
2023-01-12 20:17:51 +00:00
Hiroyuki Ikezoe 9a4979471f Bug 1794070 - Drop "OS X" or macOS in comments about swipe-to-navigation. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D160430
2022-11-22 06:52:48 +00:00
Butkovits Atila 887a77ba5f Backed out 13 changesets (bug 1794070) for causing failures at browser_test_swipe_gesture.js. CLOSED TREE
Backed out changeset afe487b23e1c (bug 1794070)
Backed out changeset b119052f690d (bug 1794070)
Backed out changeset 733188f6b7ca (bug 1794070)
Backed out changeset 53273c86140a (bug 1794070)
Backed out changeset e2e39e61efbe (bug 1794070)
Backed out changeset 93b240feb781 (bug 1794070)
Backed out changeset 78aea5c32e14 (bug 1794070)
Backed out changeset 158008a6363b (bug 1794070)
Backed out changeset 3c3e76c8bf49 (bug 1794070)
Backed out changeset 39beb7abc321 (bug 1794070)
Backed out changeset 0ded01fbbd9e (bug 1794070)
Backed out changeset cf4552e5e11b (bug 1794070)
Backed out changeset 317ee240609d (bug 1794070)
2022-11-21 13:41:34 +02:00
Hiroyuki Ikezoe 7b3134f7c1 Bug 1794070 - Drop "OS X" or macOS in comments about swipe-to-navigation. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D160430
2022-11-21 03:10:04 +00:00
Emilio Cobos Álvarez 92c9ff22dc Bug 1780385 - Remove canvas hit region api. r=jrmuizel
Add a pref for MouseEvent.region since that wasn't un-exposed. No other
browser supports it so we can probably safely remove it, but just in
case.

Differential Revision: https://phabricator.services.mozilla.com/D152274
2022-07-20 16:52:47 +00:00
Emilio Cobos Álvarez 9d910cfbd7 Bug 1749172 - Fix typo (SCROLL_ASYNCHRONOUSELY -> SCROLL_ASYNCHRONOUSLY) in MouseEvents.h. r=hiro
I was looking at related code and this threw me off a bit.

Differential Revision: https://phabricator.services.mozilla.com/D135454
2022-01-10 21:57:20 +00:00
Edgar Chen 60774151e2 Bug 1511231 - Part 1: Remove unused constructor from WidgetPointerEvent; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D122588
2021-08-19 13:27:12 +00:00
Alexandru Michis b8a9a605d8 Backed out 4 changesets (bug 1511231) for causing cpp bustages in CoalescedTouchData.cpp
CLOSED TREE

Backed out changeset 79dc991bfa6c (bug 1511231)
Backed out changeset 94a5ef68aac3 (bug 1511231)
Backed out changeset bc913eaeeff2 (bug 1511231)
Backed out changeset fa0e4e205617 (bug 1511231)
2021-08-19 13:19:11 +03:00
Edgar Chen 7f683ab692 Bug 1511231 - Part 1: Remove unused constructor from WidgetPointerEvent; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D122588
2021-08-19 09:08:19 +00:00
Emilio Cobos Álvarez 36b7e1c765 Bug 1708829 - Expose WheelEvent.wheelDelta{,X,Y} for compat with other engines. r=masayuki
The behavior for non-trusted events matches Safari (Chrome does return
deltaX in that case, which seems pretty bogus, because the sign of the
wheelDelta* is the opposite as the delta* props).

Differential Revision: https://phabricator.services.mozilla.com/D114052
2021-05-14 15:17:33 +00:00
Sandor Molnar 7b4d940c00 Backed out 2 changesets (bug 1708829) for causing mochitest plain failures in test_continuous_wheel_events. CLOSED TREE
Backed out changeset 28faebd5fc72 (bug 1708829)
Backed out changeset 044c2060da7d (bug 1708829)
2021-05-14 17:12:03 +03:00
Emilio Cobos Álvarez cbcedecf48 Bug 1708829 - Expose WheelEvent.wheelDelta{,X,Y} for compat with other engines. r=masayuki
The behavior for non-trusted events matches Safari (Chrome does return
deltaX in that case, which seems pretty bogus, because the sign of the
wheelDelta* is the opposite as the delta* props).

Differential Revision: https://phabricator.services.mozilla.com/D114052
2021-05-14 12:41:30 +00:00
Edgar Chen 6b87b447c5 Bug 1697769 - Apply implicit pointer capture only for pointer events that are generated from the touch events; r=smaug
Pointer capture would override the capturing content set in PresShell for mouse
event, it isn't affect touch event because dispatching touch event would take
the capturing content in PresShell into account, i.e.
https://searchfox.org/mozilla-central/rev/fa48ebee58d59fa846919c3e2c3122b08db57c9c/layout/base/PresShell.cpp#8712-8719

Touch input isn't always generating a touch event, but a compabitility mouse
event with the touch as inputsource, e.g. chrome popup window on Windows platform,
see https://searchfox.org/mozilla-central/rev/3de2db87f3c9001ae478318d47a2ca3427574382/widget/windows/nsWindow.cpp#8130-8134
In such case, we don't apply implicit pointer capture to prevent the capturing
content set in PresShell being overried which could cause the drag to scroll
doesn't work.

Differential Revision: https://phabricator.services.mozilla.com/D111085
2021-04-13 13:14:12 +00:00
Markus Stange 53b0e331c3 Bug 1701108 - Split this assertion up into three assertions that are easier to understand. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D109825
2021-03-26 02:06:53 +00:00
Masayuki Nakano 7653ddaefd Bug 1528289 - part 2: Dispatch same events on the web contents when autoscroll is canceled with a click r=Gijs,edgar
Chrome behaves like this:

1. When user starts autoscroll with a middle click, `mousedown` and `mouseup`
   are fired, but `auxclick` nor `paste` event is not fired.
2. When user ends autoscroll with a left click, only `mouseup` event is fired.
   I.e, `mousedown` nor `click` event is not fired.
3. When user ends autoscroll with a middle click, only `mouseup` event is fired.
   I.e., `mousedown`, `auxclick` nor `paste` events is not fired.
4. When user ends autoscroll with a right click, `mouseup` and `contextmenu`
   events are fired, but `mousedown` and `auxclick` events are not fired.

This patch emulates these Chrome's behavior as far as possible.  However,
unfortunately, we cannot do exactly same behavior without some big patches
because each widget (`nsWindow` or `nsChildView`) discards a mouse event
which rolled up a widget before dispatching it into the DOM.  Therefore,
for now, this patch does not fix the following issues:

1. `mousedown` event is not fired in content when clicking outside the
   autoscroller to close it except when pressing the secondary button or on any
   buttons on Linux.
2. `mouseup` event is not fired in content when clicking outside the
   autoscroller to close it except when pressing the primary button macOS.
3. `click` event and `auxclick` events are fired when clicking outside the
   autoscroller with the secondary button.

So, the middle button `click`/`auxclick` events and `paste` event which is
reported to the bug won't be fired with this patch.  I'll file follow up bugs.

Differential Revision: https://phabricator.services.mozilla.com/D104652
2021-03-23 19:22:48 +00:00
Emilio Cobos Álvarez f36c63a891 Bug 1684001 - Add a pref-based blocklist to control default deltaMode. r=masayuki
Depends on D107456

Differential Revision: https://phabricator.services.mozilla.com/D107457
2021-03-09 01:59:43 +00:00
Emilio Cobos Álvarez 757f7268c6 Bug 1675949 - Use a non-fixed value for pixel deltas. r=masayuki
Your call if you think this is worth it. Might need some test
adjustments.

Differential Revision: https://phabricator.services.mozilla.com/D107199
2021-03-08 00:24:04 +00:00
Alexandru Michis 4cff4186cb Backed out changeset 2d9ef4afb05d (bug 1675949) for causing mochitest plain failures in test_dom_wheel_event.html
CLOSED TREE
2021-03-05 05:51:36 +02:00
Emilio Cobos Álvarez e1a48f33c9 Bug 1675949 - Use a non-fixed value for pixel deltas. r=masayuki
Your call if you think this is worth it. Might need some test
adjustments.

Differential Revision: https://phabricator.services.mozilla.com/D107199
2021-03-05 02:28:21 +00:00
Sebastian Hengst 7916a12f4f Backed out 2 changesets (bug 1528289) for breaking navigation with clicks after user scrolled by clicking with middle mouse button. a=backout
Backed out changeset 33c7b633ada2 (bug 1528289)
Backed out changeset be5cf87707f9 (bug 1528289)
2021-03-03 14:29:12 +01:00
Masayuki Nakano 77d74d9e73 Bug 1528289 - part 2: Dispatch same events on the web contents when autoscroll is canceled with a click r=Gijs,edgar
Chrome behaves like this:

1. When user starts autoscroll with a middle click, `mousedown` and `mouseup`
   are fired, but `auxclick` nor `paste` event is not fired.
2. When user ends autoscroll with a left click, only `mouseup` event is fired.
   I.e, `mousedown` nor `click` event is not fired.
3. When user ends autoscroll with a middle click, only `mouseup` event is fired.
   I.e., `mousedown`, `auxclick` nor `paste` events is not fired.
4. When user ends autoscroll with a right click, `mouseup` and `contextmenu`
   events are fired, but `mousedown` and `auxclick` events are not fired.

This patch emulates these Chrome's behavior as far as possible.  However,
unfortunately, we cannot do exactly same behavior without some big patches
because each widget (`nsWindow` or `nsChildView`) discards a mouse event
which rolled up a widget before dispatching it into the DOM.  Therefore,
for now, this patch does not fix the following issues:

1. `mousedown` event is not fired in content when clicking outside the
   autoscroller to close it except when pressing the secondary button or on any
   buttons on Linux.
2. `mouseup` event is not fired in content when clicking outside the
   autoscroller to close it except when pressing the primary button macOS.
3. `click` event and `auxclick` events are fired when clicking outside the
   autoscroller with the secondary button.

So, the middle button `click`/`auxclick` events and `paste` event which is
reported to the bug won't be fired with this patch.  I'll file follow up bugs.

Differential Revision: https://phabricator.services.mozilla.com/D104652
2021-03-01 22:57:07 +00:00
Edgar Chen f8fb06fea1 Bug 1662363 - Rename eTopLevel/eChild to ePlatformTopLevel/ePlatformChild; r=smaug
This is a follow-up of bug 1653949.

Differential Revision: https://phabricator.services.mozilla.com/D100729
2021-01-05 09:48:24 +00:00
Edgar Chen e4efe37095 Bug 1653949 - Part 4: Add MouseExitFromWidget event to the delayed event queue if event handling is suppressed; r=smaug
So that we won't lost it if it happens in nested event loop.

Differential Revision: https://phabricator.services.mozilla.com/D86953
2020-08-27 17:19:07 +00:00
Edgar Chen 85d4338685 Bug 1653949 - Part 3: Dispatch MouseExitFromWidget event with proper ExitFrom type based on the "direction" of movement; r=smaug
There are three cases,
- Move to inner OOP frame.
- Move to outer OOP frame.
- Move to an OOP frame that is in different sub-tree.

We could use common BrowserParent ancestor to determine which case is and
dispatch MouseExitFromWidget event with proper ExitFrom type.

Depends on D84748

Differential Revision: https://phabricator.services.mozilla.com/D84761
2020-08-29 21:11:41 +00:00
Edgar Chen 55691da377 Bug 1653949 - Part 2: Add ePuppet to WidgetMouseEvent::ExitFrom; r=smaug
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.

Differential Revision: https://phabricator.services.mozilla.com/D84748
2020-08-27 17:19:14 +00:00
Edgar Chen 36ccda1d13 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-27 17:19:03 +00:00
Cosmin Sabou 403893bc7e Backed out 5 changesets (bug 1653949) for assertion failures on EventStateManager.cpp. CLOSED TREE
Backed out changeset ad7c35ab2a40 (bug 1653949)
Backed out changeset 31cb90ef998a (bug 1653949)
Backed out changeset 03e65cbd2a11 (bug 1653949)
Backed out changeset a87ac2a7db70 (bug 1653949)
Backed out changeset 390dd2c04cd4 (bug 1653949)
2020-08-27 20:13:20 +03:00
Edgar Chen bc49d1ce72 Bug 1653949 - Part 4: Add MouseExitFromWidget event to the delayed event queue if event handling is suppressed; r=smaug
So that we won't lost it if it happens in nested event loop.

Differential Revision: https://phabricator.services.mozilla.com/D86953
2020-08-25 23:27:21 +00:00
Edgar Chen bbb093555e Bug 1653949 - Part 3: Dispatch MouseExitFromWidget event with proper ExitFrom type based on the "direction" of movement; r=smaug
There are three cases,
- Move to inner OOP frame.
- Move to outer OOP frame.
- Move to an OOP frame that is in different sub-tree.

We could use common BrowserParent ancestor to determine which case is and
dispatch MouseExitFromWidget event with proper ExitFrom type.

Differential Revision: https://phabricator.services.mozilla.com/D84761
2020-08-27 11:48:30 +00:00
Edgar Chen c4125fd9d4 Bug 1653949 - Part 2: Add ePuppet to WidgetMouseEvent::ExitFrom; r=smaug
eTopLevel is reused in content process to indicates that the mouse leaves
the puppet widget rendering area, now we add a separated type, ePuppet, for it.

Differential Revision: https://phabricator.services.mozilla.com/D84748
2020-08-26 20:31:46 +00:00
Edgar Chen 363e80d673 Bug 1653949 - Part 1: Change mExitFrom in WidgetMouseEvent to be Maybe<ExitFrom>; r=smaug
mExitFrom now contains a value only when mMessage is eMouseExitFromWidget

Differential Revision: https://phabricator.services.mozilla.com/D88225
2020-08-26 14:19:46 +00:00
Kagami Sascha Rosylight 994a3b64f9 Bug 1643464 - Part 2: Rename eLeft/eRightFlag to ePrimary/eSecondaryFlag r=masayuki,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D80332
2020-06-22 22:54:07 +00:00
Kagami Sascha Rosylight 166f2891a2 Bug 1643464 - Part 1: Rename eLeft/eRight to ePrimary/eSecondary r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D80331
2020-06-19 18:02:41 +00:00
Edgar Chen acf69e7f98 Bug 1640139 - Don't dispatch contextmenu event triggered from control-left-click as right-button in Mac; r=masayuki
All other browsers dispatch contextmenu as left-button in this case.

Differential Revision: https://phabricator.services.mozilla.com/D76493
2020-05-26 13:11:45 +00:00
Simon Giesecke e6422e2afd Bug 1626570 - Remove obsolete copy enabling machinery. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D72176
2020-05-11 08:23:03 +00:00
Simon Giesecke 58d0171406 Bug 1620632 - Ensure nsTArray_Impl only declares a copy-constructor/assignment operator if E is copy-constructible. r=froydnj
To correctly implement this, it must be known on instantiation whether E is
copy-constructible, which is not the case if only a forward declaration is
available. This can be resolved either by making sure a full definition of E is
available, which is preferable. But in cases where this is not (easily) possible,
the information can be explicitly provided by the MOZ_DECLARE_COPY_CONSTRUCTIBLE
and MOZ_DECLARE_NON_COPY_CONSTRUCTIBLE macros. In particular, declarations for
IPDL-declared types are added to nsTArray.h itself, like it was already done
for MOZ_DECLARE_RELOCATE_USING_MOVE_CONSTRUCTOR.

Differential Revision: https://phabricator.services.mozilla.com/D66244

--HG--
extra : moz-landing-system : lando
2020-03-20 17:13:51 +00:00