diff --git a/xpfe/appshell/public/nsIAppShellService.idl b/xpfe/appshell/public/nsIAppShellService.idl index 7a2fa8c67495..206713df0e44 100644 --- a/xpfe/appshell/public/nsIAppShellService.idl +++ b/xpfe/appshell/public/nsIAppShellService.idl @@ -17,7 +17,7 @@ interface nsIAppShell; #include "js/TypeDecls.h" %} -[scriptable, uuid(5c19ab54-67bf-46d0-ac5b-21abd9050c3b)] +[scriptable, uuid(3927a495-575a-4a12-b9ab-6b948f76ec1f)] interface nsIAppShellService : nsISupports { /** @@ -44,7 +44,13 @@ interface nsIAppShellService : nsISupports in long aInitialWidth, in long aInitialHeight); - nsIWebNavigation createWindowlessBrowser(); + /** + * This is the constructor for creating an invisible DocShell. + * It is used to simulate DOM windows without an actual physical + * representation. + * @param aIsChrome Set true if you want to use it for chrome content. + */ + nsIWebNavigation createWindowlessBrowser([optional] in bool aIsChrome); [noscript] void createHiddenWindow(); diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index baf00b4387cc..304b749d011f 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -348,7 +348,7 @@ NS_IMPL_RELEASE(WindowlessBrowserStub) NS_IMETHODIMP -nsAppShellService::CreateWindowlessBrowser(nsIWebNavigation **aResult) +nsAppShellService::CreateWindowlessBrowser(bool aIsChrome, nsIWebNavigation **aResult) { /* First, we create an instance of nsWebBrowser. Instances of this class have * an associated doc shell, which is what we're interested in. @@ -374,7 +374,8 @@ nsAppShellService::CreateWindowlessBrowser(nsIWebNavigation **aResult) nsCOMPtr navigation = do_QueryInterface(browser); nsCOMPtr item = do_QueryInterface(navigation); - item->SetItemType(nsIDocShellTreeItem::typeContentWrapper); + item->SetItemType(aIsChrome ? nsIDocShellTreeItem::typeChromeWrapper + : nsIDocShellTreeItem::typeContentWrapper); /* A windowless web browser doesn't have an associated OS level window. To * accomplish this, we initialize the window associated with our instance of