Commit Graph

68 Commits

Author SHA1 Message Date
Olli Pettay
f785d80029 Bug 1385666, ensure layout is flushed when editor gets focus, r=masayuki
--HG--
extra : rebase_source : 2dd86e64001fa48469a93849516e26c41c9163e4
2017-08-03 19:36:58 +03:00
Olli Pettay
da0ec0a364 Bug 1375491, make child process to cache ime properties only at animation tick time, r=masayuki
--HG--
extra : rebase_source : 6f13f4d91fc4873d135824431adb4b0b2843b738
2017-06-29 14:46:11 +03:00
Masayuki Nakano
583dafd5d4 Bug 1374207 - part2: TextComposition, IMEContentObserver and IMEStateManager should use EditorBase instead of nsIEditor r=m_kato
MozReview-Commit-ID: IdHmseTiv2t

--HG--
extra : rebase_source : b2f9f42dee97e1ba2cc081014d1696506088d375
2017-06-20 19:23:44 +09:00
Masayuki Nakano
696e4cb85a Bug 1250823 part 2 - IMEContentObserver should cache adding ranges as a range during document change r=smaug
Between nsIDocumentObserver::BeginUpdate() and nsIDocumentObserver::EndUpdate(), IMEContentObserver can cache added nodes as a range if they are consecutive nodes.  Even if a node is removed, a data node is changed or attribute is changed unexpectedly, IMEContentObserver can post text change of the added node range and handle it normally.

MozReview-Commit-ID: IttDHBkr92Y

--HG--
extra : rebase_source : f0849d5fab0b28bdfa311cf833a216d43b9215d2
2017-06-08 11:24:58 +09:00
Masayuki Nakano
a5bc18e848 Bug 1250823 part 1 - Implement DocumentObserver as a nested class of IMEContentObserver for observing to begin and end update r=smaug
IMEContentObserver can reduce the number of times to compute node offsets with caching all added nodes as a range.  For that, it needs to know when it starts to update and ends updating the document.

nsIDocumentObserver is a subclass of nsIMutationObserver and IMEContentObserver is a mutation observer of editor's root content.  Therefore, if we change IMEContentObserver to a document observer, each mutation observer method needs to check if the change occurs in the observing editor.  Therefore, this patch implements document observer as its nested class and manages it as a member of IMEContentObserver.

MozReview-Commit-ID: HPSPfajxjnx

--HG--
extra : rebase_source : fd4bdcc24759040fb6c39317024049a3a924fc67
2017-06-08 11:21:28 +09:00
Masayuki Nakano
78a637e5f7 Bug 1359547 EventStateManager should grab IMEContentObserver with local variable before calling HandleQueryContentEvent() r=smaug 2017-04-28 20:09:55 +09:00
Masayuki Nakano
7b52d07cd2 Bug 1217700 part.2 IMEContentObserver should observe all possible notifications and check if it should be notified when it occurs r=m_kato
IMEContentObserver can store pointer of IMENotificationRequests of its mWidget.  Therefore, it can check the requests dynamically when it receives content change or layout change.

This patch makes IMEContentObserver stores IMENotificationRequests as pointer and check it at every change notification received.  Additionally, notification request may be changed due to focus move or something.  Therefore, this patch makes IMEContentObserver and IMEContentObserver::IMENotificationSender() check if the notifications are still necessary.

MozReview-Commit-ID: 2uU2wN15D8v

--HG--
extra : rebase_source : 6086e0293343632df43087c767ad00521e764476
2017-04-13 14:32:12 +09:00
Masayuki Nakano
61ce5526c6 Bug 1296220 Rename nsIMEUpdatePreference to mozilla::widget::IMEUpdatePreference r=m_kato
MozReview-Commit-ID: 2rIXTlwA6my

--HG--
extra : rebase_source : a51be3edd717092738c2b5e8ccc4f60540712bfd
2017-04-11 21:24:55 +09:00
Bill McCloskey
194043ae97 Bug 1339289 - Give names to a lot of common runnables (r=ehsan)
MozReview-Commit-ID: 5IdvK6kgoAW
2017-02-15 12:30:01 -08:00
Masayuki Nakano
e1d8dafcd9 Bug 1282668 Get rid of nsIMEUpdatePreference::NOTIFY_SELECTION_CHANGE r=m_kato
Currently, all widgets request selection change notifications to IMEContentObserver.  Additionally, IMEContentObserver needs to listen selection changes for caching latest selection for eQuerySelectedText.  Therefore, it doesn't make sense to keep defining nsIMEUpdatePreference::NOTIFY_SELECTION_CHANGE.

If widgets didn't need selection change notifications, they could just ignore the unnecessary notifications.

Note that all widgets don't need selection change notifications if a plugin has focus and IMEContentObserver cannot observe selection changes in the plugin.  Therefore, if IMEContentObserver is initialized with a plugin, it shouldn't listen selection changes (and doesn't need to notify widgets of selection changes).

MozReview-Commit-ID: FOVFFgA2nOz

--HG--
extra : rebase_source : 3e16d5023835f99f82934e754d2e7db70474f9ee
2016-06-28 15:23:12 +09:00
Masayuki Nakano
54e57600e1 Bug 1275906 part.2 TextComposition should use IMEContentObserver for sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED if the editor which has the composition is in the active IMEContentObserver r=smaug
For sending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED after the other change notifications which was caused by the user input, we need to use IMEContentObserver::IMENotificationSender because it sends the notifications when it's safe to do it.

This patch makes TextComposition use IMEContentObserver to send the notification.  However, if there is no active IMEContentObserver, e.g., composition events are fired on unfocused window, TextComposition sends it by itself (same as current implementation).

If IMEContentObserver stops observing when it has pending NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED, it cannot send the notification (i.e., it is discarded completely in such case). However, in such case, IMEContentObserver sends NOTIFY_IME_OF_BLUR.  So, anyway, native IME handler should treat the blur notification as it including NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED.

On the other hand, we're buggy if composition events are fired in non-active window.  Even in such case, IMEContentObserver should be created for active editor in each document and it notifies IME of the changes. But this is out of the scope of this bug.

MozReview-Commit-ID: 7Q0ZsJTh4hX

--HG--
extra : rebase_source : 6417f991fa8c0fbe3f25b27bacf4257e5485aecc
2016-06-01 22:14:41 +09:00
Kyle Huey
c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
Masayuki Nakano
14e03f9711 Bug 1213589 part.6 ContentEventHandler should insert line breaks at open tag of elements except non-replaced inline elements r=smaug 2015-12-02 13:20:00 +09:00
Masayuki Nakano
18395c1495 Bug 1213589 part.2 Clean up GenerateFlatTextContent(), GelerateFlatFontRanges() and GetFlatTextOffsetOfRange() of ContentEventHandler r=smaug 2015-12-02 13:20:00 +09:00
Masayuki Nakano
8973128bba Bug 1218032 part.4 Notify IMEContentObserver of enough safe timing to notify IME of something r=smaug 2015-11-10 11:49:05 +09:00
Masayuki Nakano
0727f7951c Bug 1218032 part.3 IMEContentObserver should notify IME of anything without script runner r=smaug 2015-11-10 11:49:05 +09:00
Masayuki Nakano
e16aa473be Bug 1218032 part.2 Make sending focus notification to IME async-aware r=smaug 2015-11-10 11:49:04 +09:00
Masayuki Nakano
35aa5312ba Bug 1184890 part.1 SelectionChangeDataBase and TextChangeDataBase should have a flag which indicates whether the change occurred during composition or not r=smaug 2015-10-27 07:21:37 +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
27b1c48ce9 Bug 1211352 part.1 IMEContentObserver should be created when a plugin has focus r=smaug 2015-10-10 10:21:01 +09:00
Masayuki Nakano
de86db826f Bug 1203381 part.7 Rename IMEContentObserver::mIs*ChangeEventPending to IMEContentObserver::mNeedsToNotifyIMEOf*Change r=smaug 2015-09-16 17:48:24 +09:00
Masayuki Nakano
c86595d5c2 Bug 1203381 part.6 IMEContentObserver shouldn't post position change event if Reflow() is called during handling a query content event and sending NOTIFY_IME_OF_POSITION_CHANGE since the result of query content event includes the latest layout information r=smaug 2015-09-16 17:48:24 +09:00
Masayuki Nakano
79986a5341 Bug 1203381 part.5 IMENotificationSender shouldn't send notification recursively r=smaug 2015-09-16 17:48:24 +09:00
Masayuki Nakano
dd3b53fdeb Bug 1203381 part.3 IMEContentObserver::mIsFlushingPendingNotifications should be cleared when all pending notifications are sent to IME r=smaug 2015-09-16 17:48:24 +09:00
Masayuki Nakano
f0f11443a3 Bug 1203381 part.2 Merge all IME notification sending events of IMEContentObserver to a runnable class r=smaug 2015-09-16 17:48:24 +09:00
Masayuki Nakano
215b9f4894 Bug 1203381 part.1 IMEContentObserver shouldn't clear mTextChangeData until immediately before sending a text change notification r=smaug 2015-09-16 17:48:23 +09:00
Masayuki Nakano
c985d88dab Bug 1203364 IMEContentObserver should notify IME of selection change with the latest change reason r=smaug 2015-09-14 23:28:43 +09:00
Masayuki Nakano
1a4e1c06f7 Bug 1200980 part.3 IMEContentObserver should use its selection cache at handling NS_QUERY_SELECTED_TEXT r=smaug 2015-09-08 12:54:14 +09:00
Masayuki Nakano
b7165d94e4 Bug 1200980 part.2 QueryContentEvent should be handled via IMEContentObserver if there is an instance of it r=smaug 2015-09-08 12:54:14 +09:00
Masayuki Nakano
b97fbbb4aa Bug 1200980 part.1 Log the behavior of IMEContentObserver for debugging r=smaug 2015-09-08 12:54:14 +09:00
Masayuki Nakano
d2cd0b82ed Bug 1189396 part.4 IMEContentObserver should cache the selection data at notifying IME of selection change r=smaug 2015-08-22 01:43:41 +09:00
Masayuki Nakano
4d9802aec0 Bug 1176955 part.2 NOTIFY_IME_OF_SELECTION should have a flag which indicates if it's caused by a selection event r=smaug 2015-07-17 11:25:00 +09:00
Masayuki Nakano
09355c0e38 Bug 1176954 part.7 IMENotification::TextChangeData should have a method to merge with another instance and IMENotification::MergeWith() should use it r=smaug 2015-07-11 10:53:56 +09:00
Masayuki Nakano
373659f7f5 Bug 1176954 part.6 IMEContentObserver should use IMENotification::TextChangeData r=smaug 2015-07-11 10:53:56 +09:00
Masayuki Nakano
94bb7f1516 Bug 1172466 part.4 Don't notify IME during reflow r=smaug 2015-06-17 10:03:57 +09:00
Masayuki Nakano
81de1dd26c Bug 1172466 part.3 Create an abstruct class which is a base class of classes notifying IME r=smaug 2015-06-17 10:03:57 +09:00
Masayuki Nakano
031f99fbda Bug 1172466 part.2 Use runnable event for notifying IME of focus r=smaug 2015-06-17 10:03:57 +09:00
Masayuki Nakano
851cb14bbc Bug 1172466 part.1 Make helper classes to notify IME nested classes of IMEContentObserver r=smaug 2015-06-17 10:03:57 +09:00
Masayuki Nakano
29e56f5a88 Bug 1162818 part.6 Don't notify IME of anything during reframing the editor r=smaug 2015-06-05 02:06:10 +09:00
Masayuki Nakano
60aec72097 Bug 1167022 part.5 IMEContentObserver::Init() should stop keeping to initialize in the first call because Init() may be called again during notifying IME of focus due to flushing layout r=smaug 2015-05-26 16:45:26 +09:00
Masayuki Nakano
91298b51a5 Bug 1167022 part.4 Get rid of MozIMEFocus(In|Out) events r=smaug 2015-05-26 16:45:26 +09:00
Masayuki Nakano
f9ae17caea Bug 1167022 part.2 IMEStateManager::UpdateIMEState() should try to restart to observe focused editor when it's reframed r=smaug+nchen 2015-05-26 16:45:26 +09:00
Masayuki Nakano
2af6616c71 Bug 1167022 part.1 Make IMEContentObserver possible to restart to observe editor root node r=smaug 2015-05-26 16:45:26 +09:00
Phil Ringnalda
53b4601f96 Back out 4 changesets (bug 1167022) for reftest-e10s bustage
CLOSED TREE

Backed out changeset de4013b979a7 (bug 1167022)
Backed out changeset b97f76c4be1c (bug 1167022)
Backed out changeset cbc7f8b88a46 (bug 1167022)
Backed out changeset 00b1c04181d3 (bug 1167022)
2015-05-23 21:40:21 -07:00
Masayuki Nakano
bdb3dae876 Bug 1167022 part.4 Get rid of MozIMEFocus(In|Out) events r=smaug 2015-05-24 10:11:37 +09:00
Masayuki Nakano
bbfdde48f6 Bug 1167022 part.2 IMEStateManager::UpdateIMEState() should try to restart to observe focused editor when it's reframed r=smaug+nchen 2015-05-24 10:11:37 +09:00
Masayuki Nakano
3a846afa05 Bug 1167022 part.1 Make IMEContentObserver possible to restart to observe editor root node r=smaug 2015-05-24 10:11:37 +09:00
Masayuki Nakano
ee32a82c8d Bug 1130935 part.6 Selection change notification should have selection range and writing mode information r=smaug 2015-05-15 10:18:08 +09:00
Andrew McCreight
9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Andrea Marchesini
e6f385fb3d Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00