[Conkeror] [PATCH] Make window.js aware of which windows are uninitialized. Use this to make
David House
dmhouse at gmail.com
Sat Sep 6 04:50:26 PDT 2008
2008/9/6 Jeremy Maitin-Shepard <jeremy at jeremyms.com>:
> It would help if you made this patch against the Conkeror upstream
> master, rather than against your previous patch.
> ...
> It seems like this stuff doesn't really belong in this patch.
I've split the commit into two commits, one that puts all the
infrastructure in place and makes create_buffer smart, and a second
which changes `multiple_buffers_creator' (introduced with my session
management patch) to use this infrastructure. Attached are the outputs
for git format-patch for those two.
I couldn't quite find a way to create a patch which would contain
these changes, without conflicting with my session management. I got
fairly close, though, it should be that the only bit of the diff that
won't apply against conkeror currently (i.e., before the session
management patch) is the bit that changes `make_chrome_window'. (It
should work if you apply the session management patch first.) For
reference, this is what that function should look:
function make_chrome_window(chrome_url, args, tag) {
// We append a query guaranteed to be unique to the chrome URL in order to
// work around a bug in XULRunner. See http://conkeror.org/UpstreamBugs
url_with_query = chrome_url + "?t=" + tag;
chrome_uniquify_index++;
return window_watcher.openWindow(null, url_with_query, "_blank",
"chrome,dialog=no,all,resizable", args);
}
> The reason that the tag was set in window_initialize rather than here is
> that in some cases (one example is for when target=_blank is used or
> content JavaScript calls window.open and we decide to create a new
> window) Mozilla creates the window for us, rather than make_window being
> called. So you should also set the tag in window_initialize if it has
> not already been set.
Done.
> It doesn't matter too much, but note that using the filter function adds
> a bit of overhead since you have a bunch of function calls and construct
> an array, whereas if you just use:
>
> for (let x = 0; x < uninitialized_windows.length; ++x) {
> if (x.tag == tag)
> return x;
> }
>
> it will be slightly more efficient.
I thought I'd done this, but I must have forgotten to stage. Done.
> I suppose all of the typeof checking is to quiet warnings about
> accessing undefined variables?
That was the intention, e.g.:
(function (s) repl.print(typeof s))() --> "undefined"
But I did some experiments and it turns out they're not necessary, so
they're gone.
> I think this should instead be done just after running the
> window_initialize_late_hook.
Done.
--
-David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Make-window.js-aware-of-uninitialized-windows-enabl.patch
Type: text/x-diff
Size: 8392 bytes
Desc: not available
URL: <http://www.mozdev.org/pipermail/conkeror/attachments/20080906/039627d8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Refactor-multiple_buffers_creator-to-take-advantag.patch
Type: text/x-diff
Size: 2221 bytes
Desc: not available
URL: <http://www.mozdev.org/pipermail/conkeror/attachments/20080906/039627d8/attachment-0001.bin>
More information about the Conkeror
mailing list