зеркало из https://github.com/mozilla/pjs.git
Backout changesets 9e4ab3907b29, 3abc0dbbf710 due to m-oth permaorange
This commit is contained in:
Родитель
753ac50492
Коммит
477b6576b7
|
@ -867,8 +867,7 @@
|
|||
updatePageReport = true;
|
||||
|
||||
newBrowser.setAttribute("type", "content-primary");
|
||||
newBrowser.docShellIsActive =
|
||||
(window.windowState != window.STATE_MINIMIZED);
|
||||
newBrowser.docShellIsActive = true;
|
||||
this.mCurrentBrowser = newBrowser;
|
||||
this.mCurrentTab = this.selectedTab;
|
||||
this.showTab(this.mCurrentTab);
|
||||
|
@ -2464,12 +2463,6 @@
|
|||
case "keypress":
|
||||
this._handleKeyEvent(aEvent);
|
||||
break;
|
||||
case "sizemodechange":
|
||||
if (aEvent.target == window) {
|
||||
this.mCurrentBrowser.docShellIsActive =
|
||||
(window.windowState != window.STATE_MINIMIZED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
@ -2479,7 +2472,6 @@
|
|||
this.mCurrentBrowser = this.mPanelContainer.childNodes[0].firstChild.firstChild;
|
||||
this.mCurrentTab = this.tabContainer.firstChild;
|
||||
document.addEventListener("keypress", this, false);
|
||||
window.addEventListener("sizemodechange", this, false);
|
||||
|
||||
var uniqueId = "panel" + Date.now();
|
||||
this.mPanelContainer.childNodes[0].id = uniqueId;
|
||||
|
@ -2542,7 +2534,6 @@
|
|||
this.mTabListeners[i] = null;
|
||||
}
|
||||
document.removeEventListener("keypress", this, false);
|
||||
window.removeEventListener("sizemodechange", this, false);
|
||||
]]>
|
||||
</destructor>
|
||||
|
||||
|
|
|
@ -256,7 +256,6 @@ _BROWSER_FILES = \
|
|||
browser_addon_bar_shortcut.js \
|
||||
browser_addon_bar_aomlistener.js \
|
||||
test_bug628179.html \
|
||||
browser_minimize.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
function test() {
|
||||
is(gBrowser.docShellIsActive, true, "Docshell should be active");
|
||||
window.minimize();
|
||||
is(gBrowser.docShellIsActive, false, "Docshell should be inactive");
|
||||
window.restore();
|
||||
is(gBrowser.docShellIsActive, true, "Docshell should be active again");
|
||||
}
|
|
@ -383,7 +383,6 @@ public:
|
|||
virtual NS_HIDDEN_(void) SetHasOrientationEventListener();
|
||||
virtual NS_HIDDEN_(void) MaybeUpdateTouchState();
|
||||
virtual NS_HIDDEN_(void) UpdateTouchState();
|
||||
virtual NS_HIDDEN_(PRBool) DispatchCustomEvent(const char *aEventName);
|
||||
|
||||
// nsIDOMStorageWindow
|
||||
NS_DECL_NSIDOMSTORAGEWINDOW
|
||||
|
@ -730,6 +729,8 @@ protected:
|
|||
return GetParentInternal() != nsnull;
|
||||
}
|
||||
|
||||
PRBool DispatchCustomEvent(const char *aEventName);
|
||||
|
||||
// If aLookForCallerOnJSStack is true, this method will look at the JS stack
|
||||
// to determine who the caller is. If it's false, it'll use |this| as the
|
||||
// caller.
|
||||
|
|
|
@ -80,8 +80,8 @@ class nsIArray;
|
|||
class nsPIWindowRoot;
|
||||
|
||||
#define NS_PIDOMWINDOW_IID \
|
||||
{ 0xa595249b, 0x1e74, 0x467e, \
|
||||
{ 0x92, 0x56, 0x58, 0xff, 0x07, 0x1b, 0xc2, 0x96 } }
|
||||
{ 0x6c05ae9d, 0x4ad1, 0x4e92, \
|
||||
{ 0x9c, 0x95, 0xd3, 0x54, 0xea, 0x0f, 0xb9, 0x48 } }
|
||||
|
||||
class nsPIDOMWindow : public nsIDOMWindowInternal
|
||||
{
|
||||
|
@ -579,12 +579,6 @@ public:
|
|||
*/
|
||||
PRUint64 WindowID() const { return mWindowID; }
|
||||
|
||||
/**
|
||||
* Dispatch a custom event with name aEventName targeted at this window.
|
||||
* Returns whether the default action should be performed.
|
||||
*/
|
||||
virtual PRBool DispatchCustomEvent(const char *aEventName) = 0;
|
||||
|
||||
protected:
|
||||
// The nsPIDOMWindow constructor. The aOuterWindow argument should
|
||||
// be null if and only if the created window itself is an outer
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
|
@ -75,11 +75,38 @@ nsAutoWindowStateHelper::~nsAutoWindowStateHelper()
|
|||
PRBool
|
||||
nsAutoWindowStateHelper::DispatchCustomEvent(const char *aEventName)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(mWindow);
|
||||
if (!window) {
|
||||
if (!mWindow) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
return window->DispatchCustomEvent(aEventName);
|
||||
#ifdef DEBUG
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mWindow));
|
||||
}
|
||||
#endif
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> domdoc;
|
||||
mWindow->GetDocument(getter_AddRefs(domdoc));
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
|
||||
PRBool defaultActionEnabled = PR_TRUE;
|
||||
|
||||
if (domdoc) {
|
||||
domdoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
if (privateEvent) {
|
||||
event->InitEvent(NS_ConvertASCIItoUTF16(aEventName), PR_TRUE, PR_TRUE);
|
||||
|
||||
privateEvent->SetTrusted(PR_TRUE);
|
||||
|
||||
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mWindow));
|
||||
|
||||
target->DispatchEvent(event, &defaultActionEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
return defaultActionEnabled;
|
||||
}
|
||||
|
||||
|
|
|
@ -381,16 +381,13 @@ nsWebShellWindow::HandleEvent(nsGUIEvent *aEvent)
|
|||
eventWindow->SetPersistenceTimer(PAD_MISC);
|
||||
result = nsEventStatus_eConsumeDoDefault;
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> ourWindow = do_GetInterface(docShell);
|
||||
if (ourWindow) {
|
||||
// Let the application know if it's in fullscreen mode so it
|
||||
// can update its UI.
|
||||
if (modeEvent->mSizeMode == nsSizeMode_Fullscreen) {
|
||||
// min, max, and normal are all the same to apps, but for
|
||||
// fullscreen we need to let them know so they can update
|
||||
// their ui.
|
||||
if (modeEvent->mSizeMode == nsSizeMode_Fullscreen) {
|
||||
nsCOMPtr<nsIDOMWindowInternal> ourWindow = do_GetInterface(docShell);
|
||||
if (ourWindow)
|
||||
ourWindow->SetFullScreen(PR_TRUE);
|
||||
}
|
||||
|
||||
// And always fire a user-defined sizemodechange event on the window
|
||||
ourWindow->DispatchCustomEvent("sizemodechange");
|
||||
}
|
||||
|
||||
// Note the current implementation of SetSizeMode just stores
|
||||
|
|
Загрузка…
Ссылка в новой задаче