Backed out changeset d917c7a63b14
This commit is contained in:
@@ -579,49 +579,6 @@ nsFocusController::ResetElementFocus()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
inline PRBool
|
||||
ElementMayBeDisconnected(nsIDOMElement* aElement,
|
||||
nsPIDOMWindow* aWindow)
|
||||
{
|
||||
if (!aElement) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINode> node(do_QueryInterface(aElement));
|
||||
NS_ASSERTION(node, "This shouldn't fail!");
|
||||
|
||||
nsIDocument* doc = node->GetOwnerDoc();
|
||||
if (doc) {
|
||||
nsPIDOMWindow* win = doc->GetWindow();
|
||||
if (win && win != aWindow) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFocusController::Disconnect(nsPIDOMWindow* aWindow)
|
||||
{
|
||||
aWindow = aWindow->GetOuterWindow();
|
||||
|
||||
if (aWindow == mCurrentWindow) {
|
||||
mCurrentWindow = nsnull;
|
||||
if (ElementMayBeDisconnected(mCurrentElement, aWindow)) {
|
||||
mCurrentElement = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
if (aWindow == mPreviousWindow) {
|
||||
mPreviousWindow = nsnull;
|
||||
if (ElementMayBeDisconnected(mPreviousElement, aWindow)) {
|
||||
mPreviousElement = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsFocusController::UpdateWWActiveWindow()
|
||||
{
|
||||
|
||||
@@ -95,8 +95,6 @@ public:
|
||||
|
||||
NS_IMETHOD ResetElementFocus();
|
||||
|
||||
NS_IMETHOD Disconnect(nsPIDOMWindow* aWindow);
|
||||
|
||||
// nsIDOMFocusListener
|
||||
NS_IMETHOD Focus(nsIDOMEvent* aEvent);
|
||||
NS_IMETHOD Blur(nsIDOMEvent* aEvent);
|
||||
|
||||
@@ -925,11 +925,6 @@ nsGlobalWindow::FreeInnerObjects(PRBool aClearScope)
|
||||
|
||||
ClearAllTimeouts();
|
||||
|
||||
nsIFocusController* focusController = GetRootFocusController();
|
||||
if (focusController) {
|
||||
focusController->Disconnect(this);
|
||||
}
|
||||
|
||||
mChromeEventHandler = nsnull;
|
||||
|
||||
if (mListenerManager) {
|
||||
@@ -6552,6 +6547,7 @@ nsGlobalWindow::GetPrivateRoot()
|
||||
GetTop(getter_AddRefs(top));
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> ptop = do_QueryInterface(top);
|
||||
NS_ASSERTION(ptop, "cannot get ptop");
|
||||
if (!ptop)
|
||||
return nsnull;
|
||||
|
||||
|
||||
@@ -50,13 +50,12 @@ class nsIDOMNode;
|
||||
class nsIDOMWindowInternal;
|
||||
class nsIController;
|
||||
class nsIControllers;
|
||||
class nsPIDOMWindow;
|
||||
class nsAString;
|
||||
|
||||
// 3ce5735f-3b4f-41da-8426-564d4bd8ff23
|
||||
// 58be9aa6-edec-46be-a9f5-6d8b572418d5
|
||||
#define NS_IFOCUSCONTROLLER_IID \
|
||||
{ 0x3ce5735f, 0x3b4f, 0x41da, \
|
||||
{ 0x84, 0x26, 0x56, 0x4d, 0x4b, 0xd8, 0xff, 0x23 } }
|
||||
{ 0x58be9aa6, 0xedec, 0x46be, \
|
||||
{ 0xa9, 0xf5, 0x6d, 0x8b, 0x57, 0x24, 0x18, 0xd5 } }
|
||||
|
||||
class nsIFocusController : public nsISupports {
|
||||
public:
|
||||
@@ -87,8 +86,6 @@ public:
|
||||
NS_IMETHOD RewindFocusState()=0;
|
||||
|
||||
NS_IMETHOD ResetElementFocus() = 0;
|
||||
|
||||
NS_IMETHOD Disconnect(nsPIDOMWindow* aWindow) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFocusController, NS_IFOCUSCONTROLLER_IID)
|
||||
|
||||
Reference in New Issue
Block a user