From 01582c69aa8376ff9536e89bcb86e5ff68d6e3f9 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Sat, 7 Aug 1999 02:51:03 +0000 Subject: [PATCH] corrected chrome behaviour in window.open. removed warnings in nsWebShellWindow. git-svn-id: svn://10.0.0.236/trunk@42622 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/dom/src/base/nsGlobalWindow.cpp | 93 ++++++++---- mozilla/dom/src/base/nsGlobalWindow.h | 8 +- mozilla/suite/browser/navigator.js | 6 +- mozilla/suite/common/bookmarks/bookmarks.js | 2 +- mozilla/webshell/public/nsIBrowserWindow.h | 23 +-- mozilla/widget/src/windows/nsWindow.cpp | 5 +- .../xpfe/appshell/src/nsAppShellService.cpp | 8 +- .../xpfe/appshell/src/nsWebShellWindow.cpp | 28 +++- .../browser/resources/content/navigator.js | 6 +- .../xpfe/browser/samples/dexopenchrome.xul | 137 +++++++++++++++--- .../xpfe/browser/samples/dexparammaster.xul | 4 +- .../bookmarks/resources/bookmarks.js | 2 +- .../bookmarks/resources/bookmarks.xul | 2 +- .../global/resources/content/tasksOverlay.js | 6 +- 14 files changed, 239 insertions(+), 91 deletions(-) diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 63e3566c439..dbf0440552d 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1971,7 +1971,7 @@ nsresult GlobalWindowImpl::OpenInternal(JSContext *cx, jsval *argv, PRUint32 argc, - PRBool aAttachArguments, + PRBool aDialog, nsIDOMWindow** aReturn) { PRUint32 chromeFlags; @@ -2037,7 +2037,7 @@ GlobalWindowImpl::OpenInternal(JSContext *cx, } options = JS_GetStringBytes(str); } - chromeFlags = CalculateChromeFlags(options); + chromeFlags = CalculateChromeFlags(options, aDialog); nsIWebShell *newOuterShell = nsnull; nsIWebShellContainer *webShellContainer; @@ -2061,11 +2061,11 @@ GlobalWindowImpl::OpenInternal(JSContext *cx, if (nsnull != newOuterShell) { if (NS_SUCCEEDED(ReadyOpenedWebShell(newOuterShell, aReturn))) { - if (aAttachArguments && argc > 3) + if (aDialog && argc > 3) AttachArguments(*aReturn, argv+3, argc-3); newOuterShell->SetName(name.GetUnicode()); newOuterShell->LoadURL(mAbsURL.GetUnicode()); - SizeAndShowOpenedWebShell(newOuterShell, options, windowIsNew); + SizeAndShowOpenedWebShell(newOuterShell, options, windowIsNew, aDialog); } NS_RELEASE(newOuterShell); } @@ -2114,19 +2114,40 @@ GlobalWindowImpl::AttachArguments(nsIDOMWindow *aWindow, jsval *argv, PRUint32 a } +/** + * Calculate the chrome bitmask from a string list of features. + * @param aFeatures a string containing a list of named chrome features + * @param aDialog affects the assumptions made about unnamed features + * @return the chrome bitmask + */ PRUint32 -GlobalWindowImpl::CalculateChromeFlags(char *aFeatures) { +GlobalWindowImpl::CalculateChromeFlags(char *aFeatures, PRBool aDialog) { PRUint32 chromeFlags; if (nsnull == aFeatures) - return NS_CHROME_ALL_CHROME; + if (aDialog) + return NS_CHROME_ALL_CHROME | + NS_CHROME_OPEN_AS_DIALOG | NS_CHROME_OPEN_AS_CHROME; + else + return NS_CHROME_ALL_CHROME; PRBool presenceFlag = PR_FALSE; - chromeFlags = NS_CHROME_WINDOW_BORDERS_ON; + /* This function has become complicated since browser windows and + dialogs diverged. The difference is, browser windows assume all + chrome not explicitly mentioned is off, if the features string + is not null. Exceptions are some OS border chrome new with Mozilla. + Dialogs interpret a (mostly) empty features string to mean + "OS's choice," and also support an "all" flag explicitly disallowed + in the standards-compliant window.(normal)open. */ + + chromeFlags = NS_CHROME_WINDOW_BORDERS_ON; + if (aDialog && WinHasOption(aFeatures, "all", presenceFlag)) + chromeFlags = NS_CHROME_ALL_CHROME; + + /* Next, allow explicitly named options to override the initial settings */ - // ((only) titlebars default to "on" if not mentioned) chromeFlags |= WinHasOption(aFeatures, "titlebar", presenceFlag) ? NS_CHROME_TITLEBAR_ON : 0; chromeFlags |= WinHasOption(aFeatures, "close", presenceFlag) ? NS_CHROME_WINDOW_CLOSE_ON : 0; chromeFlags |= WinHasOption(aFeatures, "toolbar", presenceFlag) ? NS_CHROME_TOOL_BAR_ON : 0; @@ -2137,34 +2158,48 @@ GlobalWindowImpl::CalculateChromeFlags(char *aFeatures) { chromeFlags |= WinHasOption(aFeatures, "menubar", presenceFlag) ? NS_CHROME_MENU_BAR_ON : 0; chromeFlags |= WinHasOption(aFeatures, "scrollbars", presenceFlag) ? NS_CHROME_SCROLLBARS_ON : 0; chromeFlags |= WinHasOption(aFeatures, "resizable", presenceFlag) ? NS_CHROME_WINDOW_RESIZE_ON : 0; - // default to "on" if titlebar, closebox, or resizable aren't mentioned + + /* OK. + Normal browser windows, in spite of a stated pattern of turning off + all chrome not mentioned explicitly, will want the new OS chrome (window + borders, titlebars, closebox) on, unless explicitly turned off. + Dialogs, on the other hand, take the absence of any explicit settings + to mean "OS' choice." */ + + // default titlebar and closebox to "on," if not mentioned at all if (!PL_strcasestr(aFeatures, "titlebar")) chromeFlags |= NS_CHROME_TITLEBAR_ON; if (!PL_strcasestr(aFeatures, "close")) chromeFlags |= NS_CHROME_WINDOW_CLOSE_ON; - if (!PL_strcasestr(aFeatures, "resizable")) - chromeFlags |= NS_CHROME_WINDOW_RESIZE_ON; - // From this point onward, if the above features weren't specified at all, - // we will assume that all chrome is present. + if (aDialog && !presenceFlag) + chromeFlags = NS_CHROME_DEFAULT_CHROME; - //XXX This is incorrect. Except for the last three, if the - // feature wasn't mentioned its not there -joki - //if (!presenceFlag) - // chromeFlags |= NS_CHROME_ALL_CHROME; + /* Finally, once all the above normal chrome has been divined, deal + with the features that are more operating hints than appearance + instructions. */ chromeFlags |= WinHasOption(aFeatures, "chrome", presenceFlag) ? NS_CHROME_OPEN_AS_CHROME : 0; chromeFlags |= WinHasOption(aFeatures, "modal", presenceFlag) ? NS_CHROME_MODAL : 0; chromeFlags |= WinHasOption(aFeatures, "dialog", presenceFlag) ? NS_CHROME_OPEN_AS_DIALOG : 0; + /* and dialogs need to have the last word. assume dialogs are dialogs, + and opened as chrome, unless explicitly told otherwise. */ + if (aDialog) { + if (!PL_strcasestr(aFeatures, "dialog")) + chromeFlags |= NS_CHROME_OPEN_AS_DIALOG; + if (!PL_strcasestr(aFeatures, "chrome")) + chromeFlags |= NS_CHROME_OPEN_AS_CHROME; + } + /*z-ordering, history, dependent chromeFlags->topmost = WinHasOption(aFeatures, "alwaysRaised"); - chromeFlags->bottommost = WinHasOption(aFeatures, "alwaysLowered"); + chromeFlags->bottommost = WinHasOption(aFeatures, "alwaysLowered"); chromeFlags->z_lock = WinHasOption(aFeatures, "z-lock"); - chromeFlags->is_modal = WinHasOption(aFeatures, "modal"); + chromeFlags->is_modal = WinHasOption(aFeatures, "modal"); chromeFlags->hide_title_bar = !(WinHasOption(aFeatures, "titlebar")); - chromeFlags->dependent = WinHasOption(aFeatures, "dependent"); - chromeFlags->copy_history = FALSE; + chromeFlags->dependent = WinHasOption(aFeatures, "dependent"); + chromeFlags->copy_history = FALSE; */ /* Allow disabling of commands only if there is no menubar */ @@ -2184,8 +2219,8 @@ GlobalWindowImpl::CalculateChromeFlags(char *aFeatures) { // set the newly opened webshell's (window) size, and show it nsresult -GlobalWindowImpl::SizeAndShowOpenedWebShell(nsIWebShell *aOuterShell, char *aFeatures, - PRBool aNewWindow) +GlobalWindowImpl::SizeAndShowOpenedWebShell(nsIWebShell *aOuterShell, + char *aFeatures, PRBool aNewWindow, PRBool aDialog) { if (nsnull == aOuterShell) return NS_ERROR_NULL_POINTER; @@ -2220,8 +2255,8 @@ GlobalWindowImpl::SizeAndShowOpenedWebShell(nsIWebShell *aOuterShell, char *aFea nsRect contentOffsets; // constructor sets all values to 0 PRBool sizeSpecified = PR_FALSE; - PRUint32 chromeFlags = CalculateChromeFlags(aFeatures); - PRBool openAsContent = ((chromeFlags & NS_CHROME_OPEN_AS_CHROME) == 0); + PRUint32 chromeFlags = CalculateChromeFlags(aFeatures, aDialog); + PRBool openAsContent = (chromeFlags & NS_CHROME_OPEN_AS_CHROME) == 0; // if it's an extant window, we are already our default size if (!aNewWindow) @@ -2237,7 +2272,7 @@ GlobalWindowImpl::SizeAndShowOpenedWebShell(nsIWebShell *aOuterShell, char *aFea openedWindow->GetWindowBounds(defaultBounds); if (nsnull != aFeatures) { - PRBool presenceFlag = PR_FALSE; // Unused. Yuck. + PRBool presenceFlag = PR_FALSE; // Unused. Yuck. if (openAsContent) { width = WinHasOption(aFeatures, "innerWidth", presenceFlag) | WinHasOption(aFeatures, "width", presenceFlag); height = WinHasOption(aFeatures, "innerHeight", presenceFlag) | WinHasOption(aFeatures, "height", presenceFlag); @@ -2369,11 +2404,11 @@ GlobalWindowImpl::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont nsresult GlobalWindowImpl::CheckWindowName(JSContext *cx, nsString& aName) { - PRInt32 index; + PRInt32 strIndex; PRUnichar mChar; - for (index = 0; index < aName.Length(); index++) { - mChar = aName.CharAt(index); + for (strIndex = 0; strIndex < aName.Length(); strIndex++) { + mChar = aName.CharAt(strIndex); if (!nsString::IsAlpha(mChar) && !nsString::IsDigit(mChar) && mChar != '_') { char* cp = aName.ToNewCString(); JS_ReportError(cx, diff --git a/mozilla/dom/src/base/nsGlobalWindow.h b/mozilla/dom/src/base/nsGlobalWindow.h index 8b9073dfe6d..956a601632b 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.h +++ b/mozilla/dom/src/base/nsGlobalWindow.h @@ -229,11 +229,11 @@ protected: PRBool CheckForEventListener(JSContext *aContext, nsString& aPropName); nsresult OpenInternal(JSContext *cx, jsval *argv, PRUint32 argc, - PRBool aAttachArguments, nsIDOMWindow** aReturn); + PRBool aDialog, nsIDOMWindow** aReturn); nsresult AttachArguments(nsIDOMWindow *aWindow, jsval *argv, PRUint32 argc); - PRUint32 CalculateChromeFlags(char *aFeatures); - nsresult SizeAndShowOpenedWebShell(nsIWebShell *aOuterShell, char *aFeatures, - PRBool aNewWindow); + PRUint32 CalculateChromeFlags(char *aFeatures, PRBool aDialog); + nsresult SizeAndShowOpenedWebShell(nsIWebShell *aOuterShell, + char *aFeatures, PRBool aNewWindow, PRBool aDialog); nsresult ReadyOpenedWebShell(nsIWebShell *aWebShell, nsIDOMWindow **aDOMWindow); static nsresult WebShellToDOMWindow(nsIWebShell *aWebShell, nsIDOMWindow **aDOMWindow); diff --git a/mozilla/suite/browser/navigator.js b/mozilla/suite/browser/navigator.js index 74eb38cd089..ec01f3b8662 100644 --- a/mozilla/suite/browser/navigator.js +++ b/mozilla/suite/browser/navigator.js @@ -596,7 +596,7 @@ function OpenSearch(tabName) function BrowserEditBookmarks() { - window.open("resource:/res/samples/bookmarks.xul", "BookmarksWindow", "chrome"); + window.open("resource:/res/samples/bookmarks.xul", "BookmarksWindow", "chrome,menubar,resizable,scrollbars"); } function BrowserPrintPreview() @@ -779,12 +779,12 @@ function OpenSearch(tabName) function OpenMessenger() { - window.open("chrome://messenger/content/", "_new", "chrome"); + window.open("chrome://messenger/content/", "_new", "chrome,menubar,toolbar,resizable"); } function OpenAddressbook() { - window.open("chrome://addressbook/content/", "_new", "chrome"); + window.open("chrome://addressbook/content/", "_new", "chrome,menubar,toolbar,resizable"); } function MsgNewMessage() diff --git a/mozilla/suite/common/bookmarks/bookmarks.js b/mozilla/suite/common/bookmarks/bookmarks.js index 57fb323b657..1dca5eebb1a 100644 --- a/mozilla/suite/common/bookmarks/bookmarks.js +++ b/mozilla/suite/common/bookmarks/bookmarks.js @@ -32,7 +32,7 @@ function BookmarkProperties() if (type != "http://home.netscape.com/NC-rdf#BookmarkSeparator") { var props = window.open("chrome://bookmarks/content/bm-props.xul", - "BookmarkProperties", "chrome"); + "BookmarkProperties", "chrome,menubar,resizable"); props.BookmarkURL = select_list[0].getAttribute("id"); } } else { diff --git a/mozilla/webshell/public/nsIBrowserWindow.h b/mozilla/webshell/public/nsIBrowserWindow.h index ff67eb41194..2adae3b4498 100644 --- a/mozilla/webshell/public/nsIBrowserWindow.h +++ b/mozilla/webshell/public/nsIBrowserWindow.h @@ -36,20 +36,21 @@ struct nsRect; { 0xa6cf905d, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}} // Chrome mask -#define NS_CHROME_WINDOW_BORDERS_ON 0x00000001 -#define NS_CHROME_WINDOW_CLOSE_ON 0x00000002 -#define NS_CHROME_WINDOW_RESIZE_ON 0x00000004 -#define NS_CHROME_MENU_BAR_ON 0x00000008 -#define NS_CHROME_TOOL_BAR_ON 0x00000010 -#define NS_CHROME_LOCATION_BAR_ON 0x00000020 -#define NS_CHROME_STATUS_BAR_ON 0x00000040 -#define NS_CHROME_PERSONAL_TOOLBAR_ON 0x00000080 -#define NS_CHROME_SCROLLBARS_ON 0x00000100 -#define NS_CHROME_TITLEBAR_ON 0x00000200 +#define NS_CHROME_DEFAULT_CHROME 0x00000001 +#define NS_CHROME_WINDOW_BORDERS_ON 0x00000002 +#define NS_CHROME_WINDOW_CLOSE_ON 0x00000004 +#define NS_CHROME_WINDOW_RESIZE_ON 0x00000008 +#define NS_CHROME_MENU_BAR_ON 0x00000010 +#define NS_CHROME_TOOL_BAR_ON 0x00000020 +#define NS_CHROME_LOCATION_BAR_ON 0x00000040 +#define NS_CHROME_STATUS_BAR_ON 0x00000080 +#define NS_CHROME_PERSONAL_TOOLBAR_ON 0x00000100 +#define NS_CHROME_SCROLLBARS_ON 0x00000200 +#define NS_CHROME_TITLEBAR_ON 0x00000400 #define NS_CHROME_MODAL 0x20000000 #define NS_CHROME_OPEN_AS_DIALOG 0x40000000 #define NS_CHROME_OPEN_AS_CHROME 0x80000000 -#define NS_CHROME_ALL_CHROME 0x000003FF +#define NS_CHROME_ALL_CHROME 0x000007FE /** * API to a "browser window". A browser window contains a toolbar, a web shell diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index fb96d76895e..940a5c2fe7b 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -673,7 +673,10 @@ nsresult nsWindow::StandardWindowCreate(nsIWidget *aParent, } } - if (aInitData->mBorderStyle != eBorderStyle_all) { + if (aInitData->mBorderStyle == eBorderStyle_default) { + if (mWindowType == eWindowType_dialog) + style &= ~(WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX); + } else if (aInitData->mBorderStyle != eBorderStyle_all) { if (aInitData->mBorderStyle == eBorderStyle_none || !(aInitData->mBorderStyle & eBorderStyle_border)) style &= ~WS_BORDER; diff --git a/mozilla/xpfe/appshell/src/nsAppShellService.cpp b/mozilla/xpfe/appshell/src/nsAppShellService.cpp index c399391d905..25e76987b41 100644 --- a/mozilla/xpfe/appshell/src/nsAppShellService.cpp +++ b/mozilla/xpfe/appshell/src/nsAppShellService.cpp @@ -559,14 +559,16 @@ nsAppShellService::JustCreateTopWindow(nsIWebShellWindow *aParent, if (!window) rv = NS_ERROR_OUT_OF_MEMORY; else { - // temporarily disabling parentage because non-Windows platforms - // seem to be interpreting it in unexpected ways. nsWidgetInitData widgetInitData; widgetInitData.mWindowType = aChromeMask & NS_CHROME_OPEN_AS_DIALOG ? eWindowType_dialog : eWindowType_toplevel; - if ((aChromeMask & NS_CHROME_ALL_CHROME) == NS_CHROME_ALL_CHROME) + // note default chrome overrides other OS chrome settings, but + // not internal chrome + if (aChromeMask & NS_CHROME_DEFAULT_CHROME) + widgetInitData.mBorderStyle = eBorderStyle_default; + else if ((aChromeMask & NS_CHROME_ALL_CHROME) == NS_CHROME_ALL_CHROME) widgetInitData.mBorderStyle = eBorderStyle_all; else { widgetInitData.mBorderStyle = eBorderStyle_none; // assumes none == 0x00 diff --git a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp index 3501a4227a4..493308f40f9 100644 --- a/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/mozilla/xpfe/appshell/src/nsWebShellWindow.cpp @@ -1270,8 +1270,7 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont DoContextMenu(nsnull, rootElement, mWindow, aXPos, aYPos, aPopupAlignment, anAnchorAlignment); // Fire the destroy DOM event to give JS/C++ a chance to destroy the popup contents - nsEventStatus status = nsEventStatus_eIgnore; - nsMouseEvent event; + status = nsEventStatus_eIgnore; event.eventStructType = NS_EVENT; event.message = NS_MENU_DESTROY; rv = popupContent->HandleDOMEvent(*presContext, &event, nsnull, NS_EVENT_FLAG_INIT, status); @@ -1285,9 +1284,6 @@ nsWebShellWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupCont // (1) Create a top-level chromeless window. The size of the window can be specified // on the window tag contained inside. Retrieve the webshell from the new nsWebShellWindow. - NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv); - if (NS_FAILED(rv)) - return rv; nsCOMPtr newWindow; @@ -2145,6 +2141,7 @@ void nsWebShellWindow::ShowAppropriateChrome() nsCOMPtr xulRoot; nsCOMPtr chromeDoc; nsCOMPtr domWindow; + PRUint32 chromeMask; // get this window's document if (NS_FAILED(ConvertWebShellToDOMWindow(mWebShell, getter_AddRefs(domWindow)))) @@ -2154,6 +2151,21 @@ void nsWebShellWindow::ShowAppropriateChrome() if (NS_FAILED(chromeDoc->GetDocumentElement(getter_AddRefs(rootElement))) || !rootElement) return; + // calculate a special version of the chrome mask. we store the actual + // value sent, but we make local changes depending on whether defaults + // were asked for. Note that only internal (not OS-) chrome matters + // at this point, so the OS chrome is not calculated. + chromeMask = mChromeMask; + if (chromeMask & NS_CHROME_DEFAULT_CHROME) + if (chromeMask & NS_CHROME_OPEN_AS_DIALOG) + chromeMask &= ~(NS_CHROME_MENU_BAR_ON | NS_CHROME_TOOL_BAR_ON | + NS_CHROME_LOCATION_BAR_ON | NS_CHROME_STATUS_BAR_ON | + NS_CHROME_PERSONAL_TOOLBAR_ON | NS_CHROME_SCROLLBARS_ON); + else + // theoretically, this won't happen (only dialogs can have defaults) + // but, we cover this case anyway + chromeMask |= NS_CHROME_ALL_CHROME; + // special treatment for the menubar ShowMenuBar(mChromeMask & NS_CHROME_MENU_BAR_ON ? PR_TRUE : PR_FALSE); @@ -2177,7 +2189,10 @@ void nsWebShellWindow::ShowAppropriateChrome() // show or hide the element according to its chromeclass and the chromemask domElement->GetAttribute("chromeclass", chromeClass); makeChange = PR_FALSE; - if (chromeClass == "toolbar") { + if (chromeClass == "menubar") { + makeChange = PR_TRUE; + flag = mChromeMask & NS_CHROME_MENU_BAR_ON; + } else if (chromeClass == "toolbar") { makeChange = PR_TRUE; flag = mChromeMask & NS_CHROME_TOOL_BAR_ON; } else if (chromeClass == "location") { @@ -2733,7 +2748,6 @@ nsWebShellWindow::HandleUrl(const PRUnichar * aCommand, PRInt32 offset2= url.Find("mailto:", PR_TRUE); - PRInt32 ret=0; if (offset2 == 0) { topic += "mailto"; diff --git a/mozilla/xpfe/browser/resources/content/navigator.js b/mozilla/xpfe/browser/resources/content/navigator.js index 74eb38cd089..ec01f3b8662 100644 --- a/mozilla/xpfe/browser/resources/content/navigator.js +++ b/mozilla/xpfe/browser/resources/content/navigator.js @@ -596,7 +596,7 @@ function OpenSearch(tabName) function BrowserEditBookmarks() { - window.open("resource:/res/samples/bookmarks.xul", "BookmarksWindow", "chrome"); + window.open("resource:/res/samples/bookmarks.xul", "BookmarksWindow", "chrome,menubar,resizable,scrollbars"); } function BrowserPrintPreview() @@ -779,12 +779,12 @@ function OpenSearch(tabName) function OpenMessenger() { - window.open("chrome://messenger/content/", "_new", "chrome"); + window.open("chrome://messenger/content/", "_new", "chrome,menubar,toolbar,resizable"); } function OpenAddressbook() { - window.open("chrome://addressbook/content/", "_new", "chrome"); + window.open("chrome://addressbook/content/", "_new", "chrome,menubar,toolbar,resizable"); } function MsgNewMessage() diff --git a/mozilla/xpfe/browser/samples/dexopenchrome.xul b/mozilla/xpfe/browser/samples/dexopenchrome.xul index 457737aa500..4264ff5eb18 100644 --- a/mozilla/xpfe/browser/samples/dexopenchrome.xul +++ b/mozilla/xpfe/browser/samples/dexopenchrome.xul @@ -10,11 +10,22 @@ 0) features = features + ","; features = features + featureList[ctr] + "=no"; @@ -38,27 +51,107 @@ } } dump("******* " + features + "\n"); - window.openDialog("resource:/res/samples/dexparamdialog."+extension, - "New", features, {remind:true}); + return features; } ]]> - - close - titlebar - resizable - scrollbars - chrome - dialog - modal - menubar - toolbar - status - location - - - + + + + + + all + + explicit + + + + + close + + explicit + + + + + titlebar + + explicit + + + + + resizable + + + + + scrollbars + + + + + chrome + + + + + dialog + + explicit + + + + + modal + + + + + menubar + + + + + toolbar + + + + + status + + + + + location + + + + + Open + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/xpfe/browser/samples/dexparammaster.xul b/mozilla/xpfe/browser/samples/dexparammaster.xul index 2e388afaa10..de34c89dcc8 100644 --- a/mozilla/xpfe/browser/samples/dexparammaster.xul +++ b/mozilla/xpfe/browser/samples/dexparammaster.xul @@ -13,12 +13,12 @@ var dialogWindow = null; function NewBrowser() { - return window.open("http://www.mozilla.org/", "New"); + return window.open("http://www.mozilla.org/"); } // show a nonmodal dialog, sending parameters as part of the URL function MakeURLDialog() { - var newWin = window.open("resource:/res/samples/dexparamdialog.xul?remind=true;prompt=Give me your money and convertible bonds", "New", "chrome"); + var newWin = window.open("resource:/res/samples/dexparamdialog.xul?remind=true;prompt=Give me your money and convertible bonds", "", "chrome"); return newWin; } diff --git a/mozilla/xpfe/components/bookmarks/resources/bookmarks.js b/mozilla/xpfe/components/bookmarks/resources/bookmarks.js index 57fb323b657..1dca5eebb1a 100644 --- a/mozilla/xpfe/components/bookmarks/resources/bookmarks.js +++ b/mozilla/xpfe/components/bookmarks/resources/bookmarks.js @@ -32,7 +32,7 @@ function BookmarkProperties() if (type != "http://home.netscape.com/NC-rdf#BookmarkSeparator") { var props = window.open("chrome://bookmarks/content/bm-props.xul", - "BookmarkProperties", "chrome"); + "BookmarkProperties", "chrome,menubar,resizable"); props.BookmarkURL = select_list[0].getAttribute("id"); } } else { diff --git a/mozilla/xpfe/components/bookmarks/resources/bookmarks.xul b/mozilla/xpfe/components/bookmarks/resources/bookmarks.xul index 6cc8f24c589..582b89071e0 100644 --- a/mozilla/xpfe/components/bookmarks/resources/bookmarks.xul +++ b/mozilla/xpfe/components/bookmarks/resources/bookmarks.xul @@ -39,7 +39,7 @@ + 'chrome,menubar,resizable');" /> diff --git a/mozilla/xpfe/global/resources/content/tasksOverlay.js b/mozilla/xpfe/global/resources/content/tasksOverlay.js index f87fcedc299..845ad52d087 100644 --- a/mozilla/xpfe/global/resources/content/tasksOverlay.js +++ b/mozilla/xpfe/global/resources/content/tasksOverlay.js @@ -40,7 +40,7 @@ function toOpenWindowByType( inType, uri ) if ( topWindow ) topWindow.focus(); else - window.open(uri, "", "chrome,menubar"); + window.open(uri, "", "chrome,menubar,toolbar,resizable"); } function CycleWindow( inType, inChromeURL ) @@ -60,7 +60,7 @@ function CycleWindow( inType, inChromeURL ) if ( topWindowOfType == null ) { dump( " no windows of this type so create a new one \n"); - window.open( inChromeURL, "","chrome,menubar,toolbar" ); + window.open( inChromeURL, "","chrome,menubar,toolbar,resizable" ); return; } @@ -103,7 +103,7 @@ function CycleWindow( inType, inChromeURL ) else { dump("open window \n"); - window.open( inChromeURL, "","chrome,menubar" ); + window.open( inChromeURL, "","chrome,menubar,toolbar,resizable" ); } }