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

111 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 5c47cf2ccf Bug 1461708 - part 8: Make EventStateManager handle middle click paste as a default action of mouseup event r=smaug
This patch makes EventStateManager handle middle click paste as a default
action.

Unfortunately, we cannot remove the call of HandleMiddleClickPaste() in
EditorEventListener because it's important to consume middle click event
before any elements in the editor.  For example, if clicked HTMLEditor has
non-editable <a href> element, middle click event needs to be handled by the
editor rather than contentAreaUtils which handles click events of <a href>
elements.  The cause of this kind of issues is, any click event handlers
which handle non-primary button events still listen to "click" events.
Therefore, this patch makes HandleMiddleClickPaste() do nothing if the mouseup
event is fired on an editor.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:06:17 +00: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
Masayuki Nakano 4bc3e93065 Bug 1461708 - part 3: EventStateManager::InitAndDispatchClickEvent() shouldn't overwrite nsEventStatus with nsEventStatus_eIgnore r=smaug
EventStateManager::InitAndDispatchClickEvent() sends given nsEventStatus to
nsIPresShell::HandleEventWithTarget().  Then, it sends the status to
EventStateManager::PreHandleEvent() before dispatching the event.  At this
time, EventStateManager::PreHandleEvent() resets the state to
nsEventStatus_eIgnore.  Therefore, for example, if eMouseClick event is
consumed but eMouseAuxClick is ignored, the event status result is
nsEventStatus_eIgnore.  So, neither DispatchClickEvents() nor
PostMouseUpEventHandler() cannot check whether at least one click event
is consumed.

This patch makes EventStateManager::InitAndDispatchClickEvent() sends
local variable of nsEventStatus to nsIPresShell::HandleEventWithTarget().
Then, merge the result with current status.

If we'd change nsEventStatus to enum class, we could make this change as
custom "operator|=" or something.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:02:50 +00:00
Masayuki Nakano bfb564efb0 Bug 1461708 - part 2: Split EventStateManager::CheckForAndDispatchClick() r=smaug
This patch splits EventStateManager::CheckForAndDispatchClick().  One is for
handling default action of eMouseUp, the other is for dispatching click events.

This makes it easier to add other default actions after dispatching click
events.

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

--HG--
extra : moz-landing-system : lando
2018-10-10 12:01:57 +00:00
Xidorn Quan 30703bafcb Bug 1490539 part 1 - Change FullScreen to Fullscreen in various names. r=smaug
Some methods on Window are not changed because they are part of public
interface. Method names from widget are also unchanged.

Many "full-screen" in comments are also updated to "fullscreen" instead.

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

--HG--
extra : moz-landing-system : lando
2018-09-12 15:51:30 +00:00
Emilio Cobos Álvarez 14f2acc019 Bug 1461299: Make ESM not point to unbound NAC in the hover / active chain. r=smaug
MozReview-Commit-ID: 8mL7Yv3TwQM
2018-05-15 10:43:46 +02:00
Brindusan Cristian 1ff93ba361 Backed out 3 changesets (bug 1461299, bug 1460101) for reftest failures on events/EventStateManager.cpp CLOSED TREE
Backed out changeset fe2b8fcd7a47 (bug 1461299)
Backed out changeset 9a0ca81ddbce (bug 1461299)
Backed out changeset 783cf8b58ba4 (bug 1460101)
2018-05-15 03:13:29 +03:00
Emilio Cobos Álvarez ad6bf63946 Bug 1461299: Make ESM not point to unbound NAC in the hover / active chain. r=smaug
MozReview-Commit-ID: 8mL7Yv3TwQM
2018-05-15 01:17:34 +02:00
Brindusan Cristian 9fc8262d75 Backed out 2 changesets (bug 1461299) for debug crashtest failures on crashtests/626014.xhtml CLOSED TREE
Backed out changeset 699e9816b7ff (bug 1461299)
Backed out changeset 48f01ac94137 (bug 1461299)
2018-05-15 01:31:13 +03:00
Emilio Cobos Álvarez cf0ce82b71 Bug 1461299: Make ESM not point to unbound NAC in the hover / active chain. r=smaug
MozReview-Commit-ID: 8mL7Yv3TwQM
2018-05-14 21:55:09 +02:00
Boris Zbarsky 921ee1d522 Bug 1387143 part 4. Stop using nsISelection in remaining xpidl. r=mats 2018-05-08 13:52:36 -04:00
Boris Zbarsky 3463812125 Bug 1387143 part 2. Stop using nsISelection in nsIDocumentEncoder. r=mats 2018-05-08 13:52:36 -04:00
Chris Pearce a9c4bffcaf Bug 1456322 - Don't gesture activate documents on Android for touchends outside the drag threshold. r=masayuki
On Android, we don't want touches that are pans/scrolls to gesture activate.
So we don't want to gesture activate on touchstart (analogous to
mouse/pointerdown on desktop) as we can't tell in advance whether a touchstart
will turn into a touchmove. So gesture activate on touchend only if the
touchend does not finish further than the drag threshold away from where the
touch started.

This means we won't gesture activate for touches that turn into scroll
gestures, but we will for touches that are taps.

The tests are disabled on Android, so I don't have a test for this yet.

MozReview-Commit-ID: C8YgAfVqUa7

--HG--
extra : rebase_source : 76380871b1aa2a5e1bb04882104ada75f6bb3f5a
2018-04-30 14:45:41 +12:00
Emilio Cobos Álvarez 14dba54ee1 Bug 1459401: Remove unused container argument in EventStateManager::ContentRemoved. r=smaug
MozReview-Commit-ID: HAuTfzuo3iY
2018-05-06 16:38:30 +02:00
Botond Ballo 9033e3e120 Bug 1458063 - Introduce a new wheel action for pinch-zooming. r=kats
MozReview-Commit-ID: 7DWNvQc2pBE

--HG--
extra : rebase_source : 02d3efe180fb1cd6d49ca9b8a49e4051e6e05cac
2018-05-02 16:51:27 -04:00
Botond Ballo 2add094650 Bug 1458063 - Refactor WillHandleWheelEvent() to also indicate the type of action APZ should take. r=kats
MozReview-Commit-ID: LfinNZYqiwt

--HG--
extra : rebase_source : 2ea04360700530e1fbbbaaf94b484b6df2f79fe4
2018-04-30 22:11:10 -04:00
Zhang Junzhi 891d6c4b37 Bug 1358017 - Part 6: Implements the auto-dir scrolling feature(without the "honour root" functionality) in non-APZ r=masayuki
This commit implements the auto-dir scrolling functionality in non-APZ, based on
part 1 to part 3. However, the functionality of mousewheel.autodir.honourroot is
unimplemented in this commit.

MozReview-Commit-ID: 2vYABOx4RkK

--HG--
extra : rebase_source : 7dc45e6747a101c1a2c3a22bc695b2a0b2494b50
2018-03-19 17:05:45 +08:00
Zhang Junzhi 660ec7462d Bug 1358017 - Part 2: Introduces the concept of auto-dir wheel scrolling and adds two new related prefs. r=kats,masayuki
This commit only introduces the concept and the functionality of retrieving the
values from the two new related prefs. Still no actual functionality change is
involved.

MozReview-Commit-ID: 2Gl3Wqdo6jL

--HG--
extra : rebase_source : bf30483e3e32829a5d6fd927740471ba348448f9
2018-03-15 21:57:19 +08: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
Olli Pettay 57fd877895 Bug 1447993, when handling pointerup while there is pointercapture, do a hit test in order to find the click target, r=masayuki
--HG--
extra : rebase_source : 160ef0aae3922cb32b11476650c15a3f55334691
2018-03-29 19:22:59 +03:00
Zhang Junzhi 3492fb331e Bug 1438794 - Makes single-line text controls in vertical-writing mode vertically scrollable if they overflow vertically; and makes them horizontally unscrollable no matter whether they overflow horizontally. r=kats
As for now, the scrollable direction with a mouse wheel for a single-line text
control is hard-coded; that is, only horizontal wheel scrolls are able to take
effect while vertical ones aren't. However, this isn't the desired case for
vertical writing mode, where the opposite case definitely suits better.

This commit refines the hard-coded scrollable direction for a single-line text
control to be writing-mode-adaptive.

MozReview-Commit-ID: 4Zkoe2ExPCZ

--HG--
extra : rebase_source : 113b2ea80b6bbbcd2d8379b438de97eedd616551
2018-02-23 02:40:44 +08:00
Tooru Fujisawa 48bb8e02c7 Bug 1424107 - Pass the triggering principal URI across processes in drag-and-drop. r=smaug 2018-02-09 10:43:53 +09:00
Olli Pettay 811a9c30ca backout Bug 1414204 because of regressions, r=backout
--HG--
extra : rebase_source : 97927ab24b0f24e4cfce8ce9199dda24857cfd3b
2018-01-03 18:42:50 +02:00
Emilio Cobos Álvarez c8eb630ebe Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez ffdf5d2cb5 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez c0959b2955 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W

--HG--
extra : rebase_source : 09b82acb4f3d69e8a4345457ab217443bc28d6e2
2017-12-07 19:13:50 +01:00
Stone Shih 4b47b52afe Bug 1414204 Part1: Suppress input events when there is a dnd session. r=smaug.
There may be some pending input events in the queue of thread when content starts a dnd operation. Spec says that input events should be suppressed when there is a dnd operation. Add a flag in ESM and turn on/off when start/finish a dnd operation. Checking the flag in PresShell::HandleEvent because we may start a dnd operation with pointermove and we want to suppress the mousemove as well.

MozReview-Commit-ID: 43NZrA7SW4c
2017-11-03 18:25:49 +08:00
maiquynhtruong 1c233ac5bd Bug 1422626 - Remove redundant declarion of class EnterLeaveDispatcher. r=masayuki
MozReview-Commit-ID: axbrIpDbad

--HG--
extra : rebase_source : 3862282357a13efb3658067c7f61a64a684daa78
2017-12-05 01:09:21 -05:00
Stone Shih d6191b028f Bug 1400792 - Fire pointercancel when starting a dnd operation. r=smaug.
MozReview-Commit-ID: 4UTXpPHNqJ7
2017-09-18 18:41:36 +08:00
Alastor Wu 00c469c134 Bug 1415444 - part1 : add flag to record whether the document has been activated by specific user gestures. r=smaug
This flag would be used to help us decide whether website could be allowed the autoplay.
The media related implementation would be implemented in bug1382574.

MozReview-Commit-ID: GGIauBufs5A

--HG--
extra : rebase_source : c407ceed311fc3fb0140e5da44fd69e457a5098f
2017-11-14 14:48:18 +08:00
Masayuki Nakano 93977460e2 Bug 1406446 - part 1: InputContextAction should treat focus change during handling a user input as caused by user input even if it's caused by JS r=smaug
Currently, widget doesn't show VKB when input context change is caused by JS.
However, if it's caused by an event handler of a user input, user may expect
to open VKB.  For example, if a touch event in fake editor causes moving
focus to actual editable node, user expect to show VKB.

Therefore, InputContextAction should declare two causes.  One is unknown but
occurred during handling non-keyboard event.  The other is unknown but occurred
during handling keyboard event.

However, EventStateManager doesn't have an API to check if it's being handling
a keyboard event.  Therefore, this patch adds it first.
AutoHandlingUserInputStatePusher sends event type to StartHandlingUserInput()
and StopHandlingUserInput() of EventStateManager and sUserKeyboardEventDepth
manages the number of nested keyboard event handling.  Therefore,
EventStateManager::IsHandlingKeyboardInput() can return if it's handling a
keyboard event.

IMEStateManager uses this new API to adjust the cause of changes of input
context.

Finally, InputContextAction::IsUserInput() is renamed to IsHandlingUserInput()
for consistency with EventStateManager and starts to return true when the
input context change is caused by script while it's handling a user input.

MozReview-Commit-ID: 5JsLqdqeGah

--HG--
extra : rebase_source : 9fcf7687d1bf90eeebbf6eac62d4488ff64b083c
2017-10-24 02:46:15 +09: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 1256250b3f Bug 1404896 - Separate the pointer lock implementations from GenerateMouseEnterExit to new functions. r=smaug.
So that it's easier to reuse the implementation for handling pointer events.

MozReview-Commit-ID: LIZoPjuq9ji
2017-09-18 15:07:41 +08:00
Stone Shih e628cf64e9 Bug 1316251 Part3: Trigger pointer event implementation in EventStateManager. r=masayuki
To manage pointer event "state" in ESM.

MozReview-Commit-ID: HiAwvSmVTwx
2017-09-08 11:01:22 +08:00
Olli Pettay 2e8b602108 Bug 1377131 - Try to trigger collector slices at times which disturb page js less (at least with iframes loaded after the top level page has been loaded), r=mccr8,bz
When triggering an iframe load or starting to parse a document for an iframe, the main thread may often have some time before the new page has been created. Try to trigger CC/GC slice at such point in order to avoid collector later when page is already executing its JS

--HG--
extra : rebase_source : 806df0af1dbaefb1761134eca0bb7c6ade6ac1a9
2017-09-06 18:18:11 +01:00
Stone Shih de7f705042 Bug 1351148 Part2: Add a priority queue for input events. r=smaug.
MozReview-Commit-ID: 5ud1Ex9UNVo
2017-03-21 15:44:12 +08:00
Stone Shih 7de447a25a Backed out changeset 46d8f42863af (bug 1351148) 2017-08-11 15:19:44 +08:00
Stone Shih 9d1d77d849 Bug 1351148 Part2: Add a priority queue for input events. r=smaug.
MozReview-Commit-ID: 5ud1Ex9UNVo
2017-03-21 15:44:12 +08:00
Carsten "Tomcat" Book de369deb98 Backed out changeset 284af26c1b53 (bug 1351148) 2017-07-28 09:20:27 +02:00
Masayuki Nakano 908b7f2e51 Bug 1333459 - part2-1: EventStateManager should have a way to check if there is accesskey which is executed by a specific keyboard event r=smaug
Protected EventStateManager::HandleAccessKey() walks ESMs to handle access key and EventStateManager::ExecuteAccessKey() looks for an accesskey which matches given char code values and execute an accesskey if it finds a target.  These names are hard to understand what they do and we need an option not to execute accesskey but looks for a target.  Therefore, this patch renames the former to WalkESMTreeToHandleAccessKey() and the latter to LookForAccessKeyAndExecute().

Then, they take a new bool argument, aExecute.  When it's true, LookForAccessKeyAndExecute() executes found accesskey.  Otherwise, i.e., it's false, they return true if they find an accesskey target for the given event in the process.

MozReview-Commit-ID: ETYbNmtTMGj

--HG--
extra : rebase_source : 553676384db5f795de1087a439f30eded11d22fe
2017-07-20 17:33:53 +09:00
Masayuki Nakano 6c68caecd7 Bug 1333459 - part1: Move methods of EventStateManager which check modifiers of access key to WidgetKeyboardEvent r=smaug
EventStateManager checks if every keypress event's modifiers match with access key modifiers which are in prefs. Moving related methods of this to WidgetKeyboardEvent makes EventStateManager simpler and we can hide the NS_MODIFIER_* constants (they may make developers confused between Modifiers of WidgetInputEvent) into WidgetEventImpl.cpp.

MozReview-Commit-ID: 23NUQ51lJ1M

--HG--
extra : rebase_source : 341f3764ef62575577572d8b349159e2d5512b26
2017-07-06 17:36:19 +09:00
Stone Shih 9573b6e439 Bug 1351148 Part2: Add a priority queue for input events. r=smaug.
MozReview-Commit-ID: 5ud1Ex9UNVo
2017-03-21 15:44:12 +08:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Masayuki Nakano 5533f095cb Bug 1377653 - part3: WidgetEvent::mFlags should have a bool flag if it's been posted to at least one remote process r=smaug
Currently, it's not been managed yet that whether an event is posted to at least one remote process.  So, for managing the state, BaseEventFlags should have a new bool flag and WidgetEvent and BaseEventFlags should have helper methods for it.

Additionally, this fixes a bug of nsGUIEventIPC.h. In a lot of ParamTraits, static_cast<Foo> is used for using base class's ParamTraits.  However, it causes creating temporary instance with copy constructor.  Therefore, WidgetEvent::MarkAsPostedToRemoteProcess() call in ParamTraits<mozilla::WidgetEvent>::Write() didn't work as expected.

MozReview-Commit-ID: DdafsbVfrya

--HG--
extra : rebase_source : 94205f3a7b36455c3c9f607c35866be033e627c1
2017-07-05 18:59:44 +09:00
Olli Pettay da0ec0a364 Bug 1375491, make child process to cache ime properties only at animation tick time, r=masayuki
--HG--
extra : rebase_source : 6f13f4d91fc4873d135824431adb4b0b2843b738
2017-06-29 14:46:11 +03:00
Michael Layzell 0700aeac13 Bug 1360441 - Disable the IsHandlingUserInput timeout for execCommand(copy/cut) commands, r=ehsan
MozReview-Commit-ID: 341K1DEsVCg
2017-05-18 16:51:48 -04:00
Mats Palmgren 6ef6efaea3 Bug 1340771 part 2 - Introduce a WeakFrame class for heap allocated weak frame pointers, stored in a hashtable for fast lookup. r=tn
* * *
Bug 1340771 part 3 - Change existing heap allocated AutoWeakFrame instances to use WeakFrame instead.  r=tn

MozReview-Commit-ID: GSuUiy98jBa
2017-03-01 18:03:14 +01:00
Mats Palmgren d13aaf9ce0 Bug 1340771 part 1 - Rename nsWeakFrame to AutoWeakFrame (automated change). r=tn
MozReview-Commit-ID: 8pl4nyeGEkr
2017-03-01 18:03:14 +01:00
Kartikaya Gupta b2cab8a5ed Bug 1147335 - Add support for drag-and-drop via touch (Windows-only, main-process-only). r=smaug
This patch adds a new non-DOM event type, "mousetouchdrag". The name is horrible, I
know. The "mouse" comes from the fact that it's a WidgetMouseEvent, and the
"touchdrag" comes from the fact that this event is fired at the start of a touch
gesture for drag-and-drop. Right now this event is only fired from the Windows
widget code, when we receive a touch-source doubleclick event from the OS. This
event is sent to us from the OS when it detects the sequence "touchstart, touchend,
touchstart" within certain time/distance constraints. Eventually we may detect
similar gestures for other platforms in the APZ GestureEventListener and dispatch
the "mousetouchdrag" event for those as well.

The only effect of this event is that it begins tracking a drag gesture in the
EventStateManager. Subsequent touchmove events can begin the actual drag-and-drop
operation by calling ::DoDragDrop. See the discussion in bug 1147335 for some
important caveats about DoDragDrop and how it only works with left-mouse-button
events (real or synthetic).

MozReview-Commit-ID: bGyOk6dRoJ
2017-01-03 10:55:48 -05:00
Xidorn Quan be76c082e0 Bug 1323983 part 1 - Ensure to release the pointer even if the document has been detached. r=smaug
MozReview-Commit-ID: FY5lDQBYl6U

--HG--
extra : rebase_source : 47159f623c46549b48c786b28b5c00c246288076
2016-12-21 12:02:24 +11:00