From 9ae4b6c10d53153929d905f28bc7de57c0ba6dfe Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 4 Jan 2015 09:29:36 +0000 Subject: Modes; various improvements. - Add StateMode. - PasskeysMode is a StateMode. - BadgeUpdateMode is a StateMode. - Improve badge handling. - Add push method to Mode. - Document how modes work. - Cache badge on background page to reduce the number of updates. - Remove badge restriction on document.body?.tagName.toLowerCase() == "frameset". - Add ExitOnEscape mode, use it for ConstrainedMode and FindMode. - Move PostFindMode to its own file. --- lib/dom_utils.coffee | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee index ba5e279f..ec846e44 100644 --- a/lib/dom_utils.coffee +++ b/lib/dom_utils.coffee @@ -141,6 +141,13 @@ DomUtils = (element.nodeName.toLowerCase() == "input" && unselectableTypes.indexOf(element.type) == -1) || element.nodeName.toLowerCase() == "textarea" + isDOMDescendant: (parent, child) -> + node = child + while (node != null) + return true if (node == parent) + node = node.parentNode + false + simulateSelect: (element) -> element.focus() # When focusing a textbox, put the selection caret at the end of the textbox's contents. -- cgit v1.2.3