diff options
author | Kris Maglione <maglione.k@gmail.com> | 2013-04-27 20:55:05 -0700 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2013-04-27 20:55:05 -0700 |
commit | 2879caf75edd7ada3812718ebd7147ee8b35b26a (patch) | |
tree | 75d96fe9ae8179157ed453e152d48030aefbbd41 /common/modules | |
parent | b71d56e4feb04c2c2ebb51b44c22ef5306cdbf6e (diff) | |
download | pentadactyl-2879caf75edd7ada3812718ebd7147ee8b35b26a.tar.gz |
Fix bug.
Diffstat (limited to 'common/modules')
-rw-r--r-- | common/modules/buffer.jsm | 5 | ||||
-rw-r--r-- | common/modules/cache.jsm | 5 | ||||
-rw-r--r-- | common/modules/dom.jsm | 11 |
3 files changed, 16 insertions, 5 deletions
diff --git a/common/modules/buffer.jsm b/common/modules/buffer.jsm index 51ae728d..964c3c81 100644 --- a/common/modules/buffer.jsm +++ b/common/modules/buffer.jsm @@ -1,6 +1,6 @@ // Copyright (c) 2006-2008 by Martin Stubenschrott <stubenschrott@vimperator.org> // Copyright (c) 2007-2011 by Doug Kearns <dougkearns@gmail.com> -// Copyright (c) 2008-2012 Kris Maglione <maglione.k at Gmail> +// Copyright (c) 2008-2013 Kris Maglione <maglione.k at Gmail> // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. @@ -632,7 +632,8 @@ var Buffer = Module("Buffer", { util.reportError(e); } - let link = DOM("link[href]:-moz-any([rev=canonical], [rel=shortlink])", doc); + let link = DOM("link[href][rev=canonical], \ + link[href][rel=shortlink]", doc); if (link) return link.attr("href"); diff --git a/common/modules/cache.jsm b/common/modules/cache.jsm index 4fe8d8bb..5f39bc6a 100644 --- a/common/modules/cache.jsm +++ b/common/modules/cache.jsm @@ -234,11 +234,14 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), { if (this.queue.length && !this.inQueue) { // removeEntry does not work properly with queues. + let removed = 0; for each (let [, entry] in this.queue) if (this.getCacheWriter().hasEntry(entry)) { this.getCacheWriter().removeEntry(entry, false); - this.closeWriter(); + removed++; } + if (removed) + this.closeWriter(); this.queue.splice(0).forEach(function ([time, entry]) { if (time && Set.has(this.cache, entry)) { diff --git a/common/modules/dom.jsm b/common/modules/dom.jsm index 1167feba..7a0c5556 100644 --- a/common/modules/dom.jsm +++ b/common/modules/dom.jsm @@ -499,8 +499,15 @@ var DOM = Class("DOM", { if (DOM(elem).isInput || /^(?:hidden|textarea)$/.test(elem.type) || elem.type == "submit" && elem == field - || elem.checked && /^(?:checkbox|radio)$/.test(elem.type)) - elems.push(encode(elem.name, elem.value, elem === field)); + || elem.checked && /^(?:checkbox|radio)$/.test(elem.type)) { + + if (elem !== field) + elems.push(encode(elem.name, elem.value)); + else if (overlay.getData(elem, "had-focus")) + elems.push(encode(elem.name, elem.value, true)); + else + elems.push(encode(elem.name, "", true)); + } else if (elem instanceof Ci.nsIDOMHTMLSelectElement) { for (let [, opt] in Iterator(elem.options)) if (opt.selected) |