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

56 Коммитов

Автор SHA1 Сообщение Дата
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
Masayuki Nakano 3c4efaa1cc Bug 1137572 part.6 TextEventDispatcher::DispatchKeyboardEventInternal() should copy mNativeKeyEvent when it's in native text input transaction r=smaug 2016-03-16 13:47:48 +09:00
Masayuki Nakano da1a9a4507 Bug 1137572 part.5 Implement TextEventDispatcher::SetPendingComposition() for some platforms whose clause information may overlap each other or the order may not be from start to the end r=smaug 2016-03-16 13:47:48 +09:00
Masayuki Nakano e7fa655b11 Bug 1137572 part.4 TextEventDispatcher::DispatchInputEvent() should decide if dispatches events with nsIWidget::DispatchInputEvent() with input transaction type r=smaug 2016-03-16 13:47:48 +09:00
Masayuki Nakano e65433cc66 Bug 1137572 part.3 Use pseudo IME context when TextEventDispatcher has input transaction which is not for native event handler r=smaug 2016-03-16 13:47:47 +09:00
Masayuki Nakano 3a5c26cf72 Bug 1137572 part.2 Add nsIWidget::GetNativeTextEventDispatcherListener() for TextEventDispatcher::NotifyIME() r=smaug, sr=smaug 2016-03-16 13:47:47 +09:00
Masayuki Nakano 13c20e8b89 Bug 1137572 part.1 TextEventDispatcher should manage its input transaction type r=smaug 2016-03-16 13:47:47 +09:00
Masayuki Nakano da7a2f4f8d Bug 1179632 part.2 WidgetCompositionEvent should store NativeIMEContext which caused the event and PuppetWidget should store it for GetNativeIMEContext() r=smaug, sr=smaug 2015-12-11 15:15:57 +09:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Masayuki Nakano 888b2103ea Bug 895274 part.194 Rename NS_COMPOSITION_COMMIT to eCompositionCommit r=smaug 2015-09-11 21:21:27 +09:00
Masayuki Nakano ed4dac1ca6 Bug 895274 part.193 Rename NS_COMPOSITION_CHANGE to eCompositionChange r=smaug 2015-09-11 21:21:27 +09:00
Masayuki Nakano 0f2bfad9b1 Bug 895274 part.190 Rename NS_COMPOSITION_START to eCompositionStart r=smaug 2015-09-11 21:21:27 +09:00
Masayuki Nakano 966f685af3 Bug 895274 part.188 Rename NS_COMPOSITION_COMMIT_AS_IS to eCompositionCommitAsIs r=smaug 2015-09-11 21:21:26 +09:00
Masayuki Nakano ba5b3f3fe6 Bug 895274 part.11 Rename NS_KEY_DOWN to eKeyDown r=smaug 2015-08-29 08:58:27 +09:00
Masayuki Nakano 28c9f34179 Bug 895274 part.10 Rename NS_KEY_UP to eKeyUp r=smaug 2015-08-29 08:58:27 +09:00
Masayuki Nakano d311a11cc1 Bug 895274 part.9 Rename NS_KEY_PRESS to eKeyPress r=smaug 2015-08-29 08:58:27 +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 1f0433ec04 Bug 1137557 - Part 0: TextEventDispatcher shouldn't forward keyboard events coming from TextInputProcessor to the parent process. r=smaug
--HG--
extra : source : 81e93b60a622527acc1582ee5ee1e6899ec331ef
2015-08-04 05:52:00 -04:00
Ryan VanderMeulen aeacc8883e Backed out 4 changesets (bug 1137557) for causing intermittent Gij switching_test.js failures.
Backed out changeset ce86cf91f423 (bug 1137557)
Backed out changeset 83af10efcd3c (bug 1137557)
Backed out changeset e48ed45d1c80 (bug 1137557)
Backed out changeset 81e93b60a622 (bug 1137557)

CLOSED TREE

--HG--
extra : rebase_source : 2bf3467951041be553ab34c45d49c445829d21bb
2015-08-24 13:27:01 -04:00
Masayuki Nakano 175d3c0ee8 Bug 1137557 - Part 0: TextEventDispatcher shouldn't forward keyboard events coming from TextInputProcessor to the parent process. r=smaug 2015-08-04 05:52:00 -04:00
Masayuki Nakano 87e3205abe Bug 1119133 Implement TextEventDispatcher::EndInputTransaction() for ensuring TextEventDispatcher forgets the link with TextInputProcessor r=smaug 2015-06-11 12:53:42 +09:00
David Anderson d5f5272884 Allow synthetic input events to be dispatched asynchronously. (bug 1146243, r=kats) 2015-03-24 15:00:52 -07:00
Masayuki Nakano c66d4bddc5 Bug 1119609 part.17 TextInputProcessor shouldn't allow to begin input transaction with different TextEventDispatcher during dispatching an event r=smaug 2015-02-19 15:50:21 +09:00
Masayuki Nakano f706eb2f63 Bug 1119609 part.11 TextEventDispatcher shouldn't allow to begin input transaction during dispatching a event r=smaug 2015-02-19 15:50:20 +09:00
Masayuki Nakano 9de8ad1bb5 Bug 1119609 part.2 Don't dispatch keyboard events from TextEventDispatcher if there is a composition r=smaug 2015-02-19 15:50:18 +09:00
Masayuki Nakano 4015c70a27 Bug 1119609 part.1 Implement key event dispatcher in TextEventDispatcher r=smaug 2015-02-19 15:50:18 +09:00
Masayuki Nakano cebca7ab8a Bug 1131026 Rename nsITextInputProcessor.init() and .initForTests() to .beginInputTransaction() and .beginInputTransactionForTests() r=smaug, sr=smaug 2015-02-10 17:09:29 +09:00
Masayuki Nakano 66d42c3189 Bug 917322 part.15 Create TextEventDispatcherListener abstract class for listening notifications to IME r=smaug, sr=smaug 2015-01-28 15:27:32 +09:00
Masayuki Nakano 9695d94b9d Bug 917322 part.9 TextEventDispatcher::CommitComposition() should return error if caller tries to commit composition non-existing composition with the last data or empty string r=smaug 2015-01-28 15:27:32 +09:00
Masayuki Nakano 7f8e6816c1 Bug 917322 part.8 TextEventDispatcher should start composition automatically even if StartComposition() isn't called explicitly r=smaug 2015-01-28 15:27:31 +09:00