Bug 838547 - We are only interested to the pagehide event from the root document. r=smaug
authorKan-Ru Chen (陳侃如) <kanru@kanru.info>
Thu, 07 Mar 2013 08:35:38 -0500
changeset 124106 fc9cdf372502878c8da412c6d50c2a0f0f80c13b
parent 124105 cf6e59da524ae4777fa6d46bcf65a411496bc9b5
child 124107 99ef1303095d41f4bb647fcb0e318cef22d42d3b
push id24406
push userryanvm@gmail.com
push dateThu, 07 Mar 2013 17:19:02 +0000
treeherdermozilla-central@71395a927025 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs838547
milestone22.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 838547 - We are only interested to the pagehide event from the root document. r=smaug
b2g/chrome/content/forms.js
--- a/b2g/chrome/content/forms.js
+++ b/b2g/chrome/content/forms.js
@@ -259,19 +259,24 @@ let FormAssistant = {
           this.showKeyboard(this.getTopLevelEditable(target));
           break;
         }
 
         if (this.isFocusableElement(target))
           this.showKeyboard(target);
         break;
 
+      case "pagehide":
+        // We are only interested to the pagehide event from the root document.
+        if (target && target != content.document) {
+          break;
+        }
+        // fall through
       case "blur":
       case "submit":
-      case "pagehide":
         if (this.focusedElement)
           this.hideKeyboard();
         break;
 
       case 'mousedown':
         // We only listen for this event on the currently focused element.
         // When the mouse goes down, note the cursor/selection position
         range = getSelectionRange(this.focusedElement);