From 394572173f690e1afa6eab235496018789836f18 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Wed, 7 Sep 2016 07:51:14 +0200 Subject: [PATCH] Fix alphabetic sorting of functions in utils.coffee --- extension/lib/utils.coffee | 102 ++++++++++++++++++------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/extension/lib/utils.coffee b/extension/lib/utils.coffee index 251c4d8..f70d3c9 100644 --- a/extension/lib/utils.coffee +++ b/extension/lib/utils.coffee @@ -169,38 +169,6 @@ isTypingElement = (element) -> # Active/focused element helpers -# NOTE: In frame scripts, `document.activeElement` may be `null` when the page -# is loading. Therefore always check if anything was returned, such as: -# -# return unless activeElement = utils.getActiveElement(window) -getActiveElement = (window) -> - {activeElement} = window.document - return null unless activeElement - # If the active element is a frame, recurse into it. The easiest way to detect - # a frame that works both in browser UI and in web page content is to check - # for the presence of `.contentWindow`. However, in non-multi-process, - # `` (sometimes ``) elements have a `.contentWindow` - # pointing to the web page content `window`, which we don’t want to recurse - # into. The problem is that there are _some_ ``s which we _want_ to - # recurse into, such as the sidebar (for instance the history sidebar), and - # dialogs in `about:preferences`. Checking the `contextmenu` attribute seems - # to be a reliable test, catching both the main tab ``s and bookmarks - # opened in the sidebar. - if (activeElement.localName == 'browser' and - activeElement.getAttribute?('contextmenu') == 'contentAreaContextMenu') or - not activeElement.contentWindow - return activeElement - else - return getActiveElement(activeElement.contentWindow) - -blurActiveElement = (window) -> - # Blurring a frame element also blurs any active elements inside it. Recursing - # into the frames and blurring the “real” active element directly would give - # focus to the `` of its containing frame, while blurring the top-most - # frame gives focus to the top-most ``. This allows to blur fancy text - # editors which use an `