diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index b822f7b7..95ecdba9 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -366,7 +366,6 @@ const Bookmarks = Module("bookmarks", { // ripped from Firefox function getShortcutOrURI(url) { - var shortcutURL = null; var keyword = url; var param = ""; var offset = url.indexOf(" "); @@ -381,7 +380,7 @@ const Bookmarks = Module("bookmarks", { return [submission.uri.spec, submission.postData]; } - [shortcutURL, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword); + let [shortcutURL, postData] = PlacesUtils.getURLAndPostDataForKeyword(keyword); if (!shortcutURL) return [url, null]; diff --git a/common/content/buffer.js b/common/content/buffer.js index a2424496..904d415f 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -19,9 +19,10 @@ const Point = Struct("x", "y"); * @instance buffer */ const Buffer = Module("buffer", { - requires: ["config"], + requires: ["config", "util"], init: function () { + this.evaluateXPath = util.evaluateXPath; this.pageInfo = {}; this.addPageInfoSection("f", "Feeds", function (verbose) { @@ -1470,16 +1471,19 @@ const Buffer = Module("buffer", { if (count < 1 && buffer.lastInputField) buffer.focusElement(buffer.lastInputField); else { - let xpath = ["input[not(@type) or @type='text' or @type='password' or @type='file']", - "textarea[not(@disabled) and not(@readonly)]"]; + let xpath = ["input", "textarea[not(@disabled) and not(@readonly)]"]; - let elements = [m for (m in util.evaluateXPath(xpath))].filter(function (match) { - let computedStyle = util.computedStyle(match); + let elements = [m for (m in util.evaluateXPath(xpath))].filter(function (elem) { + if (elem.readOnly || elem instanceof HTMLInputElement && ["text", "password", "file"].indexOf(elem.type) < 0) + return false; + let computedStyle = util.computedStyle(elem); return computedStyle.visibility != "hidden" && computedStyle.display != "none"; }); liberator.assert(elements.length > 0); - buffer.focusElement(elements[util.Math.constrain(count, 1, elements.length) - 1]); + let elem = elements[util.Math.constrain(count, 1, elements.length) - 1]; + elem.scrollIntoView(); + buffer.focusElement(elem); } }, { count: true }); @@ -1599,7 +1603,7 @@ const Buffer = Module("buffer", { "Desired info in the :pageinfo output", "charlist", "gfm", { - completer: function (context) [[k, v[1]] for ([k, v] in Iterator(this.pageInfo))] + completer: function (context) [[k, v[1]] for ([k, v] in Iterator(buffer.pageInfo))] }); options.add(["scroll", "scr"], diff --git a/common/content/commandline.js b/common/content/commandline.js index b4d027bc..3d358b7c 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1109,7 +1109,7 @@ const CommandLine = Module("commandline", { */ Completions: Class("Completions", { init: function (input) { - this.context = CompletionContext(input.editor); + this.context = CompletionContext(input.QueryInterface(Ci.nsIDOMNSEditableElement).editor); this.context.onUpdate = this.closure._reset; this.editor = input.editor; this.selected = null; diff --git a/common/skin/liberator.css b/common/skin/liberator.css index 146619a1..ff67a8f5 100644 --- a/common/skin/liberator.css +++ b/common/skin/liberator.css @@ -1,4 +1,5 @@ @namespace liberator url("http://vimperator.org/namespaces/liberator"); +@namespace html url("http://www.w3.org/1999/xhtml"); /* Applied to all content */ [liberator|activeframe] { @@ -122,6 +123,9 @@ statusbarpanel { color: inherit; margin: 0px; } +#liberator-commandline-command html|*:focus { + outline-width: 0px !important +} #liberator-message { margin: 0px; }