DocShell/Window targeting: Difference between revisions

Jump to navigation Jump to search
no edit summary
m (fixing typo)
No edit summary
Line 11: Line 11:
# If no docshell with the given name was found, we examine the <code>"browser.link.open_newwindow"</code> pref to decide what to do.  As a result, we either redo the search using <code>"_top"</code> as the name, try top open a new tab using <code>nsIBrowserDOMWindow</code>, or open a new window using the window watcher.  This code is duplicated in docshell and in <code>nsGlobalWindow</code>.  In all cases, we end up returning a docshell (an existing one, or one from the new window or tab) to the caller.
# If no docshell with the given name was found, we examine the <code>"browser.link.open_newwindow"</code> pref to decide what to do.  As a result, we either redo the search using <code>"_top"</code> as the name, try top open a new tab using <code>nsIBrowserDOMWindow</code>, or open a new window using the window watcher.  This code is duplicated in docshell and in <code>nsGlobalWindow</code>.  In all cases, we end up returning a docshell (an existing one, or one from the new window or tab) to the caller.
# Once we have a target docshell, we proceed to do the load in it by calling either <code>LoadURI</code> (in the window watcher, for the <code>window.open</code> case) or <code>InternalLoad</code> (in docshell, for the targeted link case).
# Once we have a target docshell, we proceed to do the load in it by calling either <code>LoadURI</code> (in the window watcher, for the <code>window.open</code> case) or <code>InternalLoad</code> (in docshell, for the targeted link case).
== Proposed Changes ==
I want to change step 8 to do the following instead:  If no docshell with the given name is found, get a "window provider" or something service and ask it for a new rendering area (nsIDOMWindow, probably, or nsIWebNavigation).  Pass in the initial target docshell (or its DOMWindow?) to this service, so that it can create new tabs, eg, in the right places (in the same window).  The service implementation would live in the embedding app (in toolkit or xpfe in Firefox/Seamonkey, for example) and would be free to return whatever window/webnavigation it wants.  If it returns nothing, we'd fall back to opening a new window via the window watcher as we do now.
We need to do something to fix steps 5 and 7.
308

edits

Navigation menu