aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-04-05 06:50:06 +0100
committerStephen Blott2016-04-05 06:50:38 +0100
commit84bea357c879090a833b096c00be5c4318d48c4f (patch)
tree44e8431a9aa136e3816a13365db2c074b0c07e40
parent24b3301e047cf84f02df41766cfe9710c14d9d95 (diff)
downloadvimium-84bea357c879090a833b096c00be5c4318d48c4f.tar.bz2
Check for document.activeElement.
When DomUtils.isFocusable() is called from GrabBackFocus-pushState-monitor it is possible that document.activeElement is not ready. So we should check. Here, we check in DomUtils.isFocusable(), because we always need element to be defined for this test, not just in GrabBackFocus-pushState-monitor.
-rw-r--r--lib/dom_utils.coffee2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index 9a6c1b09..a57cbedb 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -192,7 +192,7 @@ DomUtils =
element.nodeName?.toLowerCase() in ["embed", "object"]
isFocusable: (element) ->
- @isEditable(element) or @isEmbed element
+ element and (@isEditable(element) or @isEmbed element)
isDOMDescendant: (parent, child) ->
node = child