Backout 7a8b935ab596 (bug 674370) for Paint regression

This commit is contained in:
Marco Bonardo 2012-02-08 09:23:40 +01:00
Родитель aa0a90e6d3
Коммит e7180038c0
12 изменённых файлов: 27 добавлений и 112 удалений

Просмотреть файл

@ -90,7 +90,6 @@
lightweightthemes="true" lightweightthemes="true"
lightweightthemesfooter="browser-bottombox" lightweightthemesfooter="browser-bottombox"
windowtype="navigator:browser" windowtype="navigator:browser"
macanimationtype="document"
screenX="4" screenY="4" screenX="4" screenY="4"
browsingmode="normal" browsingmode="normal"
persist="screenX screenY width height sizemode"> persist="screenX screenY width height sizemode">

Просмотреть файл

@ -3810,7 +3810,7 @@ SessionStoreService.prototype = {
argString.data = ""; argString.data = "";
// Build feature string // Build feature string
let features = "chrome,dialog=no,macsuppressanimation,all"; let features = "chrome,dialog=no,all";
let winState = aState.windows[0]; let winState = aState.windows[0];
WINDOW_ATTRIBUTES.forEach(function(aFeature) { WINDOW_ATTRIBUTES.forEach(function(aFeature) {
// Use !isNaN as an easy way to ignore sizemode and check for numbers // Use !isNaN as an easy way to ignore sizemode and check for numbers

Просмотреть файл

@ -51,7 +51,6 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&window.title;" title="&window.title;"
windowtype="devtools:scratchpad" windowtype="devtools:scratchpad"
macanimationtype="document"
screenX="4" screenY="4" screenX="4" screenY="4"
width="640" height="480" width="640" height="480"
persist="screenX screenY width height sizemode"> persist="screenX screenY width height sizemode">

Просмотреть файл

@ -47,7 +47,7 @@ interface nsIDocShellTreeItem;
* containing an embedded Gecko web browser. * containing an embedded Gecko web browser.
*/ */
[scriptable, uuid(E8C414C4-DC38-4BA3-AB4E-EC4CBBE22907)] [scriptable, uuid(BA434C60-9D52-11d3-AFB0-00A024FFC08C)]
interface nsIWebBrowserChrome : nsISupports interface nsIWebBrowserChrome : nsISupports
{ {
const unsigned long STATUS_SCRIPT = 0x00000001; const unsigned long STATUS_SCRIPT = 0x00000001;
@ -75,47 +75,43 @@ interface nsIWebBrowserChrome : nsISupports
/** /**
* Definitions for the chrome flags * Definitions for the chrome flags
*/ */
const unsigned long CHROME_DEFAULT = 0x00000001; const unsigned long CHROME_DEFAULT = 0x00000001;
const unsigned long CHROME_WINDOW_BORDERS = 0x00000002; const unsigned long CHROME_WINDOW_BORDERS = 0x00000002;
const unsigned long CHROME_WINDOW_CLOSE = 0x00000004; const unsigned long CHROME_WINDOW_CLOSE = 0x00000004;
const unsigned long CHROME_WINDOW_RESIZE = 0x00000008; const unsigned long CHROME_WINDOW_RESIZE = 0x00000008;
const unsigned long CHROME_MENUBAR = 0x00000010; const unsigned long CHROME_MENUBAR = 0x00000010;
const unsigned long CHROME_TOOLBAR = 0x00000020; const unsigned long CHROME_TOOLBAR = 0x00000020;
const unsigned long CHROME_LOCATIONBAR = 0x00000040; const unsigned long CHROME_LOCATIONBAR = 0x00000040;
const unsigned long CHROME_STATUSBAR = 0x00000080; const unsigned long CHROME_STATUSBAR = 0x00000080;
const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100; const unsigned long CHROME_PERSONAL_TOOLBAR = 0x00000100;
const unsigned long CHROME_SCROLLBARS = 0x00000200; const unsigned long CHROME_SCROLLBARS = 0x00000200;
const unsigned long CHROME_TITLEBAR = 0x00000400; const unsigned long CHROME_TITLEBAR = 0x00000400;
const unsigned long CHROME_EXTRA = 0x00000800; const unsigned long CHROME_EXTRA = 0x00000800;
// createBrowserWindow specific flags // createBrowserWindow specific flags
const unsigned long CHROME_WITH_SIZE = 0x00001000; const unsigned long CHROME_WITH_SIZE = 0x00001000;
const unsigned long CHROME_WITH_POSITION = 0x00002000; const unsigned long CHROME_WITH_POSITION = 0x00002000;
// special cases // special cases
const unsigned long CHROME_WINDOW_MIN = 0x00004000; const unsigned long CHROME_WINDOW_MIN = 0x00004000;
const unsigned long CHROME_WINDOW_POPUP = 0x00008000; const unsigned long CHROME_WINDOW_POPUP = 0x00008000;
// Prevents new window animations on Mac OS X Lion. Ignored on other const unsigned long CHROME_WINDOW_RAISED = 0x02000000;
// platforms. const unsigned long CHROME_WINDOW_LOWERED = 0x04000000;
const unsigned long CHROME_MAC_SUPPRESS_ANIMATION = 0x01000000; 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 // Make the new window dependent on the parent. This flag is only
// meaningful if CHROME_OPENAS_CHROME is set; content windows should not be // meaningful if CHROME_OPENAS_CHROME is set; content windows should not be
// dependent. // 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 // Note: The modal style bit just affects the way the window looks and does
// mean it's actually modal. // mean it's actually modal.
const unsigned long CHROME_MODAL = 0x20000000; const unsigned long CHROME_MODAL = 0x20000000;
const unsigned long CHROME_OPENAS_DIALOG = 0x40000000; const unsigned long CHROME_OPENAS_DIALOG = 0x40000000;
const unsigned long CHROME_OPENAS_CHROME = 0x80000000; 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 * The chrome flags for this browser chrome. The implementation should

Просмотреть файл

@ -1527,9 +1527,6 @@ PRUint32 nsWindowWatcher::CalculateChromeFlags(const char *aFeatures,
else if (WinHasOption(aFeatures, "alwaysRaised", 0, nsnull)) else if (WinHasOption(aFeatures, "alwaysRaised", 0, nsnull))
chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_RAISED; chromeFlags |= nsIWebBrowserChrome::CHROME_WINDOW_RAISED;
chromeFlags |= WinHasOption(aFeatures, "macsuppressanimation", 0, nsnull) ?
nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION : 0;
chromeFlags |= WinHasOption(aFeatures, "chrome", 0, nsnull) ? chromeFlags |= WinHasOption(aFeatures, "chrome", 0, nsnull) ?
nsIWebBrowserChrome::CHROME_OPENAS_CHROME : 0; nsIWebBrowserChrome::CHROME_OPENAS_CHROME : 0;
chromeFlags |= WinHasOption(aFeatures, "extrachrome", 0, nsnull) ? chromeFlags |= WinHasOption(aFeatures, "extrachrome", 0, nsnull) ?

Просмотреть файл

@ -197,21 +197,6 @@ typedef struct _nsCocoaWindowList {
- (void)setDrawsContentsIntoWindowFrame:(BOOL)aState; - (void)setDrawsContentsIntoWindowFrame:(BOOL)aState;
@end @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 class nsCocoaWindow : public nsBaseWidget, public nsPIWidgetCocoa
{ {
private: private:
@ -281,7 +266,6 @@ public:
virtual void SetTransparencyMode(nsTransparencyMode aMode); virtual void SetTransparencyMode(nsTransparencyMode aMode);
NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle); NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle);
virtual void SetShowsToolbarButton(bool aShow); virtual void SetShowsToolbarButton(bool aShow);
virtual void SetWindowAnimationType(WindowAnimationType aType);
NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, bool aActive); NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, bool aActive);
virtual void SetDrawsInTitlebar(bool aState); virtual void SetDrawsInTitlebar(bool aState);
virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint, virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint,
@ -351,16 +335,12 @@ protected:
PRInt32 mShadowStyle; PRInt32 mShadowStyle;
NSUInteger mWindowFilter; NSUInteger mWindowFilter;
WindowAnimationType mAnimationType;
bool mWindowMadeHere; // true if we created the window, false for embedding bool mWindowMadeHere; // true if we created the window, false for embedding
bool mSheetNeedsShow; // if this is a sheet, are we waiting to be shown? bool mSheetNeedsShow; // if this is a sheet, are we waiting to be shown?
// this is used for sibling sheet contention only // this is used for sibling sheet contention only
bool mFullScreen; bool mFullScreen;
bool mModal; bool mModal;
bool mIsAnimationSuppressed;
bool mInReportMoveEvent; // true if in a call to ReportMoveEvent(). bool mInReportMoveEvent; // true if in a call to ReportMoveEvent().
PRInt32 mNumModalDescendents; PRInt32 mNumModalDescendents;

Просмотреть файл

@ -135,12 +135,10 @@ nsCocoaWindow::nsCocoaWindow()
, mPopupContentView(nil) , mPopupContentView(nil)
, mShadowStyle(NS_STYLE_WINDOW_SHADOW_DEFAULT) , mShadowStyle(NS_STYLE_WINDOW_SHADOW_DEFAULT)
, mWindowFilter(0) , mWindowFilter(0)
, mAnimationType(nsIWidget::eGenericWindowAnimation)
, mWindowMadeHere(false) , mWindowMadeHere(false)
, mSheetNeedsShow(false) , mSheetNeedsShow(false)
, mFullScreen(false) , mFullScreen(false)
, mModal(false) , mModal(false)
, mIsAnimationSuppressed(false)
, mInReportMoveEvent(false) , mInReportMoveEvent(false)
, mNumModalDescendents(0) , mNumModalDescendents(0)
{ {
@ -306,8 +304,6 @@ nsresult nsCocoaWindow::Create(nsIWidget *aParent,
return CreatePopupContentView(newBounds, aHandleEventFunction, aContext); return CreatePopupContentView(newBounds, aHandleEventFunction, aContext);
} }
mIsAnimationSuppressed = aInitData->mIsAnimationSuppressed;
return NS_OK; return NS_OK;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
@ -749,26 +745,6 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
} }
else { else {
NS_OBJC_BEGIN_TRY_LOGONLY_BLOCK; 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]; [mWindow makeKeyAndOrderFront:nil];
NS_OBJC_END_TRY_LOGONLY_BLOCK; NS_OBJC_END_TRY_LOGONLY_BLOCK;
SendSetZLevelEvent(); SendSetZLevelEvent();
@ -1631,11 +1607,6 @@ void nsCocoaWindow::SetShowsToolbarButton(bool aShow)
NS_OBJC_END_TRY_ABORT_BLOCK; NS_OBJC_END_TRY_ABORT_BLOCK;
} }
void nsCocoaWindow::SetWindowAnimationType(nsIWidget::WindowAnimationType aType)
{
mAnimationType = aType;
}
NS_IMETHODIMP nsCocoaWindow::SetWindowTitlebarColor(nscolor aColor, bool aActive) NS_IMETHODIMP nsCocoaWindow::SetWindowTitlebarColor(nscolor aColor, bool aActive)
{ {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;

Просмотреть файл

@ -1017,20 +1017,6 @@ class nsIWidget : public nsISupports {
*/ */
virtual void SetShowsToolbarButton(bool aShow) = 0; 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. * Hide window chrome (borders, buttons) for this widget.
* *

Просмотреть файл

@ -133,8 +133,7 @@ struct nsWidgetInitData {
mUnicode(true), mUnicode(true),
mRTL(false), mRTL(false),
mNoAutoHide(false), mNoAutoHide(false),
mIsDragPopup(false), mIsDragPopup(false)
mIsAnimationSuppressed(false)
{ {
} }
@ -149,8 +148,6 @@ struct nsWidgetInitData {
bool mRTL; bool mRTL;
bool mNoAutoHide; // true for noautohide panels bool mNoAutoHide; // true for noautohide panels
bool mIsDragPopup; // true for drag feedback 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__ #endif // nsWidgetInitData_h__

Просмотреть файл

@ -123,7 +123,6 @@ public:
virtual void GetWindowClipRegion(nsTArray<nsIntRect>* aRects); virtual void GetWindowClipRegion(nsTArray<nsIntRect>* aRects);
NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle); NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle);
virtual void SetShowsToolbarButton(bool aShow) {} virtual void SetShowsToolbarButton(bool aShow) {}
virtual void SetWindowAnimationType(WindowAnimationType aType) {}
NS_IMETHOD HideWindowChrome(bool aShouldHide); NS_IMETHOD HideWindowChrome(bool aShouldHide);
NS_IMETHOD MakeFullScreen(bool aFullScreen); NS_IMETHOD MakeFullScreen(bool aFullScreen);
virtual nsDeviceContext* GetDeviceContext(); virtual nsDeviceContext* GetDeviceContext();

Просмотреть файл

@ -308,9 +308,6 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent,
if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_POPUP) if (aChromeMask & nsIWebBrowserChrome::CHROME_WINDOW_POPUP)
widgetInitData.mWindowType = eWindowType_popup; widgetInitData.mWindowType = eWindowType_popup;
if (aChromeMask & nsIWebBrowserChrome::CHROME_MAC_SUPPRESS_ANIMATION)
widgetInitData.mIsAnimationSuppressed = true;
#ifdef XP_MACOSX #ifdef XP_MACOSX
// Mac OS X sheet support // Mac OS X sheet support
// Adding CHROME_OPENAS_CHROME to sheetMask makes modal windows opened from // Adding CHROME_OPENAS_CHROME to sheetMask makes modal windows opened from

Просмотреть файл

@ -1412,12 +1412,6 @@ void nsXULWindow::SyncAttributesToWidget()
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
mWindow->SetShowsToolbarButton(attr.LowerCaseEqualsLiteral("true")); 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() NS_IMETHODIMP nsXULWindow::SavePersistentAttributes()