From 8cb536206d106b30230c1d9f3f862985498e4662 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Tue, 12 Feb 2013 16:31:08 -0800 Subject: [PATCH] Bug 839473 - Return early in form.js for non editable content r=fabrice --- b2g/chrome/content/forms.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/b2g/chrome/content/forms.js b/b2g/chrome/content/forms.js index 5a35fe680285..20a64878d576 100644 --- a/b2g/chrome/content/forms.js +++ b/b2g/chrome/content/forms.js @@ -237,12 +237,20 @@ let FormAssistant = { switch (evt.type) { case "focus": - if (target && isContentEditable(target)) { + if (!target) { + break; + } + + if (target instanceof HTMLDocument || target == content) { + break; + } + + if (isContentEditable(target)) { this.showKeyboard(this.getTopLevelEditable(target)); break; } - if (target && this.isFocusableElement(target)) + if (this.isFocusableElement(target)) this.showKeyboard(target); break;