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
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
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
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