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

179 Коммитов

Автор SHA1 Сообщение Дата
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
Simon Giesecke cb0734d274 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 10:56:57 +00:00
Bogdan Tara c60fd3fdd2 Backed out 4 changesets (bug 1613985) for causing build bustages CLOSED TREE
Backed out changeset fba0caac746c (bug 1613985)
Backed out changeset 8605d7a19107 (bug 1613985)
Backed out changeset 41e858fbf235 (bug 1613985)
Backed out changeset 847433cf1e0a (bug 1613985)
2020-03-16 12:41:41 +02:00
Simon Giesecke 2d961c08ab Bug 1613985 - Use default for equivalent-to-default constructors/destructors in widget. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D66012

--HG--
extra : moz-landing-system : lando
2020-03-16 09:14:12 +00:00
Kartikaya Gupta d633586fcc Bug 1618545 - Delete obsolete/unused code relating to Fennec's experimental ui.zoomedview feature. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65022

--HG--
extra : moz-landing-system : lando
2020-03-03 15:27:50 +00:00
Mihai Alexandru Michis 27d7312e19 Backed out changeset 469d7894f720 (bug 1618545) for causing bustages in src/layout/base/PositionedEventTargeting.cpp
CLOSED TREE
2020-03-03 14:52:13 +02:00
Kartikaya Gupta 432394ae9f Bug 1618545 - Delete obsolete/unused code relating to Fennec's experimental ui.zoomedview feature. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D65022

--HG--
extra : moz-landing-system : lando
2020-03-02 21:53:50 +00:00
Masayuki Nakano 87ca855ece Bug 1603074 - part 1: Make `synthesizePlainDragAndDrop()` synthesize drag events without `DataTransfer` object r=smaug
`synthesizePlainDragAndDrop()` synthesizes drag events with `DataTransfer`
object which is set to `DragEvent.dataTransfer` of `dragstart` after starting
drag session explicitly.  However, this causes
`EventStateManager::DoDefaltDragStart()` does not initialize `nsIDragService`
instance.  Therefore, synthesized drag events cannot work with editor because
`DragEvent::GetMozSourceNode()` returns `nullptr` due to
`nsIDragSession::GetSourceNode()` returning `nullptr`.

On the other hand, synthesized drag events cannot use
`nsIDragService::InvodeDragSession()` normally because of hitting an assertion.
https://searchfox.org/mozilla-central/rev/690e903ef689a4eca335b96bd903580394864a1c/widget/nsBaseDragService.cpp#230-233

This patch does:
- mark drag events caused by synthesized mouse events as "synthesized for tests"
- make `synthesizePlainDragAndDrop()` stop using
  `nsIDragService.startDragSession()`
- make `nsBaseDragService` initialize and start session even for synthesized
  `dragstart` event
- make `synthesizePlainDragAndDrop()` stop synthesizing drag events with
  `DataTransfer` object since it's normal behavior and it'll be initialized
  with `nsIDragService::GetDataTransfer()`
- make `nsBaseDragService` store `effectAllowed` for the session only when
  it's synthesized session because it's required at initializing synthesized
  default `dropEffect` value of `dragenter`, `dragover`, `dragexit` and `drop`
  events' `dataTransfer`
- make all tests which use `nsIDragService.startDragSession()` use new
  API, `nsIDragService.startDragSessionForTests()` to initialize session's
  `effectAllowed` value
- make `EventStateManager::PostHandleEvent()` set drag end point of the test
  session to `eDrop` event's screen point
- make `synthesizePlainDragAndDrop()` set drag end point of the session if
  it does not synthesize `drop` event because following `endDragSession()`
  use it at dispatching `dragend` event on the source element

Additionally, this adds `dumpFunc` new param to `synthesizePlainDragAndDrop()`
because it's really useful to investigate the reason why requesting DnD isn't
performed as expected.

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

--HG--
extra : moz-landing-system : lando
2019-12-21 12:27:06 +00:00
Kartikaya Gupta a8a0dd9a5a Bug 1524232 - Add a mechanism for dispatching synthesized mousemove events to an OOP iframe. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D29731

--HG--
extra : moz-landing-system : lando
2019-05-06 08:12:21 +00:00
Srujana Peddinti b44e48bff4 Bug 1259660 - Moved mozilla::WidgetMosueEventBase::buttonType in MouseEvents.h to mozilla::MouseButton in EventForwards.h, and mozilla::WidgetMouseEventBase::buttonsFlag to mozilla::MouseButtonsFlag r=masayuki
Moved mozilla::WidgetMosueEventBase::buttonType in MouseEvents.h to mozilla::MouseButton in EventForwards.h, and mozilla::WidgetMouseEventBase::buttonsFlag to mozilla::MouseButtonsFlag so that any referer in header files do not need to include MouseEvents.h only for referring them. Instead, they just need to include EventForwards.h. Now when MouseEvents.h is changed, the rebuild speed becomes faster.

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

--HG--
extra : moz-landing-system : lando
2019-04-21 20:13:34 +00:00
Srujana Peddinti 13cf06cfb2 Bug 1259660 - Reordered the member definition in the class WidgetMouseEventBase to reduce the instance size. r=masayuki
To reduce the instance size, reordered the member definition in the class WidgetMouseEventBase, in the decreasing order of alignment size (alignof() value) to optimize the packing.

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

--HG--
extra : moz-landing-system : lando
2019-04-21 18:20:58 +00:00
Srujana Peddinti 1557978a85 Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::region to WidgetMouseEventBase::mRegion r=masayuki
Renamed all class member instances from WidgetMouseEventBase::region to WidgetMouseEventBase::mRegion

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

--HG--
extra : moz-landing-system : lando
2019-04-21 18:20:22 +00:00
Srujana Peddinti 0260a4f6e1 Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::inputSource to WidgetMouseEventBase::mInputSource r=masayuki
Renamed all class member instances from WidgetMouseEventBase::inputSource to WidgetMouseEventBase::mInputSource

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

--HG--
extra : moz-landing-system : lando
2019-04-21 18:19:43 +00:00
Srujana Peddinti aa45d8b79b Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::hitCluster to WidgetMouseEventBase::mHitCluster r=masayuki
Renamed all class member instances from WidgetMouseEventBase::hitCluster to WidgetMouseEventBase::mHitCluster

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

--HG--
extra : moz-landing-system : lando
2019-04-21 18:19:20 +00:00
Srujana Peddinti 1f5de9021a Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::pressure to WidgetMouseEventBase::mPressure r=masayuki
Renamed all class member instances from WidgetMouseEventBase::pressure to WidgetMouseEventBase::mPressure

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

--HG--
extra : moz-landing-system : lando
2019-04-21 18:19:18 +00:00
Srujana Peddinti 5f185eb5aa Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::button to WidgetMouseEventBase::mButton. r=masayuki
Renamed all class member instances from WidgetMouseEventBase::button to WidgetMouseEventBase::mButton.

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

--HG--
extra : moz-landing-system : lando
2019-04-21 18:17:10 +00:00
Srujana Peddinti 614949385a Bug 1259660 - Cleaned up WidgetMouseEventBase by renaming WidgetMouseEventBase::buttons to WidgetMouseEventBase::mButtons r=masayuki
Renamed all class member instances from  WidgetMouseEventBase::buttons to WidgetMouseEventBase::mButtons

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

--HG--
extra : moz-landing-system : lando
2019-04-21 19:42:37 +00:00
Ian Moody 99a41b5b92 Bug 1379466 - Add override pref to restore legacy non-primary click dispatch on specific domains. r=smaug
If needed for web-compat.
Also stop dispatching auxclicks if non-primary click has been preventDefaulted,
so that legacy new-tab prevention can work with the pref flip.

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

--HG--
extra : moz-landing-system : lando
2019-04-18 12:57:37 +00:00
Olli Pettay b977d23eb2 Bug 1089326, make <button> hit testing similar to other elements which may have some content, and for click target find the common (interactive) ancestor, r=masayuki
--HG--
extra : rebase_source : 80caab4e074d552c38b62842fe3102fb6735dfd9
2018-12-11 23:35:40 +02:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Masayuki Nakano fd4e78f2a1 Bug 1461708 - part 5: Move EditorEventListener::HandleMiddleClickPaste() to EventStateManager r=smaug
EventStateManager needs to handle middle click paste without editor.
Therefore, the handler should be in EventStateManager.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:04:17 +00:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Andi-Bogdan Postelnicu 8cc8f8b517 Bug 1453795 - Widget - Initialize member fields in classes/ structures. r=jimm
--HG--
extra : rebase_source : 594fe9396c450401fab4c17e81a3333124f27f58
2018-06-15 17:48:51 +03:00
Tooru Fujisawa 0eaac17a4a Bug 1378585 - Remove unused nsDragDropEventStatus enum. r=masayuki 2018-05-31 15:15:48 +09:00