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

44 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 6ae29c9c6d Bug 1273510 part.3 We should not return TS_E_NOLAYOUT when ATOK decides its suggest window r=m_kato
Returing TS_E_NOLAYOUT while ATOK shows suggest window causes moving suggest window to odd position.  This causes flicking the window.  Therefore, we shouldn't return TS_E_NOLAYOUT in this case.  In this case, ATOK queries whole rect of composition string.  So, we can return TS_E_NOLAYOUT for other cases.

MozReview-Commit-ID: LBZQPFjqQgx

--HG--
extra : rebase_source : 27fda6739562dfaf89efd1d2cd9cac03610846ba
2016-08-17 14:07:54 +09:00
Masayuki Nakano 1f206a7c93 Bug 1273510 part.1 TSFTextStore should use native caret hack only when ATOK 2011 - 2016 is active r=m_kato
ATOK 2011 - 2016 check focused window class name if it's a Mozilla's window.  Then, they refer native caret position for deciding its popup window.  However, future ATOK release will stop referring native caret position on Mozilla's windows.  Therefore, we can stop creating native caret for new ATOK.

MozReview-Commit-ID: HPh3DVqTkvc

--HG--
extra : rebase_source : 00b75b75df2ba1bace328cfb75172c78c6bea29d
2016-08-09 16:53:00 +09:00
Masayuki Nakano 2aaddf71a7 Bug 1293957 part.1 TSFTextStore::Content::mMinTextModifiedOffset should be treated as the first offset of modified characters r=m_kato
Currently, TSFTextStore::GetTextExt() checks the offset with mContentForTSF.MinOffsetOfLayoutChanged() as "the first offset of modified characters", however, TSFTextStore::Content::IsLayoutChangedAfter() needs actual offset - 1. This is really not useful. So, we should rename it to IsLayoutChangedAt() and check the offset simply.

Additonally, TSFTextStore::GetTextExt() should set previous offset of MinOffsetOfLayoutChanged() when it hacks the queried range for avoiding bug of active TIP since setting offsets to the result of MinOffsetOfLayoutChanged() means the offset's layout is always not computed yet.

MozReview-Commit-ID: 182BMuubtFc

--HG--
extra : rebase_source : 65355fc4e488592f59dfc0b44806571ff0b87cd6
2016-08-10 18:48:50 +09:00
Masayuki Nakano 686645193f Bug 1286157 TSFTextStore should use insertion point relative offset query when cached contents for TSF and actual content (or content cache) are different r=m_kato
MozReview-Commit-ID: 3Q9T3XVvyCj

--HG--
extra : rebase_source : 9507ccd2dfdf4fe039435d04c1f79d490be785fd
2016-07-12 16:52:48 +09:00
Carsten "Tomcat" Book b9a6c687fa merge mozilla-inbound to mozilla-central a=merge 2016-07-25 15:50:41 +02:00
Masayuki Nakano 464384943c Bug 1288318 Initialize TSFTextStore::mInputScopes at initializing its members rather than after setting focus to the context r=m_kato
In CreateAndSetFocus(), SetInputScope() is called *after* setting focus to the context. At this time, Google Japanese Input retrieves InputScopes. Therefore, TSFTextStore returns IS_DEFAULT. But after that, Google Japanese Input tries to retrieve InputScopes after every notification (in this case, a call of ITextStoreACPSink::OnLayoutChange()). Then, we return IS_URL due to set after returns IS_DEFAULT.

This is actually our fault, but according to the other TIPs, Google Japanese Input shouldn't commit composition at detecting an InputScope change, though.

MozReview-Commit-ID: 2tPlcEA0MI0

--HG--
extra : rebase_source : 0956bf79ed84b7b901b6314bb483e40436d49751
2016-07-22 23:30:12 +09:00
Thomas Zimmermann 48ef99e762 Bug 1265386: Fix white-space errors in widget/, r=nfroyd
MozReview-Commit-ID: ATXI7dYFHmA
2016-07-22 10:56:13 +02:00
Masayuki Nakano c960d127a3 Bug 1224994 part.11 Rename TSFTextStore::CurrentSelection() to TSFTextStore::SelectionForTSF() r=m_kato
MozReview-Commit-ID: 9KVLN63NL9Z

--HG--
extra : rebase_source : 1976385d19fbdd2f0beb6de4b1bf745a35a06015
2016-07-01 14:09:52 +09:00
Masayuki Nakano 5a696fa2b9 Bug 1224994 part.10 Rename TSFTextStore::mSelection to TSFTextStore::mSelectionForTSF for making its meaning clearer r=m_kato
MozReview-Commit-ID: K9tVAw9aCaN

--HG--
extra : rebase_source : fcd8ef087e5f66f1698eb4dc65bc9668ae818a7f
2016-07-01 14:01:26 +09:00
Masayuki Nakano 5a22169d73 Bug 1224994 part.9 TSFTextStore shouldn't set selection when there is unknown pending text changes r=m_kato
I'm still not sure what we should do in this case, though.

If mContentForTSF is initialized and there are some unknown changes in actual contents, i.e., not caused by composition of the active TIP itself, we cannot set selection range properly in some cases.

For example, if TSF tires to set non-empty selection range but the range has been removed by web apps.

For now, let's try to return E_FAIL in such case because that should occur at reconversion or something immediately after previous content change not caused by previous composition.  If TIP does nothing in this case, user can retry with same operation after all pending text changes are notified to TSF.

MozReview-Commit-ID: 9unrNVeC1tW

--HG--
extra : rebase_source : 061e48e014a38b2a442bf736031febfe0b1e333d
2016-06-30 17:55:01 +09:00
Masayuki Nakano 52dc580a74 Bug 1224994 part.8 Don't notify TSF of text changes while there is cached content r=m_kato
Same as selection change notification, text change notification shouldn't be notified to TSF while there is cachec content because neither TSF nor TIP may allow to change text by web applications during keeping storing cached content.

This patch makes TSFTextStore stores and merges text changes until MaybeFlushPendingNotifications() is called and there is no cached content.

MozReview-Commit-ID: 9fj0GREbX18

--HG--
extra : rebase_source : 71db6b4b9f0ab979313398a8014bde992183e019
2016-06-30 15:04:02 +09:00
Masayuki Nakano 7bde7206c2 Bug 1224994 part.7 Don't notify TSF of selection changes while there is a cached content r=m_kato
TSFTextStore shouldn't notify TSF of selection change until MaybeFlushPendingNotifications() is called and there is no cached content because while there is cached content, neither TSF nor TIP may allow to change selection by web applications.  Therefore, ITextStoreACP::GetSelection() and similar methods need to use mSelection instead of actual selection in the focused editor.  Therefore, TSFTextStore should store selection change data during keeping storing content cache and notify it when the cache is cleared. So, when TSFTextStore notifies TSF of selection change, TSFTextStore needs to update mSelection to the actual selection which is stored in mPendingSelectionChangeData.

MozReview-Commit-ID: 8ZWASzu7Znv

--HG--
extra : rebase_source : 0bfaef0bbffd72d661c84992cc8c842215e3407a
2016-06-30 16:17:11 +09:00
Masayuki Nakano 0ce8b30a41 Bug 1224994 part.6 Don't clear TSFTextStore::mContentForTSF until active composition is committed r=m_kato
This patch stop clearing mContentForTSF at unlocking the document because we should keep it until active composition is committed.  If so, TSF/TIP won't be confused by content changes by JS.  So, this is important for a11y of TIP users in some complicated websites like GoogleDocs, Facebook, etc.

Note that this patch doesn't work well without following patches.  We need to stop notifying TSF of selection changes and text changed while mContentForTSF is valid.

MozReview-Commit-ID: 9QOGZxdYU3I

--HG--
extra : rebase_source : 19a6eeb2357825643497caf5a5298c55f08a0670
2016-06-29 18:24:10 +09:00
Masayuki Nakano c7b1162cd6 Bug 1224994 part.5 Implement TSFTextStore::IsComposingInContent() to check if the focused editor has composition r=m_kato
MozReview-Commit-ID: 2bmGeaxUpUU

--HG--
extra : rebase_source : 950febee0572bb8ff47b6640980a9e9a45211214
2016-06-29 17:39:59 +09:00
Masayuki Nakano bee80a0a51 Bug 1224994 part.3 Rename TSFTextStore::mDeferClearingLockedContent to TSFTextStore::mDeferClearingContentForTSF r=m_kato
MozReview-Commit-ID: 9cZ3Itx2zb4

--HG--
extra : rebase_source : e6af75e2190e55e18592b2ebe90d01f27b53f845
2016-06-29 17:22:09 +09:00
Masayuki Nakano 74ae5264af Bug 1224994 part.2 Rename TSFTextStore::LockedContent() to TSFTextStore::ContentForTSFRef() r=m_kato
MozReview-Commit-ID: JC4lgZu38e9

--HG--
extra : rebase_source : 4e643d8728a05f2c1550395a4a29b0c1718fa7a7
2016-06-29 17:18:44 +09:00
Masayuki Nakano 1a8bd9d18d Bug 1224994 part.1 Rename TSFTextStore::mLockedContent to TSFTextStore::mContentForTSF r=m_kato
MozReview-Commit-ID: 5K0zPW1Mx4b

--HG--
extra : rebase_source : 7ba0c30dba75c57310976f8ad9fc0a2aa04bf4f4
2016-06-29 17:15:40 +09:00
Masayuki Nakano c3611a1825 Bug 1278084 part.2 TSFTextStore should allow TSF to lock the document even during destroying r=m_kato
While a TSFTextStore instance is being destroyed, TSFTextStore::Destroy() tries to commit remaining composition and notify TSF of destroying the view.  At this moment, TSF/TIP may try to commit the composition or retrieve the contents with calling ITextStoreACP::RequestLock() but currently TSFTextStore disallows the requests to lock of them.  This means that TSFTextStore never sends composition commit events asynchronously.  Therefore, TextComposition may keep waiting remaining composition events but this causes odd behavior because they won't be fired.

For avoiding this issue, TSFTextStore should behave as normal even while it's being destroyed.  Fortunately, if there is a composition, it always has mLockedContent and mSelection.  So, it can compute expected results of TSF/TIP with them.

MozReview-Commit-ID: 2DSCGXXkLx1

--HG--
extra : rebase_source : 1dc5d08186bc50e7c3f1d9c5fe885ed855db8319
2016-06-08 19:12:07 +09:00
Masayuki Nakano 8cf45849ef Bug 1278084 part.1 Don't release TSF objects during handling a key message r=m_kato
While TIP is handling a key message, TSFTextStore shouldn't release any TSF objects since it may cause hitting a bug of TIPs.  Actually, MS-IME for Japanese on Windows 10 crashes when TSFTextStore is destroyed during composition because probably it accesses some destroyed objects to request to commit composition or query contents.

MozReview-Commit-ID: 9CTjHhAvG04

--HG--
extra : rebase_source : c34041962927795fe0d288aed10a96cf064b6243
2016-06-06 21:07:24 +09:00
Carsten "Tomcat" Book d2a1babef4 Backed out changeset 2bea1e1e403d (bug 1265386) for bustage on a CLOSED TREE 2016-07-21 13:59:02 +02:00
Thomas Zimmermann d8818e0d94 Bug 1265386: Fix white-space errors in widget/, r=nfroyd
MozReview-Commit-ID: ATXI7dYFHmA
2016-07-21 13:29:30 +02:00
Masayuki Nakano 5d4da6c226 Bug 1267526 part.1 TSFTextStore shouldn't notify TSF of selectin change when the selection isn't actually changed r=m_kato
MozReview-Commit-ID: 8HLz30lR2TH

--HG--
extra : rebase_source : 81b9ddb643eb4878e9d6c6c5457d7a016039a1b6
2016-05-11 18:18:51 +09:00
Jonathan Watt 05a14131e5 Bug 1265953, part 2 - Convert much of the rest of the widget code from nsAutoPtr to UniquePtr. r=mstange 2016-04-19 21:51:25 +01:00
Jacek Caban a87302bd04 Bug 1263653 - Fixed TSFTextStore.h compilation with mingw. r=masayuki 2016-04-12 12:37:18 +02:00
Masayuki Nakano 34e8cd4937 Bug 1255627 Don't call methods of TSFTextStore::sEnabledTextStore without independent strong reference to it r=m_kato
TSFTextStore::sEnabledTextStore is a static variable to grab a reference to focused TextStore instance.  So, this may be changed by accidentally during a call of instance methods of TSFTextStore.  Then, focused TextStore may be destroyed during running a method and crash when it accesses a member variable.

For avoiding this crash, static methods which call a method of sEnabledTextStore should create an independent RefPtr to it before calling the method.

MozReview-Commit-ID: 51Sor1LdABr

--HG--
extra : rebase_source : ec6eb378eb4d8b323e8ad28079f27220cae0d0d8
2016-04-07 02:17:05 +09:00
Masayuki Nakano 04597dabbb Bug 1137561 part.2 Make TSFTextStore use TextEventDispatcher r=m_kato 2016-03-16 13:47:48 +09:00
Gijs Kruitbosch 957a33f4d4 Bug 1240208 - use inputmode in XUL to get better hinting for IME and on-screen keyboards, r=masayuki,smaug
--HG--
extra : commitid : KANhgN15KJK
extra : rebase_source : 0b640769e92d9d8c01e972c2b526ea56cc56d1df
2016-02-01 17:57:29 +00:00
Masayuki Nakano dd9381cdcb Bug 1242895 Put off to commit/cancel composition after unlocking the document in TSF mode r=m_kato 2016-01-27 15:09:13 +09:00
Masayuki Nakano 8b05c85ea0 Bug 1237216 TSFTextStore should forget redundant pending composition events for Korean TIPs r=emk 2016-01-18 16:29:02 +09:00
Masayuki Nakano 16898a75f2 Bug 1234422 TSFTextStore should retry to notify TSF/TIP of layout change if synchronous calls of OnLayoutChange() don't cause retrieving layout information r=m_kato 2015-12-30 01:05:46 +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 2e3a1cee0d Bug 1208043 If composition is started with InsertTextAtSelection() and OnStartComposition() is called later, RecordCompositionStartAction() should cancel the last pending compositionend r=emk 2015-10-02 10:51:47 +09:00
Masayuki Nakano 1983959f97 Bug 1208969 TSFTextStore shouldn't grant document lock after starting to destroy the context r=emk 2015-09-29 17:08:42 +09:00
Masayuki Nakano 19212d7c5f Bug 1204519 part.1 Remove hack for TS_E_NOLAYOUT issue of Google Japanese Input r=emk 2015-09-18 09:58:17 +09:00
Masayuki Nakano 206cb16099 Bug 1204523 part.2 Hack TSFTextStore::GetTextExt() for TS_E_NOLAYOUT issue of MS-IME for Japanese r=emk 2015-09-18 09:58:17 +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 d177b04a17 Bug 895274 part.145 Rename NS_SELECTION_SET to eSetSelection r=smaug 2015-09-08 23:33:38 +09:00
Masayuki Nakano 0b0589df8e Bug 1199997 TSFTextStore::QueryInsert() should return specified range if the TIP is one of buggy Chinese TIPs of Microsoft r=emk 2015-09-04 20:55:09 +09:00
Masayuki Nakano 1ec05e1f5f Bug 1199224 TSFTextStore should clear mLockedContent unless it needs to wait the content to be modified asynchronously r=emk 2015-08-28 23:17:37 +09:00
Masayuki Nakano e0bbfb1c32 Bug 1050644 part.2 Hack ITextStoreACP::GetTextExt()'s offset for some Chinese TIPs of MS r=emk 2015-08-03 15:15:30 +09:00
Masayuki Nakano 329cd406f9 Bug 1187566 TSFTextStore::Content should compute mMinTextModified Offset only with the latest composition string and original composition string, and also the hack should be enabled on Win10 r=emk 2015-08-03 15:15:30 +09:00
Masayuki Nakano 904118cf22 Bug 1187367 TSFTextStore shouldn't destroy native caret for ATOK until notifying TSF of layout change r=emk 2015-07-26 12:29:47 +09:00
Masayuki Nakano 0f87c9db55 Bug 1187351 TSFTextStore should forget modified range at notifying TSF of layout change since GetTextExt() shouldn't return TS_E_NOLAYOUT after that r=emk 2015-07-26 12:29:47 +09:00
Masayuki Nakano 8942b13e62 Bug 1186014 Rename nsTextStore to mozilla::widget::TSFTextStore r=jimm+m_kato
--HG--
rename : widget/windows/nsTextStore.cpp => widget/windows/TSFTextStore.cpp
rename : widget/windows/nsTextStore.h => widget/windows/TSFTextStore.h
2015-07-24 14:07:39 +09:00