From e7180038c00c3572988ec9acf9f74721340e7495 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Wed, 8 Feb 2012 09:23:40 +0100 Subject: [PATCH] Backout 7a8b935ab596 (bug 674370) for Paint regression --- browser/base/content/browser.xul | 1 - .../sessionstore/src/nsSessionStore.js | 2 +- browser/devtools/scratchpad/scratchpad.xul | 1 - .../webBrowser/nsIWebBrowserChrome.idl | 54 +++++++++---------- .../windowwatcher/src/nsWindowWatcher.cpp | 3 -- widget/cocoa/nsCocoaWindow.h | 20 ------- widget/cocoa/nsCocoaWindow.mm | 29 ---------- widget/nsIWidget.h | 14 ----- widget/nsWidgetInitData.h | 5 +- widget/xpwidgets/nsBaseWidget.h | 1 - xpfe/appshell/src/nsAppShellService.cpp | 3 -- xpfe/appshell/src/nsXULWindow.cpp | 6 --- 12 files changed, 27 insertions(+), 112 deletions(-) diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index ef5ba84b8a32..13ccc2833085 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -90,7 +90,6 @@ lightweightthemes="true" lightweightthemesfooter="browser-bottombox" windowtype="navigator:browser" - macanimationtype="document" screenX="4" screenY="4" browsingmode="normal" persist="screenX screenY width height sizemode"> diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js index 28150156618e..c72513df9746 100644 --- a/browser/components/sessionstore/src/nsSessionStore.js +++ b/browser/components/sessionstore/src/nsSessionStore.js @@ -3810,7 +3810,7 @@ SessionStoreService.prototype = { argString.data = ""; // Build feature string - let features = "chrome,dialog=no,macsuppressanimation,all"; + let features = "chrome,dialog=no,all"; let winState = aState.windows[0]; WINDOW_ATTRIBUTES.forEach(function(aFeature) { // Use !isNaN as an easy way to ignore sizemode and check for numbers diff --git a/browser/devtools/scratchpad/scratchpad.xul b/browser/devtools/scratchpad/scratchpad.xul index eb3c17b08c21..c8a4c7e3f7bd 100644 --- a/browser/devtools/scratchpad/scratchpad.xul +++ b/browser/devtools/scratchpad/scratchpad.xul @@ -51,7 +51,6 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="&window.title;" windowtype="devtools:scratchpad" - macanimationtype="document" screenX="4" screenY="4" width="640" height="480" persist="screenX screenY width height sizemode"> diff --git a/embedding/browser/webBrowser/nsIWebBrowserChrome.idl b/embedding/browser/webBrowser/nsIWebBrowserChrome.idl index 58b03015c509..ffef485bec74 100644 --- a/embedding/browser/webBrowser/nsIWebBrowserChrome.idl +++ b/embedding/browser/webBrowser/nsIWebBrowserChrome.idl @@ -47,7 +47,7 @@ interface nsIDocShellTreeItem; * containing an embedded Gecko web browser. */ -[scriptable, uuid(E8C414C4-DC38-4BA3-AB4E-EC4CBBE22907)] +[scriptable, uuid(BA434C60-9D52-11d3-AFB0-00A024FFC08C)] interface nsIWebBrowserChrome : nsISupports { const unsigned long STATUS_SCRIPT = 0x00000001; @@ -75,47 +75,43 @@ interface nsIWebBrowserChrome : nsISupports /** * Definitions for the chrome flags */ - const unsigned long CHROME_DEFAULT = 0x00000001; - const unsigned long CHROME_WINDOW_BORDERS = 0x00000002; - const unsigned long CHROME_WINDOW_CLOSE = 0x00000004; - const unsigned long CHROME_WINDOW_RESIZE = 0x00000008; - const unsigned long CHROME_MENUBAR = 0x00000010; - const unsigned long CHROME_TOOLBAR = 0x00000020; - const unsigned long CHROME_LOCATIONBAR = 0x00000040; - const unsigned long CHROME_STATUSBAR = 0x00000080; - const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100; - const unsigned long CHROME_SCROLLBARS = 0x00000200; - const unsigned long CHROME_TITLEBAR = 0x00000400; - const unsigned long CHROME_EXTRA = 0x00000800; + const unsigned long CHROME_DEFAULT = 0x00000001; + const unsigned long CHROME_WINDOW_BORDERS = 0x00000002; + const unsigned long CHROME_WINDOW_CLOSE = 0x00000004; + const unsigned long CHROME_WINDOW_RESIZE = 0x00000008; + const unsigned long CHROME_MENUBAR = 0x00000010; + const unsigned long CHROME_TOOLBAR = 0x00000020; + const unsigned long CHROME_LOCATIONBAR = 0x00000040; + const unsigned long CHROME_STATUSBAR = 0x00000080; + const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100; + const unsigned long CHROME_SCROLLBARS = 0x00000200; + const unsigned long CHROME_TITLEBAR = 0x00000400; + const unsigned long CHROME_EXTRA = 0x00000800; // createBrowserWindow specific flags - const unsigned long CHROME_WITH_SIZE = 0x00001000; - const unsigned long CHROME_WITH_POSITION = 0x00002000; + const unsigned long CHROME_WITH_SIZE = 0x00001000; + const unsigned long CHROME_WITH_POSITION = 0x00002000; // special cases - const unsigned long CHROME_WINDOW_MIN = 0x00004000; - const unsigned long CHROME_WINDOW_POPUP = 0x00008000; + const unsigned long CHROME_WINDOW_MIN = 0x00004000; + const unsigned long CHROME_WINDOW_POPUP = 0x00008000; - // Prevents new window animations on Mac OS X Lion. Ignored on other - // platforms. - const unsigned long CHROME_MAC_SUPPRESS_ANIMATION = 0x01000000; - - const unsigned long CHROME_WINDOW_RAISED = 0x02000000; - const unsigned long CHROME_WINDOW_LOWERED = 0x04000000; - const unsigned long CHROME_CENTER_SCREEN = 0x08000000; + const unsigned long CHROME_WINDOW_RAISED = 0x02000000; + const unsigned long CHROME_WINDOW_LOWERED = 0x04000000; + const unsigned long CHROME_CENTER_SCREEN = 0x08000000; // Make the new window dependent on the parent. This flag is only // meaningful if CHROME_OPENAS_CHROME is set; content windows should not be // dependent. - const unsigned long CHROME_DEPENDENT = 0x10000000; + const unsigned long CHROME_DEPENDENT = 0x10000000; // Note: The modal style bit just affects the way the window looks and does // mean it's actually modal. - const unsigned long CHROME_MODAL = 0x20000000; - const unsigned long CHROME_OPENAS_DIALOG = 0x40000000; - const unsigned long CHROME_OPENAS_CHROME = 0x80000000; + const unsigned long CHROME_MODAL = 0x20000000; + const unsigned long CHROME_OPENAS_DIALOG = 0x40000000; + const unsigned long CHROME_OPENAS_CHROME = 0x80000000; - const unsigned long CHROME_ALL = 0x00000ffe; + const unsigned long CHROME_ALL = 0x00000ffe; /** * The chrome flags for this browser chrome. The implementation should diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index 1ac0bc55c43b..947681086c89 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -1527,9 +1527,6 @@ PRUint32 nsWindowWatcher::CalculateChromeFlags(const char *aFeatures, else if (WinHasOption(aFeatures, "alwaysRaised", 0, nsnull)) chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_RAISED; - chromeFlags |= WinHasOption(aFeatures, "macsuppressanimation", 0, nsnull) ? - nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION : 0; - chromeFlags |= WinHasOption(aFeatures, "chrome", 0, nsnull) ? nsIWebBrowserChrome::CHROME_OPENAS_CHROME : 0; chromeFlags |= WinHasOption(aFeatures, "extrachrome", 0, nsnull) ? diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h index f01aebe26973..b114319611aa 100644 --- a/widget/cocoa/nsCocoaWindow.h +++ b/widget/cocoa/nsCocoaWindow.h @@ -197,21 +197,6 @@ typedef struct _nsCocoaWindowList { - (void)setDrawsContentsIntoWindowFrame:(BOOL)aState; @end -#if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) -enum { - NSWindowAnimationBehaviorDefault = 0, - NSWindowAnimationBehaviorNone = 2, - NSWindowAnimationBehaviorDocumentWindow = 3, - NSWindowAnimationBehaviorUtilityWindow = 4, - NSWindowAnimationBehaviorAlertPanel = 5 -}; -typedef NSInteger NSWindowAnimationBehavior; - -@interface NSWindow (LionWindowFeatures) -- (void)setAnimationBehavior:(NSWindowAnimationBehavior)newAnimationBehavior; -@end -#endif - class nsCocoaWindow : public nsBaseWidget, public nsPIWidgetCocoa { private: @@ -281,7 +266,6 @@ public: virtual void SetTransparencyMode(nsTransparencyMode aMode); NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle); virtual void SetShowsToolbarButton(bool aShow); - virtual void SetWindowAnimationType(WindowAnimationType aType); NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, bool aActive); virtual void SetDrawsInTitlebar(bool aState); virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint, @@ -351,16 +335,12 @@ protected: PRInt32 mShadowStyle; NSUInteger mWindowFilter; - WindowAnimationType mAnimationType; - bool mWindowMadeHere; // true if we created the window, false for embedding bool mSheetNeedsShow; // if this is a sheet, are we waiting to be shown? // this is used for sibling sheet contention only bool mFullScreen; bool mModal; - bool mIsAnimationSuppressed; - bool mInReportMoveEvent; // true if in a call to ReportMoveEvent(). PRInt32 mNumModalDescendents; diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index f4c38ab9facf..3bb7004eb51b 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -135,12 +135,10 @@ nsCocoaWindow::nsCocoaWindow() , mPopupContentView(nil) , mShadowStyle(NS_STYLE_WINDOW_SHADOW_DEFAULT) , mWindowFilter(0) -, mAnimationType(nsIWidget::eGenericWindowAnimation) , mWindowMadeHere(false) , mSheetNeedsShow(false) , mFullScreen(false) , mModal(false) -, mIsAnimationSuppressed(false) , mInReportMoveEvent(false) , mNumModalDescendents(0) { @@ -306,8 +304,6 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent, return CreatePopupContentView(newBounds, aHandleEventFunction, aContext); } - mIsAnimationSuppressed = aInitData->mIsAnimationSuppressed; - return NS_OK; NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; @@ -749,26 +745,6 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState) } else { NS_OBJC_BEGIN_TRY_LOGONLY_BLOCK; - if (mWindowType == eWindowType_toplevel && - [mWindow respondsToSelector:@selector(setAnimationBehavior:)]) { - NSWindowAnimationBehavior behavior; - if (mIsAnimationSuppressed) { - behavior = NSWindowAnimationBehaviorNone; - } else { - switch (mAnimationType) { - case nsIWidget::eDocumentWindowAnimation: - behavior = NSWindowAnimationBehaviorDocumentWindow; - break; - default: - NS_NOTREACHED("unexpected mAnimationType value"); - // fall through - case nsIWidget::eGenericWindowAnimation: - behavior = NSWindowAnimationBehaviorDefault; - break; - } - } - [mWindow setAnimationBehavior:behavior]; - } [mWindow makeKeyAndOrderFront:nil]; NS_OBJC_END_TRY_LOGONLY_BLOCK; SendSetZLevelEvent(); @@ -1631,11 +1607,6 @@ void nsCocoaWindow::SetShowsToolbarButton(bool aShow) NS_OBJC_END_TRY_ABORT_BLOCK; } -void nsCocoaWindow::SetWindowAnimationType(nsIWidget::WindowAnimationType aType) -{ - mAnimationType = aType; -} - NS_IMETHODIMP nsCocoaWindow::SetWindowTitlebarColor(nscolor aColor, bool aActive) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 0f17dfc32b9f..eb5e28795816 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -1017,20 +1017,6 @@ class nsIWidget : public nsISupports { */ virtual void SetShowsToolbarButton(bool aShow) = 0; - enum WindowAnimationType { - eGenericWindowAnimation, - eDocumentWindowAnimation - }; - - /** - * Sets the kind of top-level window animation this widget should have. On - * Mac OS X, this causes a particular kind of animation to be shown when the - * window is first made visible. - * - * Ignored on child widgets and on non-Mac platforms. - */ - virtual void SetWindowAnimationType(WindowAnimationType aType) = 0; - /** * Hide window chrome (borders, buttons) for this widget. * diff --git a/widget/nsWidgetInitData.h b/widget/nsWidgetInitData.h index 71c76828650b..34ffae230719 100644 --- a/widget/nsWidgetInitData.h +++ b/widget/nsWidgetInitData.h @@ -133,8 +133,7 @@ struct nsWidgetInitData { mUnicode(true), mRTL(false), mNoAutoHide(false), - mIsDragPopup(false), - mIsAnimationSuppressed(false) + mIsDragPopup(false) { } @@ -149,8 +148,6 @@ struct nsWidgetInitData { bool mRTL; bool mNoAutoHide; // true for noautohide panels bool mIsDragPopup; // true for drag feedback panels - bool mIsAnimationSuppressed; // true if window creation animation is - // suppressed, e.g. for session restore }; #endif // nsWidgetInitData_h__ diff --git a/widget/xpwidgets/nsBaseWidget.h b/widget/xpwidgets/nsBaseWidget.h index 9e48cd2122ea..4f9647134d7b 100644 --- a/widget/xpwidgets/nsBaseWidget.h +++ b/widget/xpwidgets/nsBaseWidget.h @@ -123,7 +123,6 @@ public: virtual void GetWindowClipRegion(nsTArray* aRects); NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle); virtual void SetShowsToolbarButton(bool aShow) {} - virtual void SetWindowAnimationType(WindowAnimationType aType) {} NS_IMETHOD HideWindowChrome(bool aShouldHide); NS_IMETHOD MakeFullScreen(bool aFullScreen); virtual nsDeviceContext* GetDeviceContext(); diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index bb91c183a48d..92e5cacaedb5 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -308,9 +308,6 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent, if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_POPUP) widgetInitData.mWindowType = eWindowType_popup; - if (aChromeMask & nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION) - widgetInitData.mIsAnimationSuppressed = true; - #ifdef XP_MACOSX // Mac OS X sheet support // Adding CHROME_OPENAS_CHROME to sheetMask makes modal windows opened from diff --git a/xpfe/appshell/src/nsXULWindow.cpp b/xpfe/appshell/src/nsXULWindow.cpp index d9701a926901..c72964f9d936 100644 --- a/xpfe/appshell/src/nsXULWindow.cpp +++ b/xpfe/appshell/src/nsXULWindow.cpp @@ -1412,12 +1412,6 @@ void nsXULWindow::SyncAttributesToWidget() if (NS_SUCCEEDED(rv)) { mWindow->SetShowsToolbarButton(attr.LowerCaseEqualsLiteral("true")); } - - // "macanimationtype" attribute - rv = windowElement->GetAttribute(NS_LITERAL_STRING("macanimationtype"), attr); - if (NS_SUCCEEDED(rv) && attr.EqualsLiteral("document")) { - mWindow->SetWindowAnimationType(nsIWidget::eDocumentWindowAnimation); - } } NS_IMETHODIMP nsXULWindow::SavePersistentAttributes()