Merge backout

This commit is contained in:
Chris Jones 2010-08-19 19:03:36 -05:00
commit 7ed0cfae61

View File

@ -527,15 +527,13 @@ nsWindow::Create(nsIWidget *aParent,
nsIToolkit *aToolkit, nsIToolkit *aToolkit,
nsWidgetInitData *aInitData) nsWidgetInitData *aInitData)
{ {
nsWidgetInitData defaultInitData; if (aInitData)
if (!aInitData)
aInitData = &defaultInitData;
mUnicodeWidget = aInitData->mUnicode; mUnicodeWidget = aInitData->mUnicode;
nsIWidget *baseParent = aInitData->mWindowType == eWindowType_dialog || nsIWidget *baseParent = aInitData &&
(aInitData->mWindowType == eWindowType_dialog ||
aInitData->mWindowType == eWindowType_toplevel || aInitData->mWindowType == eWindowType_toplevel ||
aInitData->mWindowType == eWindowType_invisible ? aInitData->mWindowType == eWindowType_invisible) ?
nsnull : aParent; nsnull : aParent;
mIsTopWidgetWindow = (nsnull == baseParent); mIsTopWidgetWindow = (nsnull == baseParent);
@ -554,8 +552,11 @@ nsWindow::Create(nsIWidget *aParent,
mParent = aNativeParent ? GetNSWindowPtr((HWND)aNativeParent) : nsnull; mParent = aNativeParent ? GetNSWindowPtr((HWND)aNativeParent) : nsnull;
} }
if (nsnull != aInitData) {
mPopupType = aInitData->mPopupHint; mPopupType = aInitData->mPopupHint;
mContentType = aInitData->mContentType; }
mContentType = aInitData ? aInitData->mContentType : eContentTypeInherit;
DWORD style = WindowStyle(); DWORD style = WindowStyle();
DWORD extendedStyle = WindowExStyle(); DWORD extendedStyle = WindowExStyle();
@ -570,7 +571,7 @@ nsWindow::Create(nsIWidget *aParent,
} else if (mWindowType == eWindowType_invisible) { } else if (mWindowType == eWindowType_invisible) {
// Make sure CreateWindowEx succeeds at creating a toplevel window // Make sure CreateWindowEx succeeds at creating a toplevel window
style &= ~0x40000000; // WS_CHILDWINDOW style &= ~0x40000000; // WS_CHILDWINDOW
} else { } else if (nsnull != aInitData) {
// See if the caller wants to explictly set clip children and clip siblings // See if the caller wants to explictly set clip children and clip siblings
if (aInitData->clipChildren) { if (aInitData->clipChildren) {
style |= WS_CLIPCHILDREN; style |= WS_CLIPCHILDREN;
@ -583,7 +584,7 @@ nsWindow::Create(nsIWidget *aParent,
} }
mWnd = ::CreateWindowExW(extendedStyle, mWnd = ::CreateWindowExW(extendedStyle,
aInitData->mDropShadow ? aInitData && aInitData->mDropShadow ?
WindowPopupClass() : WindowClass(), WindowPopupClass() : WindowClass(),
L"", L"",
style, style,