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

146 Коммитов

Автор SHA1 Сообщение Дата
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
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Zhang Junzhi 414177f87e Bug 1358017 - Part 1: Adds some comments, renames some identifiers and refactors some other trivial things. r=kats,masayuki
Do some work in preparation for implementing actual functionalities for this
bug. No actual functionality change is involved in this commit.

MozReview-Commit-ID: 5aLhr38n1N4

--HG--
extra : rebase_source : 15cfc2cea5b7668367dd3bd4a0746ae8c61b7d20
2018-03-15 16:31:07 +08:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Boris Zbarsky b7f9b8d095 Bug 1446527 part 4. Remove nsIDOMUIEvent::SCROLL_PAGE_* constants. r=qdot
MozReview-Commit-ID: 6F9Q6kOogEo
2018-03-26 14:53:02 -04:00
Boris Zbarsky 89ea512161 Bug 1446711 part 7. Switch the nsIDOMMouseEvent::MOZ_SOURCE_* constants over to MouseEventBinding. r=qdot
We can't include MouseEventBinding.h in MouseEvents.h because that produces
this include loop:

MouseEventBinding.h -> UIEventBinding.h ->
nsGlobalWindow.h -> nsGlobalWindowInner.h -> nsRefreshDriver.h ->
AnimationEventDispatcher.h -> AnimationComparator.h -> Animation.h ->
EffectCompositor.h -> PseudoElementHashEntry.h -> Element.h ->
PointerEventHandler.h -> MouseEvents.h -> MouseEventBinding.h

MozReview-Commit-ID: 6FNksGil7uD
2018-03-20 00:16:06 -04:00
Boris Zbarsky 1a7c5067ca Bug 1446851. Get rid of nsIDOMWheelEvent. r=qdot
We can't include WheelEventBinding.h in MouseEvents.h because that produces
this include loop:

WheelEventBinding.h -> MouseEventBinding.h -> UIEventBinding.h ->
nsGlobalWindow.h -> nsGlobalWindowInner.h -> nsRefreshDriver.h ->
AnimationEventDispatcher.h -> AnimationComparator.h -> Animation.h ->
EffectCompositor.h -> PseudoElementHashEntry.h -> Element.h ->
PointerEventHandler.h -> MouseEvents.h -> WheelEventBinding.h

MozReview-Commit-ID: 5KNwH69aJYW
2018-03-20 00:16:05 -04:00
Olli Pettay ddf5c731fa Bug 1425441 - Move relatedTarget to WidgetEvent, r=stone
--HG--
extra : rebase_source : 75b00efa0af5989e41763fbecac6fd8794c870c6
2017-12-18 19:08:11 +02:00
Stone Shih f54b118ead Bug 1303957 Part1: Add support for PointerEvent.getCoalescedEvents. r=smaug.
We implement PointerEvent.getCoalescedEvents as
1. Clone the widget events we coalesced.
2. Convert them to dom::PointerEvent when user calls getCoalescedEvents.

MozReview-Commit-ID: 8IKw4PbUsDD
2017-09-20 13:00:57 +08:00
Masayuki Nakano 16fd3a84a4 Bug 143038 Make users can scroll contents horizontally with vertical wheel operation with a modifier r=smaug
This patch declares a new default action, "horizontal scroll", this scrolls
content horizontally with deltaY of wheel events and ignores deltaX and deltaZ.
This is used for default action with Shift key in default setting except on
macOS. On macOS, legacy mouse's vertical wheel operation with Shift key causes
native horizontal wheel event.  Therefore, we don't need to use this new
default action on macOS.  Additionally, old default action with Shift key,
navigating history, is moved to with Alt key.  This makes same settings between
macOS and the others.  So, this is better for users who use macOS and another
OS and web app developers who check wheel events only on macOS or other
platform(s).

For simpler implementation, default action handlers moves deltaY values to
deltaX values temporarily *only* while they handle wheel events.  This is
performed by AutoWheelDeltaAdjuster and restored after handling it
automatically.

So, in other words, even if default action is "horizontal scroll", web apps
receives wheel events whose deltaY is not zero but its content will be
scrolled horizontally.  This is same as Chromium, so, this behavior shouldn't
cause any incompatible behavior with it.

MozReview-Commit-ID: E4X3yZzLEAl

--HG--
extra : rebase_source : e20d854c6b0a181ad4c9e7304bd9ad14256481ff
2017-10-05 01:12:35 +09:00
Stone Shih eb9ee92c2d Bug 1323158 - Part 1: Fire pointer and mouse boundary events when capturing the pointer. r=smaug
--HG--
extra : rebase_source : 2895681bb5d0e4872dc37f9d67dc4e2928bdce33
extra : histedit_source : e08adaaf7299e9667eb1f3887ef518c5edf5dc59
2017-01-18 15:25:44 +08:00
Stone Shih 27fc4c155d Bug 1292064 - [Pointer Event] Add digitizer/pen tangential (barrel) pressure and twist. r=smaug 2017-02-09 10:49:00 +08:00
Stone Shih c163f48767 Bug 1323976 - Part 1: Add eNoButton to WidgetMouseEventBase::buttonType. r=smaug
MozReview-Commit-ID: FYUhdfKj5wT

--HG--
extra : rebase_source : ef4959c9dd68d5316cf19c9b726d8b2e8fd33b4e
2017-01-12 17:53:38 +08:00
Stone Shih f60994b515 Bug 1031362 Part1: Dispatching mouse events by handling pen generated WM_POINTER* messages. r=jimm,smaug 2016-11-20 10:24:46 +08:00
Carsten "Tomcat" Book 9b6d97a4be Backed out changeset 1413fa802632 (bug 1031362) for test failures in pointerevents/test_touch_action.html
--HG--
extra : rebase_source : 937d349fb18e2368d4155364558027134c01fec6
2016-12-20 14:52:23 +01:00
Stone Shih d908d1a2d4 Bug 1031362 Part1: Dispatching mouse events by handling pen generated WM_POINTER* messages. r=jimm,smaug 2016-11-20 10:24:46 +08:00
Stone Shih 5abe523179 Bug 1299197 Part1: Refine WidgetPointerHelper. r=smaug
--HG--
extra : rebase_source : bc9feec42fa7e36d5ba5ed7530cd150e1deadd9c
2016-11-20 09:36:39 +08:00
Stone Shih 1063903850 Bug 1304315 - [Pointer Event] Make all pointer events's default width/height to 1. f=bevistseng. r=smaug,masayuki. 2016-09-21 16:26:21 +08:00
Nicholas Nethercote b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
Stone Shih e9962ae1fc Bug 1292067 - Make width/height of pointer default to 1. f=bevistseng. r=smaug
--HG--
extra : rebase_source : a55c4356dadacb2a41b49cde98a31051af6aa9d8
2016-08-10 13:04:33 +08:00
Masayuki Nakano 78b4a701e3 Bug 1259665 part.3 Rename WidgetPointerEvent::isPrimary to mIsPrimary r=smaug
MozReview-Commit-ID: LfKzpwCjMcz

--HG--
extra : rebase_source : d4fd41db8ff4dc39a7156f2f509aae89d1c126a1
2016-08-03 17:34:53 +09:00
Masayuki Nakano b38025c056 Bug 1259665 part.2 Rename WidgetPointerEvent::height to mHeight r=smaug
MozReview-Commit-ID: Ji4X53dByiH

--HG--
extra : rebase_source : 0e79a45d34142453e79f2412eddb7abc132e11d7
2016-08-03 17:23:56 +09:00
Masayuki Nakano 924e7f39e5 Bug 1259665 part.1 Rename WidgetPointerEvent::width to mWidth r=smaug
MozReview-Commit-ID: 3V5gyOvPuQi

--HG--
extra : rebase_source : 6adf7908e8a84bc2cfb86d8f7823662f1b72170f
2016-08-03 17:18:04 +09:00
Masayuki Nakano cbc08975f5 Bug 1259661 part.10 Clean up some nits of WidgetMouseEvent definition r=smaug
MozReview-Commit-ID: 9e4F8gOmRpZ

--HG--
extra : rebase_source : 77582b007ebb9a87925543f044d9af06a5f7c2fa
2016-05-10 21:57:16 +09:00
Masayuki Nakano 3e4ceded8b Bug 1259661 part.9 Rename WidgetMouseEvent::clickCount to WidgetMouseEvent::mClickCount r=smaug
MozReview-Commit-ID: 5tC8UqcfLek

--HG--
extra : rebase_source : a336f9d8676c74804e2c00eebec4f2a30d7a11b3
2016-05-10 23:29:14 +09:00
Masayuki Nakano b2a210c268 Bug 1259661 part.8 Rename WidgetMouseEvent::ignoreRootScrollFrame to WidgetMouseEvent::mIgnoreRootScrollFrame r=smaug
MozReview-Commit-ID: 98G9UMv4qqj

--HG--
extra : rebase_source : e3fed10d5d7b8b3a714e279457192e9f0bc703df
2016-05-10 21:15:05 +09:00
Masayuki Nakano 52b8126bf2 Bug 1259661 part.7 Get rid of WidgetMouseEvent::acceptActivation because of unused r=smaug
MozReview-Commit-ID: ItkudUhGGN4

--HG--
extra : rebase_source : 2f396c1acf032c731d7d875b2a427aaddda1a576
2016-05-10 21:01:15 +09:00
Masayuki Nakano 1663e01f1f Bug 1259661 part.6 Rename WidgetMouseEvent::exit to WidgetMouseEvent::mExitFrom r=smaug
MozReview-Commit-ID: FHUaUOE5eIB

--HG--
extra : rebase_source : f4ff5a5f662054ab161805dc37b9e7b6d6b97d96
2016-05-12 11:42:08 +09:00
Masayuki Nakano 2d6e9e3d48 Bug 1259661 part.5 Rename WidgetMouseEvent::context to WidgetMouseEvent::mContextMenuTrigger r=smaug
MozReview-Commit-ID: GDAAHiyRrhY

--HG--
extra : rebase_source : fe7e3a658192f13f6458f664b35d5937925eca13
2016-05-12 11:39:05 +09:00
Masayuki Nakano 0902859a3a Bug 1259661 part.4 Rename WidgetMouseEvent::reason to WidgetMouseEvent::mReason r=smaug
MozReview-Commit-ID: JaE0S7BIgVF

--HG--
extra : rebase_source : 2d0f80e49dfd09cecc7ab3c85d2496308055d434
2016-05-12 11:36:41 +09:00
Masayuki Nakano 9874716678 Bug 1259661 part.3 Rename WidgetMouseEvent::exitType to WidgetMouseEvent::ExitFrom r=smaug
MozReview-Commit-ID: 8NdDccCrTS7

--HG--
extra : rebase_source : 6c4bf2bceab7638ee25907be7b434f0544dfe325
2016-05-12 11:32:53 +09:00
Masayuki Nakano decf620aaa Bug 1259661 part.2 Rename WidgetMouseEvent::context to WidgetMouseEvent::ContextMenuTrigger r=smaug
MozReview-Commit-ID: 2amULUnzsxc

--HG--
extra : rebase_source : 8b09dfe85fd9e583d378fd2fd167a169b5258175
2016-05-12 11:28:14 +09:00
Masayuki Nakano 22d783b8ac Bug 1259661 part.1 Rename WidgetMouseEvent::reasonType to WidgetMouseEvent::Reason r=smaug
MozReview-Commit-ID: 3bx2Z32rwb1

--HG--
extra : rebase_source : afb94677ccce2c9ae8ffbf63f0c0566d94430773
2016-05-12 11:17:46 +09:00
Stone Shih 547b61eae3 Bug 386743 - Set default event bubbling/cancelable flags in the WidgetEvent constructor. r=smaug 2016-04-13 14:16:42 +08:00