});
this._fullscreen = window.fullScreen;
- this._lastFocus = null;
+ this._lastFocus = { get: function () null };
this._macroKeys = [];
this._lastMacro = "";
this.active.push(elem);
}
- this.active = this.active.filter(function (e) e.popupBoxObject.popupState != "closed");
+ this.active = this.active.filter(function (e) e.popupBoxObject && e.popupBoxObject.popupState != "closed");
if (!this.active.length && !this.activeMenubar)
modes.remove(modes.MENU, true);
if (quiet)
commandline.quiet = quiet;
- keys = mappings.expandLeader(keys);
-
for (let [, evt_obj] in Iterator(DOM.Event.parse(keys))) {
let now = Date.now();
let key = DOM.Event.stringify(evt_obj);
}
if (elem instanceof Element)
- elem.dactylFocusAllowed = undefined;
+ delete overlay.getData(elem)["focus-allowed"];
},
/*
!this.processor && event.type === "keydown"
&& options.get("passunknown").getKey(modes.main.allBases)
&& let (key = DOM.Event.stringify(event))
- !modes.main.allBases.some(
+ !(modes.main.count && /^\d$/.test(key) ||
+ modes.main.allBases.some(
function (mode) mappings.hives.some(
- function (hive) hive.get(mode, key) || hive.getCandidates(mode, key)));
+ function (hive) hive.get(mode, key) || hive.getCandidates(mode, key))));
events.dbg("ON " + event.type.toUpperCase() + " " + DOM.Event.stringify(event) +
" passing: " + this.passing + " " +
}
let urlbar = document.getElementById("urlbar");
- if (elem == null && urlbar && urlbar.inputField == this._lastFocus)
+ if (elem == null && urlbar && urlbar.inputField == this._lastFocus.get())
util.threadYield(true); // Why? --Kris
while (modes.main.ownsFocus
- && modes.topOfStack.params.ownsFocus != elem
- && modes.topOfStack.params.ownsFocus != win
+ && let ({ ownsFocus } = modes.topOfStack.params)
+ (!ownsFocus ||
+ ownsFocus.get() != elem &&
+ ownsFocus.get() != win)
&& !modes.topOfStack.params.holdFocus)
modes.pop(null, { fromFocus: true });
}
finally {
- this._lastFocus = elem;
+ this._lastFocus = util.weakReference(elem);
if (modes.main.ownsFocus)
- modes.topOfStack.params.ownsFocus = elem;
+ modes.topOfStack.params.ownsFocus = util.weakReference(elem);
}
}),