Bug 874754 - Suppress nsIEditor.removeEditorObserver exception. r=fabrice
authorKan-Ru Chen (陳侃如) <kanru@kanru.info>
Tue, 16 Jul 2013 18:00:58 +0800
changeset 138707 e0e452cfde99450ebcba8ee022e875248de59589
parent 138706 f1f4e52889557900cf36bd6973c0882e38585d17
child 138708 80cb8e47c0089d8cf69147040cbec02c432ef28d
push id24964
push userryanvm@gmail.com
push dateTue, 16 Jul 2013 20:04:09 +0000
treeherderautoland@fd10ead17ace [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs874754
milestone25.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 874754 - Suppress nsIEditor.removeEditorObserver exception. r=fabrice Based on patch from Yuan Xulei <xyuan@mozilla.com>
b2g/chrome/content/forms.js
--- a/b2g/chrome/content/forms.js
+++ b/b2g/chrome/content/forms.js
@@ -230,17 +230,23 @@ let FormAssistant = {
       this.focusedElement.removeEventListener('mouseup', this);
       if (!element) {
         this.focusedElement.blur();
       }
     }
 
     this._documentEncoder = null;
     if (this._editor) {
-      this._editor.removeEditorObserver(this);
+      // When the nsIFrame of the input element is reconstructed by
+      // CSS restyling, the editor observers are removed. Catch
+      // [nsIEditor.removeEditorObserver] failure exception if that
+      // happens.
+      try {
+        this._editor.removeEditorObserver(this);
+      } catch (e) {}
       this._editor = null;
     }
 
     if (element) {
       element.addEventListener('mousedown', this);
       element.addEventListener('mouseup', this);
       if (isContentEditable(element)) {
         this._documentEncoder = getDocumentEncoder(element);