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

71 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano af6a1c5d37 Bug 1403759 - part 2: Handle edit/selection commands like insertNewline: in TextInputHandler::HandleCommand() r=m_kato
Let's make TextInputHandler::HandleCommand() handle other
commands which are caused by Backspace, Delete, Tab, ArrowUp,
ArrowDown, ArrowRight, ArrowLeft, PageUp, PageDown, Home, End
and Escape keys with various modifiers.

This patch makes Korean users can do most key operation in
editor even with composing Hangul character.

Note that this patch has a hack for cancelOperation: command.
The command is typically fired for Escape key press.  However,
it's also fired for Command + Period.  Unfortunately, this
behavior is really odd if subclass of NSResponder implements
|void cancelOperation:(id)sender|.  If it's implemented,
Cocoa doesn't call its |void keyDown:(NSEvent)theEvent|.
Instead, it calls only |void doCommandBySelector:(SEL)aSelector|
and |void cancelOperation:(id)sender| when Command + Period is
pressed.  Therefore, we cannot dispatch keydown nor keypress
event for this key combination if we implement it.  Therefore,
this patch doesn't implement the method but handle it in
doCommandBySelector even though the super class of ChildView
cannot handle the command with this path.

MozReview-Commit-ID: 4hS23SiwNJv

--HG--
extra : rebase_source : 38ac1ea494b5f786ecd5c9327efbacd460b59faf
2017-12-02 14:53:10 +09:00
Masayuki Nakano d7ecd695d3 Bug 1403759 - part 1: Make TextInputHandler::InsertNewline() treat other commands r=m_kato
Currently, we handle insertNewline: of NSResponder with
TextInputHandler::InsertNewline().  However, its
implementation is useful for handling some other
commands.  So, let's rename it to HandleCommand() and
make it take Command as its argument for handling
specific behavior of each command.

MozReview-Commit-ID: GgzQdTlVtYl

--HG--
extra : rebase_source : e1d1c8617897d29eb10ba62708e3549a77c6ee59
2017-12-02 10:46:31 +09:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07: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
Masayuki Nakano 6d8d004613 Bug 1339543 part 1 Wrap nsIWidget::ExecuteNativeKeyBinding() with a WidgetKeyboardEvent method and users of the method should use it r=smaug
Currently, edit commands for native key bindings are stored in widget.  This is
stateful and really complicated in content process because it needs to cache
them.

We can make this simpler if we make WidgetKeyboardEvent store edit commands for
the key combination.  Then, child process can handle it even if it's delayed
event or it's a nested event.

This patch adds arrays to WidgetKeyboardEvent to store edit commands which are
initialized with nsIWidget::ExecuteNativeKeyBinding() and adds
WidgetKeyboardEvent::ExecuteEditCommands() to execute stored edit commands as
same as nsIWidget::ExecutenativeKeyBinding().

MozReview-Commit-ID: BGRvBrLz5lp

--HG--
extra : rebase_source : b7ecd704d9c331ca1e0aedc66f230114015b853b
2017-05-19 16:50:30 +09:00
Masayuki Nakano 97735168f1 Bug 1297013 part.2 Implement some helper methods to log constants related to event handling r=smaug
This patch implements some helper methods to log constants related to event handling.

ToString(KeyNameIndex) and ToString(CodeNameIndex) converts the enum itmes to human readable string.  They use WidgetKeyboardEvent's helper class which returns Unicode text.  Therefore, this need to convert from UTF16 to UTF8.  That's the reason why these methods don't return |const char*|.

GetDOMKeyCodeName(uint32_t) returns DOM keycode name if it's defined.  Otherwise, returns hexadecimal value.  For generating switch-case statement, VirtualKeyCodeList.h shouldn't include ",".  Therefore, this patch removes "," from VirtualKeyCodeList.h and append it at defining NS_DEFINE_VK.  Additionally, the last item of enum and array should not end with ",".  Therefore, this adds dummy last item at each of them.  Finally, some of the keyCode values are shared between 2 keys.  Therefore, it needs to support NS_DISALLOW_SAME_KEYCODE for switch-case generator.  See the comment in the file for more detail.

GetModifiersName(Modifiers) returns all modifier names included in the given value.

MozReview-Commit-ID: 9i2ftFOTpDn

--HG--
extra : rebase_source : 458a4d28624dc10dd4454f2e7708d746d1fcb045
2016-09-15 00:48:47 +09:00
Masayuki Nakano 4fc95828b6 Bug 1277756 part.1 Make anonymous enum for NS_TEXTRANGE_* to an enum class named "TextRangeType" r=smaug
For making our code clearer by the stronger type check, we should change the anonymous enum for NS_TEXTRANGE_* to enum class whose name is "TextRangeType" and whose type is "RawTextRangeType" which is an alias of uint8_t.

Additionally, this also adds some utility methods for them.

Note that some lines which are changed by this patch become over 80 characters but it will be fixed by the following patches.

MozReview-Commit-ID: 76izA1WqTkp

--HG--
extra : rebase_source : 27cd8cc8f7f8e82055dbfe82aba94c02beda5fa4
2016-06-04 09:49:21 +09:00
Masayuki Nakano 0e98199ee6 Bug 1254755 part.6 Reorder the members of WidgetKeyboardEvent for reducing its instance size r=smaug
For reducing the instance size of WidgetKeyboardEvent, this patch also explicitly defines the type of KeyNameIndex and CodeNameIndex.

MozReview-Commit-ID: 8Iw2e8ZFOpe

--HG--
extra : rebase_source : 8123d19c30cf525643e7f442013c506de8b67543
2016-05-12 19:18:36 +09:00
Masayuki Nakano d2c8ff21a8 Bug 1257759 part.4 Rename WidgetGUIEvent::PluginEvent to NativeEventData for using this class to send native event from plugin process to content and/or chrome process r=smaug
PluginInstanceChild needs to send native key event to the chrome process via a content process.  So, IPC needs a platform independent class/struct which can store native event.  This purpose is exactly same as the purpose of WidgetGUIEvent::PluginEvent.  Therefore, we can use it for this case too.

This patch renames WidgetGUIEvent::PluginEvent to NativeEventData but this patch does NOT remove WidgetGUIEvent::PluginEvent.  Instead of that, it's defined as an alias of NativeEventData since PluginEvent is clearer name for the original purpose and it's used by plugin module.

MozReview-Commit-ID: 3nrHfb8gk8m

--HG--
extra : rebase_source : b0b5a863360bf0893b161d70124d3a83aa2c3386
2016-04-05 14:23:13 +09:00
Masayuki Nakano 963976b46d Bug 1154183 part.1 Move shortcut/access key candidate list creators from nsContentUtils to WidgetKeyboardEvent r=smaug
MozReview-Commit-ID: Ied6qEUc2Kz
2016-03-18 11:22:37 +09:00
Masayuki Nakano eec8a32d3a Bug 1137572 part.8 Callers of methods to dispatch composition events of TextEventDispatcher should be able to specify specific time/timeStamp r=smaug 2016-03-16 13:47:48 +09:00
Masayuki Nakano ce885416ed Bug 1204439 part.3 Create methods to get enum item name r=smaug 2015-09-17 12:05:44 +09:00
Masayuki Nakano 68ad962e5b Bug 1204439 part.2 NS_EVENT_MESSAGE() shouldn't take specific value for the event message r=smaug 2015-09-17 12:05:44 +09:00
Masayuki Nakano 0d22745cda Bug 895274 part.3 Make the enum of event messages a named enum IGNORE IDL r=smaug 2015-08-26 21:56:59 +09:00
Masayuki Nakano 42548b1f7b Bug 895274 part.2 Define event messages as anonymous enum with EventMessageList.h r=smaug
--HG--
rename : widget/BasicEvents.h => widget/EventMessageList.h
2015-08-22 10:34:51 +09:00
Maksim Lebedev 43ec4fa0cc Bug 1162009 - Add TOUCH_CANCEL sending on e10s. r=kats 2015-05-14 08:16:00 -04:00
Xidorn Quan 6a7ee49055 Bug 569334 part 1 - Support getting font info in content query. r=masayuki,jfkthame,smaug 2015-01-31 18:17:12 +11:00
Masatoshi Kimura 6cc5dabbee Bug 1111290 - Part 3: Remove TypedEnum.h and fold TypedEnumInternal.h into TypedEnumBits.h. r=waldo 2015-01-26 07:22:11 +09:00
Masatoshi Kimura 9656ec51c3 Bug 895582 - Get rid of MOZ_ENUM_TYPE. r=waldo 2015-01-21 22:35:19 +09:00
Masayuki Nakano 7c2cde510e Bug 1077345 part.4 Add NS_COMPOSITION_COMMIT_AS_IS event which automatically commits composition with the last data r=smaug 2014-11-25 14:02:31 +09:00
Masayuki Nakano 9375ed8f50 Bug 1046101 part.33 Generate EventClassID with EventClassList.h in EventForwards.h and nsContentUtils should use it instead of uint32_t r=smaug 2014-08-04 14:28:58 +09:00
Masayuki Nakano aa909719cd Bug 865649 part.1 Implement KeyboardEvent.code r=smaug 2014-05-25 11:08:58 +09:00
Masayuki Nakano 614e03df2e Bug 989213 part.1 Rename nsDOMKeyNameList.h to mozilla/KeyNameList.h r=smaug
--HG--
rename : dom/events/nsDOMKeyNameList.h => dom/events/KeyNameList.h
2014-04-01 20:42:11 +09:00
Masayuki Nakano 2778cc48dc Bug 977959 part.1 Define constants for each command which may be caused by native key bindings r=roc 2014-03-14 22:13:30 +09:00
Masayuki Nakano d9fdd873cb Bug 974318 part.1 Add WidgetTextEvent::mRanges which is an array class of TextRange r=smaug 2014-03-04 22:48:26 +09:00
Masayuki Nakano ac184b22c5 Bug 930900 part.1 Add new key name index which means KeyboardEvent.key should refer stored string (not implemented yet) r=smaug 2013-10-29 13:14:42 +09:00
Masayuki Nakano b285541889 Bug 602787 part.10 Create TextRange.h for separating TextEvents.h r=roc 2013-10-22 22:27:36 +09:00
Wes Kocher e3f57c4d94 Backed out 9 changesets (bug 602787) on suspicion of breaking mochitest-metro on a CLOSED TREE
Backed out changeset 1730bcae2c45 (bug 602787)
Backed out changeset 70606b9b1e42 (bug 602787)
Backed out changeset 57ca2861ea30 (bug 602787)
Backed out changeset 3b9f1062d915 (bug 602787)
Backed out changeset 3ee56eacc84b (bug 602787)
Backed out changeset 1c35693be3d3 (bug 602787)
Backed out changeset ef095c3aef98 (bug 602787)
Backed out changeset 4827bdae97fd (bug 602787)
Backed out changeset fa0f355e7871 (bug 602787)
2013-10-22 13:11:53 -04:00
Masayuki Nakano 1c98507f75 Bug 602787 part.10 Create TextRange.h for separating TextEvents.h r=roc 2013-10-22 22:27:36 +09:00
Masayuki Nakano 93a8575635 Bug 920425 part.1 Create widget/EventClassList.h r=roc 2013-10-18 15:10:20 +09:00
Masayuki Nakano 52e19b318b Bug 920377 part.33 Get rid of mozilla::WheelEvent r=roc 2013-10-16 18:37:36 +09:00
Masayuki Nakano 9aaf116c1c Bug 920377 part.32 Get rid of nsMouseEvent r=roc 2013-10-02 15:38:27 +09:00
Masayuki Nakano 5dbc2a60e4 Bug 920377 part.31 Get rid of nsEvent r=roc 2013-10-02 12:46:04 +09:00
Masayuki Nakano a4221a463f Bug 920377 part.30 Get rid of nsGUIEvent r=roc 2013-10-02 12:46:03 +09:00
Masayuki Nakano c67563512e Bug 920377 part.29 Get rid of nsMouseScrollEvent r=roc 2013-10-01 16:23:02 +09:00
Masayuki Nakano cb376be26d Bug 920377 part.28 Get rid of nsDragEvent r=roc 2013-10-01 16:23:02 +09:00
Masayuki Nakano 73191e008f Bug 920377 part.27 Get rid of nsMouseEvent_base r=roc 2013-10-01 16:23:02 +09:00
Masayuki Nakano 84078f9904 Bug 920377 part.26 Get rid of nsInputEvent r=roc 2013-10-01 16:23:02 +09:00
Masayuki Nakano e98333c284 Bug 920377 part.25 Get rid of nsUIEvent r=roc 2013-10-01 16:23:01 +09:00
Masayuki Nakano 255381c975 Bug 920377 part.24 Get rid of nsSelectionEvent r=roc 2013-10-01 16:23:01 +09:00
Masayuki Nakano 06d15e629f Bug 920377 part.23 Get rid of nsQueryContentEvent r=roc 2013-10-01 16:23:00 +09:00
Masayuki Nakano b809719e9d Bug 920377 part.22 Get rid of nsCompositionEvent r=roc 2013-10-01 16:23:00 +09:00
Masayuki Nakano 3e4559711b Bug 920377 part.21 Get rid of nsTextEvent r=roc 2013-10-01 16:22:59 +09:00
Masayuki Nakano 0746fb9d0d Bug 920377 part.20 Get rid of nsTextRange r=roc 2013-10-01 16:22:59 +09:00
Masayuki Nakano 9c147c49ba Bug 920377 part.19 Get rid of nsTextRangeArray r=roc 2013-09-28 09:14:06 +09:00
Masayuki Nakano 393cc936d4 Bug 920377 part.18 Get rid of nsTextRangeStyle r=roc 2013-10-01 16:22:59 +09:00
Masayuki Nakano 3a0b655e5a Bug 920377 part.17 Get rid of nsKeyEvent r=roc 2013-10-01 16:22:58 +09:00
Masayuki Nakano e2155059fa Bug 920377 part.16 Get rid of nsAlternativeCharCode r=roc 2013-10-01 16:22:57 +09:00
Masayuki Nakano 0b36850b73 Bug 920377 part.15 Get rid of nsGestureNotifyEvent r=roc 2013-09-27 15:20:57 +09:00
Masayuki Nakano 79047aba97 Bug 920377 part.14 Get rid of nsSimpleGestureEvent r=roc 2013-09-27 15:20:57 +09:00