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

85 Коммитов

Автор SHA1 Сообщение Дата
Botond Ballo 6dfa77de8f Bug 1704070 - Expose the APZ event status in the return value of DispatchInputEvent(). r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D111762
2021-04-14 05:07:56 +00:00
Masayuki Nakano a25988774a Bug 1685491 - part 5: Move the code remapping arrow keys in vertical content to `NativeKeyBindings` r=smaug,jfkthame
Currently, this feature is implemented only on Linux and macOS (see also
bug 1077515 and bug 1301497), and the code is really similar each other.
Additionally, it always tries to query selection to check whether the caret is
in vertical content or not if arrow keys are pressed.  For avoiding a lot of
query, this patch makes `TextEventDispatcher` cache writing mode at every
selection change notification.  However, unfortunately, it's not available when
non-editable content has focus, but it should be out of scope of this bug since
it requires a lot of changes.

Anyway, with this patch, we can write a mochitest only on Linux and macOS.
The following patch adds a test for this as a fix of bug 1103374.

Differential Revision: https://phabricator.services.mozilla.com/D102881
2021-02-02 03:29:31 +00:00
Masayuki Nakano cb448c5095 Bug 1685491 - part.1: Map typical commands to synthesized keyboard events for test on Linux and macOS r=smaug,remote-protocol-reviewers
Currently, we don't allow keyboard events synthesized for tests retrieve native
key bindings in content process.  However, due to this, we cannot test keyboard
navigation, deleting per word, etc on Linux and macOS either with mochitest
or WPT.  For making better compatibility with the other browsers, we should
write WPT more with the test driver.  Therefore, we should allow keyboard
events synthesized for tests retrieve native key bindings.

On the other hand, if we make them retrieve customized keyboard shortcuts
in the environment, some developers may not be able to run tests locally without
resetting their customization.  Therefore, this patch makes `NativeKeyBindings`
set "standard" shortcut keys on the platform instead of retrieving actual
shortcut key results.

If referring the default shortcut key bindings is not good thing for
WebDriver/CDP, perhaps, `TextInputProcessor` should have a new flag which can
refer customized shortcut keys even in content process.  But I think that it
should be done in another bug because some edit commands are mapped forcibly
like this patch.
https://searchfox.org/mozilla-central/rev/c03e8de87cdb0ce0378c0886d3c0ce8bbf9dc44e/remote/domains/parent/Input.jsm#82-102

Differential Revision: https://phabricator.services.mozilla.com/D102877
2021-02-02 03:02:30 +00:00
Masayuki Nakano 5d24a92232 Bug 1689034 - part 3: Get rid of keyboard events on plugins r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D103140
2021-01-28 07:48:15 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Gabriele Svelto 5dc21d568c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Henri Sivonen 7a5fa0c5d6 Bug 1585553 - s/wchar_t/char16_t/ for a variable always initialized from char16_t. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D48050

--HG--
extra : moz-landing-system : lando
2019-10-03 10:53:39 +00:00
kriswright 6f43a49b41 Bug 1573992 - Convert two dom.keyboardevent.* prefs to staticprefs. r=njn
Converts dom.keyboardevent.dispatch_during_composition and dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content to static prefs. Removes the dispatch_during_composition entry from mobile.js, since it just redefines the same pref value.

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

--HG--
extra : moz-landing-system : lando
2019-08-26 20:25:42 +00:00
Masayuki Nakano 5e41233499 Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio
A lot of files include `nsIPresShell.h` even though currently they don't
need it.  This patch removes the unnecessary inclusions.

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

--HG--
extra : moz-landing-system : lando
2019-04-04 00:19:48 +00:00
Razvan Maries 1cd564b971 Backed out changeset 3b94c20ba873 (bug 1540990) for build bustages. CLOSED TREE 2019-04-04 02:44:00 +03:00
Masayuki Nakano b2bba953cc Bug 1540990 - Get rid of unnecessary nsIPresShell.h inclusions r=emilio
A lot of files include `nsIPresShell.h` even though currently they don't
need it.  This patch removes the unnecessary inclusions.

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

--HG--
extra : moz-landing-system : lando
2019-04-03 23:29:38 +00:00
Masayuki Nakano a3484e40c0 Bug 998941 - part 1-2: Make editor set InputEvent.data to inserting text when it sets InputEvent.inputType to "insertText" or "insertCompositionText" r=smaug,m_kato
This patch makes nsContentUtils::DispatchInputEvent() support to set
InputEvent.data.  Whether the its value should be null or DOMString depends
on InputEvent.inputType value.

- https://rawgit.com/w3c/input-events/v1/index.html#overview
- https://rawgit.com/w3c/input-events/v1/index.html#dfn-data
- https://w3c.github.io/input-events/#overview
- https://w3c.github.io/input-events/#dfn-data

According to the draft specs, InputEvent.data should be always inserting text
when inputType is "insertText" or "insertCompositionText" (or
"insertFromCompoition" if Level 2 support is enabled).

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

--HG--
extra : moz-landing-system : lando
2019-02-19 06:28:19 +00: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 339308fcab Bug 1343955 - part 4: Implement static API to synthesize keyboard events into FuzzingFunctions r=smaug
Synthesizing keyboard events is dangerous and such API is requested only by
fuzzing test.  So, we should add it into FuzzingFunctions which is built
only when |ac_add_options --enable-fuzzing| is specified and enabled by
the pref.

This patch implements the API as synthesizing keyboard events in the focused
widget and the synthesized events are propagated as native key events except
APZ (because keyboard events are synthesized only in the process).  This
behavior allows to test including any default action handlers such as
EventStateManager and setting WidgetGUIEvent::mWidget since some C++ handler
checks if it's nullptr.

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

--HG--
extra : moz-landing-system : lando
2018-10-02 12:16:45 +00:00
Masayuki Nakano 36f73c43d8 Bug 1435717 - Make calling WidgetEvent::PreventDefault*() stop cross process forwarding too r=smaug
Currently, if an event is consumed in the main process, EventStateManager
does not send it to remote process.  However, this is unexpected behavior
for some WidgetKeyboardEvent dispatchers.  OS sometimes has consumed native
key events before sending applications.  For example, Alt key on Windows
should activate menu bar of focused window but Alt key may be consumed before
focused window receives the event.  In such case, we mark Alt keyboard event
as "consumed before dispatch", and chrome treat it like as its preventDefault()
is called in web content.  (Note that for compatibility with other browsers,
the consumed state is not exposed to web content.  So, Event.defaultPrevented
returns false in web content.)

Therefore, we need to treat "consumed" state and "cross process forwarding"
state separately.  This patch makes calling WidgetEvent::PreventDefault()
always stops cross process forwarding for backward compatibility.  Additionally,
for the special case mentioned above, this patch makes
WidgetEvent::PreventDefaultBeforeDispatch() take additional argument,
|aIfStopCrossProcessForwarding|.  If this is CrossProcessForwarding::eStop,
the event won't be sent to remote process as same as calling PreventDefault().
Otherwise, CrossProcessForwarding::eHold, PreventDefaultBeforeDispatch() call
does not change "cross process forwarding" state.  I.e., if the event's
StopCrossProcessForwarding() and PreventDefault() are not called until
EventStateManager::PostHandleEvent(), the event will be sent to remote process
as usual.

MozReview-Commit-ID: IQGWJvXetxV

--HG--
extra : rebase_source : 4ccdd500e80b8fe29e469ac3b85578e1c07c8358
2018-06-25 18:17:18 +09:00
Masayuki Nakano c389fb3752 Bug 1440189 - Stop dispatching keypress event to the default event group in web content (only Nightly and early Beta) unless web page isn't in blacklist r=smaug
UI Events declares that keypress event should be fired only when the keydown
sequence produces some characters.  For conforming to UI Events and
compatibility with the other browsers, we should stop dispatching keypress
events for non-printable keys.

For getting regression reports, we should enable this new behavior only
on Nightly.

However, some web apps actually broken with the standardized behavior.  For
protecting testers from known broken web apps, this patch introduces a
blacklist to take the traditional behavior under specific domain (and path in
it, optionally).  Currently, docs.google.com and mail.google.com are set by
default.

MozReview-Commit-ID: HSrYX8LUB0p

--HG--
extra : rebase_source : a2677d07410af289534db051767543a25c9a957a
2018-03-23 12:06:55 +09:00
Masayuki Nakano a684a2500b Bug 1446401 - Start to dispatch "keydown" event and "keyup" event even during in composition in Nightly and early Beta r=smaug
For confirming to UI Events spec, we should dispatch "keydown" event and
"keyup" event even during in composition.

This patch makes only Nightly and early Beta start to dispatch those events
during a composition.

MozReview-Commit-ID: 8md7NtSdurJ

--HG--
extra : rebase_source : 2527089ee2844ee6a816ee3afae461275c61c409
2018-02-28 22:19:09 +09:00
Masayuki Nakano 8ff64d6a33 Bug 1443117 - Restart to dispatch "keypress" event for non-printable keys and key combinations on Nightly and early-Beta until Google fixes related bugs of their web apps r=smaug
We have stopped dispatching "keypress" events for non-printable keys
and key combinations for conforming to UI Events and following the
other browsers.

However, this change hits a serious bugs of Google Docs, Google
Spreadsheets and Gmail.  Until they will fix their bugs, we should
take back the traditional behavior for keeping Nightly usable for
any Nightly testers.

MozReview-Commit-ID: 9CyEbsFit1S

--HG--
extra : rebase_source : 837288b1fb53121badff4e65094a87cebfe3cfee
2018-03-05 21:12:27 +09:00
Masayuki Nakano 38c9ff1b63 Bug 1440189 - part 1: Stop dispatching keypress event to the default event group in web content (only Nightly and early Beta) r=smaug
UI Events declares that keypress event should be fired only when the keydown
sequence produces some characters.  For conforming to UI Events and
compatibility with the other browsers, we should stop dispatching keypress
events for non-printable keys.

For getting regression reports, we should enable this new behavior only
on Nightly and early Beta.

MozReview-Commit-ID: 5IIL9huejXH

--HG--
extra : rebase_source : 0abdbe84a50d6fd1b4d52521b92e7513483b197c
2018-01-26 00:16:14 +09:00
Masayuki Nakano 2a6bd77194 Bug 1438133 - Ctrl + Enter should cause keypress event even though the key combination doesn't input any character r=smaug
Currently, we dispatch keypress event when Enter is pressed without modifiers
or only with Shift key.  However, the other browsers dispatch keypress event
for Ctrl + Enter in any platforms even if it doesn't cause any text input.
So, we should fire keypress event for Ctrl + Enter even in strict keypress
dispatching mode.

Note that with other modifiers, it depends on browser and/or platform.
So, anyway, web developers shouldn't use keypress event to catch
Alt + Enter, Meta + Enter and two or more modifiers + Enter.

MozReview-Commit-ID: 3uUMkhL5VfJ

--HG--
extra : rebase_source : 8149acd958b238c8216f683a42fa05c3cf24570a
2018-02-14 21:21:18 +09:00
Masayuki Nakano e43e597a9e Bug 1433101 - part 2: Treat Enter and Shift+Enter as printable key r=smaug
Chromium dispatches a keypress event when pressing Enter or Shift+Enter.
Actually, when user press them in <pre> element of HTML editor, ツ・n is inserted.
It makes sense to treat the key combinations as inputting text.

MozReview-Commit-ID: Hvx87MZtZkn

--HG--
extra : rebase_source : 196b63843ebcb6e4b398f6b21a4f5f1d020b8db3
2018-01-25 23:59:20 +09:00
Masayuki Nakano 082c64aa0c Bug 1433101 - part 1: Add new pref which disables keypress event for non-printable keys only for the default event group in web content r=smaug
UI Events declares that keypress event should be fired when the keypress event
causes some text input.  However, we're keeping our traditional behavior for
historical reasons because our internal event handlers (including event
handlers of Thunderbird) handles keypress events for any keys.  Therefore,
for minimizing the side effect, we should stop kicking keypress event handlers
in the default event group in web content.

This patch adds new pref for enabling the standard behavior in web content.

Additionally, creates WidgetKeyboardEvent::IsInputtingText() for sharing the
check logic between TextEventDispatcher and TextEditor/HTMLEditor.

MozReview-Commit-ID: 3rtXdLBPeVC

--HG--
extra : rebase_source : 2fc3c9a09840d0d03800c9a42bb83ca76a8db2d5
2018-01-25 23:27:07 +09:00
Masayuki Nakano 0674b4fc1f Bug 1422230 - part 1: TextEventDispatcher should manage if dispatched composition events have been handled by remote content and TSFTextStore refer the state r=m_kato
When composition events are handled by content actually, widget receives
NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED notification.  If focused content
is in a remote process, this is notified only when all sending composition
events are handled in the remote process.  So, when widget receives the
notification can there is no composition in IME, that means that nobody is
composing composition at that time.

This patch adds TextEventDispatcher::IsHandlingComposition() which returns
false only when nobody has composition and makes TSFTextStore refer this
method because TSFTextStore needs to know if focused content has composition
in any cases.

MozReview-Commit-ID: F1ZZgFJAArD

--HG--
extra : rebase_source : 65e7f592e0ffd1c516e4dab16ab4ca8d7171f954
2018-01-12 11:31:53 +09:00
Masayuki Nakano e7a9572555 Bug 1384027 - part1: PuppetWidget should have TextEventDispatcher like nsIWidget instance in the parent process r=m_kato
In the parent process, every nsIWidget instance like nsWindow has TextEventDispatcher instance after dispatching a keyboard event or a composition event.  Then, TextEventDispatcher manages whether there is composition and handles NotifyIME.  However, PuppetWidget doesn't have it unless it synthesizes keyboard events or composition events for tests.
This causes PuppetWidget implementing nsIWidget::NotifyIME() with nsBaseWidget::NotifyIMEInternal() which is a virtual method only implemented by PuppetWidget.  For consistent implementation around here, we should move NotifyIMEInternal() implementation to TextEventDispatcherListener::NotifyIME() which is called by TextEventDispatcher::NotifyIME().  Then, PuppetWidget can handle NotifyIME() easier.

This patch creates TextEventDispatcher::BeginInputTransactionFor() which takes pointer to a dispatching event and pointer to PuppetWidget.  It emulates each corresponding event dispatcher method for managing composing state and begins input transaction for the dispatching event.

Unfortunately, this implementation is ugly due to duplicated code.  However, this is enough for now.  When we need to make TextEventDispatcher manage more states, we should add methods which are shared by both BeginInputTransactionFor() and event dispatcher method.

MozReview-Commit-ID: GeP028luZjR

--HG--
extra : rebase_source : ce71ce4d7ba52aeb12bff2c403c9a6df47ea3a11
2017-07-25 23:27:31 +09:00
Masayuki Nakano 0789f7b595 Bug 1217700 part.1 nsIWidget should return reference to IMENotificationRequests r=m_kato
IMEContentObserver may need to change notifications to send when TextInputProcessor begins input transaction.  In current design, IMEContentObserver needs to retrieve IMENotificationRequests at every change.  However, if nsIWidget returns a reference to its IMENotificationRequests, IMEContentObserver can call it only once.

For that purpose, this patch changes nsIWidget::GetIMENotificationRequests() to nsIWidget::IMENotificationRequestsRef() and make it return |const IMENotificationRequests&|.  However, if the lifetime of the instance of IMENotificationRequest is shorter than the widget instance's, it's dangerous.  Therefore, it always returns TextEventDispatcher::mIMENotificationRequests.  TextEventDispatcher's lifetime is longer than the widget.  Therefore, this guarantees the lifetime.

On the other hand, widget needs to update TextEventDispatcher::mIMENotificationRequests before calls of nsIWidget::IMENotificationRequestsRef().  Therefore, this patch makes TextEventDispatcher update proper IMENotificationRequests when it gets focus or starts new input transaction and clear mIMENotificationRequests when it loses focus.

Note that TextEventDispatcher gets proper requests both from native text event dispatcher listener (typically, implemented by native IME handler class) and TextInputProcessor when TextInputProcessor has input transaction because even if TextInputProcessor overrides native IME, native IME still needs to know the content changes since they may get new input transaction after that.

However, there may not be native IME handler in content process.  If it runs in Android, PuppetWidget may have native IME handler because widget directly handles IME in e10s mode for Android.  Otherwise, native IME handler is in its parent process.  So, if TextInputHandler has input transaction in content process, PuppetWidget needs to behave as native event handler.  Therefore, this patch makes PuppetWidget inherit TextEventDispatcherListener and implements PuppetWidget::IMENotificationRequestsRef().

MozReview-Commit-ID: 2SW3moONTOX

--HG--
extra : rebase_source : d2634ada6c33dbf7a966fadb68608411ee24bfab
2017-04-15 01:35:58 +09:00
Masayuki Nakano c038f800f7 Bug 1339331 TextEventDispatcher should replace \r in composition string with \n and TextComposition should allow to input \n with composition events r=m_kato
According to ATOK's behavior, IME may send different line breaker from its platform's standard.  Therefore, we should treat \r as \n too.

Additionally, currently, TextComposition doesn't allow to input \n with composition.  However, this was added for preventing to see odd control characters as boxes with code point.  Therefore, we should allow \n for IMEs. (It was allowed, this limitation is unexpected when I reviewed the patch to reject control characters in TextComposition.)

MozReview-Commit-ID: DzGSMgp89Av

--HG--
extra : rebase_source : 0644e5941a080583af8701546111fbf46ec646ec
2017-03-16 16:26:43 +09:00
Masayuki Nakano fc3e532636 Bug 1347433 part.3 TextEventDispatcher::PendingComposition::Flush() should replace native line breakers in the composition string before dispatching composition event r=m_kato
So, finally, Flush() should replace native line breakers in the composition string before dispatching composition events.  However, if the composition string was set by Set(), i.e., it's already been replaced with native line breakers, we shouldn't try to do it again due to performance reason.  Therefore, this patch adds |mReplacedNativeLineBreakers| to manage if it's already been called.

MozReview-Commit-ID: 5Y7ULWeP153

--HG--
extra : rebase_source : f825e45a7033c3c651e6324047e75c20f6c69b36
2017-03-15 19:09:30 +09:00
Masayuki Nakano 43c58f6aa5 Bug 1347433 part.2 Implement TextEventDispatcher::PendingComposition::ReplaceNativeLineBreakers() and TextEventDispatcher::PendingComposition::Set() should use it r=m_kato
MozReview-Commit-ID: 5mPiRGwUuej

--HG--
extra : rebase_source : 2d01998be5624188a94abd2dcda8f7ea6016e545
2017-03-15 18:59:34 +09:00
Masayuki Nakano aa1ef41139 Bug 1347433 part.1 Separate TextRange offset and length adjustment to AdjustRange() r=m_kato
First of all, replacing native line breakers with XP line breakers needs to adjust offset and length of each TextRange.  Therefore, we cannot just duplicate the code into TextEventDispatcher::PendingComposition::Flush().

For creating a new method to replace the native line breakers in PendingComposition::mString, we should separate range adjustment code to a static method, AdjustRange(), because we cannot use for loop simply because we need to adjust both mClauses and mCaret.

MozReview-Commit-ID: 5ycsN8EAs45

--HG--
extra : rebase_source : 0ef667669c9027958a0a955f4b883f70be89cbb3
2017-03-15 18:51:32 +09:00
Masayuki Nakano 8c926d5f82 Bug 1303273 part.3 Dispatch eKeyPress events without NativeKey::HandleCharMessage() when it handles WM_(SYS)KEYDOWN message and there are following WM_(SYS)CHAR messages which includes non-control character r=m_kato
This patch creates NativeKey::DispatchKeyPressEventsWithRetrievedCharMessages() for dispatching eKeyPress event with mCommittedCharsAndModifiers when it stores following printable WM_(SYS)CHAR messages.

Using loop for dispatching eKeyPress event for every WM_(SYS)CHAR message is wrong because WidgetKeyboardEvent::mKeyValue is initialized with mCommittedCharsAndModifiers and it causes TextEventDispatcher dispatching multiple eKeyPress events at every call of MaybeDispatchKeypressEvents().  Therefore, if mKeyValue is "^^", eKeyPress event is dispatched 4 times --for the first message, eKeyPress events are fired for each "^" and for the second message, eKeyPress events are fired again for each "^"--.  Therefore, when it handles WM_(SYS)KEYDOWN and it causes inputting one or more printable characters, it's the easiest way not to use HandleCharMessage().

The new method calls TextEventDispatcher::MaybeDispatchKeypressEvents() only once and it requests to call the callback method with new argument of MaybeDispatchKeypressEvents() when it needs to dispatch 2 or more eKeyPress events.  Then, NativeKey::WillDispatchKeyboardEvent() can set each eKeyPress event to raw information of the message and proper modifier state.

With this change, we can dispatch multiple eKeyPress events with retrieved WM_(SYS)CHAR message information rather than retrieved information from active keyboard layout.  Therefore, NeedsToHandleWithoutFollowingCharMessages() doesn't return true even when mCommittedCharsAndModifiers stores two or more characters.

FYI: there is a bug in test_keycodes.xul. That is, Alt+'A' of Greek keyboard layout should cause WM_SYSCHAR with a corresponding Greek character but ASCII characters are specified.  Therefore, this patch includes the fix of these bugs

MozReview-Commit-ID: JVm7ZJVug0O

--HG--
extra : rebase_source : 414ecbe2c01c53f294d1346414b1a289aa0abfe8
2016-10-06 20:52:03 +09:00
Masayuki Nakano 258c1f97d6 Bug 1277756 part.7 Rename TextRangeType::NS_TEXTRANGE_SELECTEDCONVERTEDTEXT to TextRangeType::eSelectedClause r=smaug
MozReview-Commit-ID: GyRYWzfeWrm

--HG--
extra : rebase_source : 8bebacaf675ec4a3cf91cfd434d07beeb7fb1567
2016-06-03 19:15:21 +09:00
Masayuki Nakano 3fa2003d17 Bug 1277756 part.6 Rename TextRangeType::NS_TEXTRANGE_CONVERTEDTEXT to TextRangeType::eConvertedClause r=smaug
MozReview-Commit-ID: 3mexBm278As

--HG--
extra : rebase_source : ef363b0ac50396631e9b145b7e869330509fe259
2016-06-03 19:05:32 +09:00
Masayuki Nakano 98f069e029 Bug 1277756 part.5 Rename TextRangeType::NS_TEXTRANGE_SELECTEDRAWTEXT to TextRangeType::eSelectedRawClause r=smaug
MozReview-Commit-ID: MbG4siLb4Q

--HG--
extra : rebase_source : 23c20c55c3936dc6af5f57414ef7630003480275
2016-06-03 18:57:21 +09:00
Masayuki Nakano f4254e7f7f Bug 1277756 part.4 Rename TextRangeType::NS_TEXTRANGE_RAWINPUT to TextRangeType::eRawClause r=smaug
MozReview-Commit-ID: KLC1VPiYTdz

--HG--
extra : rebase_source : 3f750e526bb04b26ed66d2c0fada14e7d5b43d73
2016-06-03 18:48:37 +09:00
Masayuki Nakano 6b5425853a Bug 1277756 part.3 Rename TextRangeType::NS_TEXTRANGE_CARETPOSITION to TextRangeType::eCaret r=smaug
MozReview-Commit-ID: CaqmOSxYYU7

--HG--
extra : rebase_source : 5820d491b97be7899150516d05f1426e74dab5b5
2016-06-03 18:40:06 +09:00
Masayuki Nakano b07cb5c22b Bug 1277756 part.2 Rename TextRangeType::NS_TEXTRANGE_UNDEFINED to TextRangeType::eUninitialized r=smaug
MozReview-Commit-ID: 2kqngXh1DYh

--HG--
extra : rebase_source : a7e6d9f0a85e4979bf91648636e2f88768522668
2016-06-03 18:32:22 +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 e2fb1c839c Bug 1254755 part.4 Rename WidgetKeyboardEvent::location to WidgetKeyboardEvent::mLocation r=smaug
MozReview-Commit-ID: CjT7izri6Vq

--HG--
extra : rebase_source : 1e82d581b8bf1cce3d3154402f3bb435f7a004f6
2016-05-12 18:17:22 +09:00
Masayuki Nakano 7bfa8a21fa Bug 1254755 part.3 Rename WidgetKeyboardEvent::alternativeCharCodes to WidgetKeyboardEvent::mAlternativeCharCodes r=smaug
MozReview-Commit-ID: 26K8ZxzavfB

--HG--
extra : rebase_source : 5f74e58a784bae2ed626c0c9f7c992228dcff1be
2016-05-12 17:57:21 +09:00
Masayuki Nakano 3359bad586 Bug 1254755 part.1 Rename WidgetKeyboardEvent::keyCode to WidgetKeyboardEvent::mKeyCode r=smaug
And also WidgetKeyboardEvent::mKeyCode should be compared with NS_VK_* rather than nsIDOMKeyEvent::DOM_VK_*.

MozReview-Commit-ID: IKjQ1nr8XYe

--HG--
extra : rebase_source : 83125cd2523f6b70759f621470aad23b00aae8ae
2016-05-12 17:13:49 +09:00
Masayuki Nakano eb041d2df7 Bug 1257759 part.7 Add new internal events which represent key events on plugin r=smaug
If a plugin process posts native key events to the widget, it needs to check if the key combination is reserved by chrome because if it's reserved by chrome, the reserved shortcut key handler should be executed and the event shouldn't be handled by the focused plugin.

This patches add eKeyDownOnPlugin and eKeyUpOnPlugin.  nsXBLWindowKeyHandler will listen to them and handle them as normal keydown and keypress or keyup event.  Note that these events won't be fired on content in the default event group and won't be sent to the remote process.

MozReview-Commit-ID: H5OKPLtVdr6

--HG--
extra : rebase_source : c6852423e47c40e9953b72061262730f7cce35d7
2016-04-23 01:22:49 +09:00
Masayuki Nakano cbe8f5268a Bug 1259656 part.1 Rename WidgetEvent::refPoint to WidgetEvent::mRefPoint r=smaug
MozReview-Commit-ID: ESWM5ZyBpSR

--HG--
extra : rebase_source : c5e1e3f60bcdde2a7f6c399e72430b29a3e552cd
2016-04-18 23:09:02 +09:00
Arata Furukawa 676913b9bb Bug 1259655 - part 1 Rename WidgetEventTime::time to WidgetEventTime::mTime r=masayuki
MozReview-Commit-ID: 7lBCEVkanvF

--HG--
extra : source : d629f018d02594951b7deccf1e1fce279d04694c
2016-03-28 13:29:42 +09:00
Masayuki Nakano 6181d95afb Bug 1256589 part.4 Move the implementation of PreventDefault() and add PreventDefaultBeforeDispatch() from dom::Event to WidgetEvent r=smaug
mDefaultPreventedByChrome is hacky. When PresShell handles Escape key events in fullscreen mode, it prevents default of every Escape key events and dispatch it only into chrome. After that, it check mDefaultPreventedByChrome if at least one call of preventDefault() occurred in chrome. Therefore, if we shouldn't set both mDefaultPreventedByChrome and mDefaultPreventedByContent to true before dispatching an event. This the reason why we need a special method, PreventDefaultBeforeDispatch() is needed for setting only mDefaultPrevented to true.

MozReview-Commit-ID: BPSq68GnWw6

--HG--
extra : rebase_source : f2f963afeba6994cc090efedebc29c0d9334c96d
extra : source : 1012dc095cc1b7236991a7befdbfbf174dc1c1af
2016-03-22 16:26:27 +09:00
Masayuki Nakano 7bcaf602d0 Bug 1154183 part.2 eKeyDown event should have charCode value of following keypress event r=smaug
MozReview-Commit-ID: 9duzKfCFPro
2016-03-19 20:57:11 +09:00
Masayuki Nakano 22e9178025 Bug 1137561 part.5 TextEventDispatcher should decide if keypress events should be fired for specific keys r=m_kato 2016-03-16 13:47:49 +09:00
Masayuki Nakano 04597dabbb Bug 1137561 part.2 Make TSFTextStore use TextEventDispatcher r=m_kato 2016-03-16 13:47:48 +09:00
Masayuki Nakano 8f5b9a4048 Bug 1137572 part.9 TextEventDispatcher should not allow WillDispatchKeyboardEvent() modifies unexpected members of WidgetKeyboardEvent r=smaug 2016-03-16 13:47:48 +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 3e80dd382b Bug 1137572 part.7 Add TextEventDispatcherListener::WillDispatchKeyboardEvent() for easier to maintain r=smaug 2016-03-16 13:47:48 +09:00