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

69 Коммитов

Автор SHA1 Сообщение Дата
ojab c1eb9d57b7 Bug 1266369 - Don't define kVK_RightCommand when building against the macOS 10.12 SDK. r=masayuki
kVK_RightCommand is already defined in Carbon.framework in 10.12.

MozReview-Commit-ID: 5QWRK4Gokg8

--HG--
extra : amend_source : 14f4059ef2c7cabfc63c33c4cea92b2650b5bc48
2016-07-09 12:57:01 -04:00
Masayuki Nakano f53ea998ce Bug 1280053 TextInputHandler should initialize WidgetKeyboardEvent without already handled characters r=m_kato
TextInputHandler may dispatch keypress events after InsertText() is called if there was composition and it's committed by "current" keydown event. In that case, [NSEvent characters] may have the committing string.  For example, when Opt+e of US keyboard layout started composition, Cmd+v causes committing the "`" character and pasting the clipboard text. Then, the "v" key's keydown event's |characters| is "`v". So, after InsertText() is called with "`", TextInputHandler shouldn't dispatch keypress event for "`" again. I.e., the KeyboardEvent.key value should be "v" rather than "`v".

For solving this issue, TextInputHandlerBase::AutoInsertStringClearer which is created at every InsertText() call should store the inserted string to TextInputHandlerBase::KeyEventState. However, for making the implemntation simpler, it should recode only when the inserting string is actually a part of [mKeyEvent characters]. Then, TextInputHandlerBase::KeyEventState can compute unhandled insert string at initializing WidgetKeyboardEvent.

So, finally, TextInputHandlerBase::InitKeyEvent() should be called via TextInputHandlerBase::KeyEventState::InitKeyEvent(). This ensures that all key events which may cause InsertText() calls are always initialized with unhandled string.

MozReview-Commit-ID: A9o8o9pV2XV

--HG--
extra : rebase_source : d99e9ab7633f45069d0a3940cc2b2b5ad859ea05
2016-06-19 01:13:16 +09:00
Masayuki Nakano a39783f70c Bug 1280355 part.1 TISInputSourceWrapper::CurrentInputSource() should create the static instance when it's called r=m_kato
This is preparation. TISInputSourceWrapper is created before starting XPCOM, however, when its first instance is created, TextInputHandler.mm tries to log all keyboard layouts and IMEs which are installed into the system. This would be problem if it uses LazyLogModule because it's initialized at starting XPCOM.

MozReview-Commit-ID: DWz8TylL175

--HG--
extra : rebase_source : f377530f6325d6fcf8f90be5d6856972e9d312e5
2016-06-16 17:00:38 +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
Makoto Kato 100757988a Bug 1276948 - Remove IMEInputHandler::ConversationIdentifier. r=masayuki
This method is for old NSTextInput API and unused now.

MozReview-Commit-ID: thcbEExH58

--HG--
extra : rebase_source : 7d9f665d867366990c5aac5a54555cc2c3483828
2016-05-31 23:18:04 +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 8a70a17c6a Bug 1254755 part.2 Rename WidgetKeyboardEvent::charCode to WidgetKeyboardEvent::mCharCode r=smaug
And mCharCode shouldn't be compared with NS_VK_*, nsIDOMKeyEvent::DOM_VK_*. Additionally, when it's compared with a character constant, cast isn't necessary.

MozReview-Commit-ID: JMT614copjG

--HG--
extra : rebase_source : 69ee3c589e5a71c814ec9a40ac3aab39c789c11d
2016-05-13 16:06:18 +09:00
Makoto Kato fe5bf359ac Bug 1262363 - Call [NSTextInputContext handleEvent] for mouse support on IME. r=masayuki
Some IME handles mouse event by handleEvent method of NSTextInputcontext.  So we should call it on mouse event for IME

MozReview-Commit-ID: 6lyXCpOJ3yr

--HG--
extra : rebase_source : a180e0750a2f40838cf24d2985638f96899cf2d4
extra : histedit_source : 84ea9a9b113b33d8dc982b855e2271931c1084f9
2016-04-27 21:14:43 +09:00
Masayuki Nakano 063150ff0d Bug 1137563 part.4 Implement IMEInputHandler::WillDispatchKeyboardEvent() r=m_kato 2016-03-16 13:47:50 +09:00
Masayuki Nakano 25c87fdc53 Bug 1137563 part.2 IMEInputHandler should use TextEventDispatcher r=m_kato 2016-03-16 13:47:50 +09:00
Masayuki Nakano 0790ee93ea Bug 1137563 part.1 Implement TextEventDispatcherListener in TextEventInputHandlerBase and IMEInputHandler r=m_kato 2016-03-16 13:47:49 +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 b839a18a25 Bug 1205945 part.5 Emulate mSelectedRange at dispatching compositionchange or compositioncommit event until OnSelectionChange() is called r=smichaud 2015-09-19 11:01:57 +09:00
Masayuki Nakano b6ccad8b3a Bug 1205945 part.4 Move the code of OnEndIMEComposition() into DispatchCompositionCommitEvent() r=smichaud 2015-09-19 11:01:57 +09:00
Masayuki Nakano 1c6093a281 Bug 1205945 part.3 Move the code of OnUpdateIMEComposition() into DispatchCompositionChangeEvent() r=smichaud 2015-09-19 11:01:57 +09:00
Masayuki Nakano 15ec40f3ff Bug 1205945 part.2 Add DispatchCompositionStartEvent() and move the code of OnStartIMEComposition() into it r=smichaud 2015-09-19 11:01:57 +09:00
Masayuki Nakano fbc6a51594 Bug 1205945 part.1 Remove unnecessary member of IMEInputHandler, mLastDispatchedCompositionString r=smichaud 2015-09-19 11:01:57 +09:00
Masayuki Nakano d177b04a17 Bug 895274 part.145 Rename NS_SELECTION_SET to eSetSelection r=smaug 2015-09-08 23:33:38 +09:00
Steven Michaud 4431c47e10 Bug 1148196 - Crashes at -[ChildView keyDown:] related to secure input. r=masayuki 2015-09-01 13:56:23 -05:00
Masayuki Nakano d311a11cc1 Bug 895274 part.9 Rename NS_KEY_PRESS to eKeyPress r=smaug 2015-08-29 08:58:27 +09:00
Makoto Kato f22b71f788 Bug 1167105 - Part 2. Improve OnSelectionChange implementation. r=masayuki 2015-07-21 21:47:54 +09:00
Alexandru Tifrea 750f1d8d1c Bug 966395 - Correctly propagate the input language's direction on OSX. r=masayuki/mrbkap
Gtk patch written by mrbkap@mozilla.com, with r=roc
2015-04-10 15:18:05 -07:00
Jonathan Kew 3becdb3805 Bug 1076657 pt 3 - Support drawsVerticallyForCharacterAtIndex method in Cocoa childView and IME input handler. r=masayuki 2015-02-10 15:28:05 +00:00
David Parks 645064d99a Bug 1051842 - Part 1 - [e10s] crash in -[ChildView keyDown:]. r=smichaud
Fix Cocoa window IME focus test to work even if window has not received
OSX main-window status.
2015-01-12 08:26:05 -08:00
Bill McCloskey b9ede381a2 Bug 1051842 - Backout 7310c42d346e (bug 1051842) due to bug 1122208 2015-01-20 14:04:17 -08:00
David Parks d01c3bcd0b Bug 1051842 - Part 1 - [e10s] crash in -[ChildView keyDown:]. r=smichaud
Fix Cocoa window IME focus test to work even if window has not received
OSX main-window status.
2015-01-12 08:26:05 -08:00
Josh Aas f9e3926e19 Bug 1092630: Get rid of native widgets for OS X NPAPI plugins, make things work much better under e10s. Patch by Josh Aas, Markus Stange, Steven Michaud, David Parks. r=smichaud/jst/josh (more reviews pending) 2014-12-11 08:44:07 -06:00
Masayuki Nakano c89e5a665c Bug 1077345 part.12 IMEInputHandler of Cocoa should use NS_COMPOSITION_COMMIT* event r=smichaud 2014-11-25 14:02:34 +09:00
Masayuki Nakano d028544b2b Bug 960871 part.9 Rename methods and classes which handled WidgetTextEvent r=smaug 2014-10-07 19:01:49 +09:00
Masayuki Nakano 09a5b86212 Bug 960871 part.4 Rename NS_TEXT_TEXT to NS_COMPOSITION_CHANGE and fix comments which mention text events r=smaug 2014-10-07 19:01:47 +09:00
Ehsan Akhgari d65b8ee5d4 Bug 1061001 - Fix more bad implicit constructors in widget; r=roc 2014-08-31 23:33:13 -04:00
Masayuki Nakano 465b11e80f Bug 865649 part.3 Set KeyboardEvent.code value on Mac r=smaug+smichaud 2014-05-25 11:08:59 +09:00
Masayuki Nakano be8f51beba Bug 974318 part.6 Use WidgetTextEvent::mRanges on Mac r=smichaud 2014-03-04 22:48:27 +09:00
Ehsan Akhgari 1b83407ce9 Bug 927728 - Part 1: Replace PRUnichar with char16_t; r=roc
This patch was automatically generated by the following script:

#!/bin/bash
# Command to convert PRUnichar to char16_t

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*modules/libmar*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name prtypes.h \
       ! -name Char16.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRUnichar char16_t
2014-01-04 10:02:17 -05:00
Masayuki Nakano 04cc04ac24 Bug 947115 All tests shouldn't use nsIDOMWindowUtils.sendNativeKeyEvent() directly. Use synthesizeNativeKey() instead. r=smaug 2013-12-18 16:02:46 +09:00
Masayuki Nakano d7fcc64c1e Bug 946044 Handle context menu key of PC keyboard on Mac r=smichaud 2013-12-06 12:16:55 +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 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 0746fb9d0d Bug 920377 part.20 Get rid of nsTextRange 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 0fbfe07d7e Bug 912956 part.2 Rename nsEvent.h to mozilla/EventForwards.h and sort out it r=roc
--HG--
rename : widget/nsEvent.h => widget/EventForwards.h
2013-09-24 19:04:14 +09:00
Masayuki Nakano e79ad519c7 Bug 892539 modifier flag database should be reset if we detect mismatch between the stored data and the latest information via key event r=smichaud 2013-08-29 13:26:43 +09:00
Masayuki Nakano 162b4fa956 Bug 501496 part.3 Don't dispatch keypress events if defaultPrevent() of the keydown event is called on Cocoa r=smaug+smichaud 2013-07-25 15:09:28 +09:00
Masayuki Nakano 659bbecf94 Bug 893973 Check if the keydown event received view actually has focus and separate the MOZ_CRASH() for each case r=smichaud 2013-07-17 11:08:44 +09:00
J. Ryan Stinnett 7c416da7e2 Bug 282097 - Part 7: Simulate native events for testing. r=masayuki 2013-07-10 09:12:40 -05:00
Masayuki Nakano 941229d8ad Bug 875674 part.8 Notify IME of focus change in Gecko for resetting IME stored window level r=smichaud 2013-07-11 16:46:36 +09:00
Masayuki Nakano 1aa2e2af61 Bug 875674 part.7 Implement setMarkedText:selectedRange:replacementRange: of NSTextInputClient r=smichaud 2013-07-11 16:46:36 +09:00
Masayuki Nakano 0c7378b147 Bug 875674 part.6 Implement insertText:replacementRange: of NSTextInputClient r=smichaud 2013-07-11 16:46:35 +09:00
Masayuki Nakano 146b45259e Bug 875674 part.5 Implement attributedSubstringForProposedRange:actualRange: of NSTextInputClient r=roc+smichaud 2013-07-11 16:46:35 +09:00