Bug 1396976 - Flush IME document changes when entering nested Document Update, r=masayuki
authorMichael Layzell <michael@thelayzells.com>
Tue, 12 Sep 2017 15:55:01 -0400
changeset 430202 0d1afc4073ab81f7fb892018469cf594654ddda1
parent 430201 e4c134cc9847b8f4057fa30813362a4343ecd92c
child 430203 fa8b67b47624e17900b25d99de5da83d733821ae
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1396976
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1396976 - Flush IME document changes when entering nested Document Update, r=masayuki
dom/events/IMEContentObserver.cpp
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -1371,17 +1371,20 @@ IMEContentObserver::MaybeNotifyIMEOfAdde
 void
 IMEContentObserver::BeginDocumentUpdate()
 {
   MOZ_LOG(sIMECOLog, LogLevel::Debug,
     ("0x%p IMEContentObserver::BeginDocumentUpdate(), "
      "HasAddedNodesDuringDocumentChange()=%s",
      this, ToChar(HasAddedNodesDuringDocumentChange())));
 
-  MOZ_ASSERT(!HasAddedNodesDuringDocumentChange());
+  // If we're not in a nested document update, this will return early,
+  // otherwise, it will handle flusing any changes currently pending before
+  // entering a nested document update.
+  MaybeNotifyIMEOfAddedTextDuringDocumentChange();
 }
 
 void
 IMEContentObserver::EndDocumentUpdate()
 {
   MOZ_LOG(sIMECOLog, LogLevel::Debug,
     ("0x%p IMEContentObserver::EndDocumentUpdate(), "
      "HasAddedNodesDuringDocumentChange()=%s",