зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1234121 - FocusManager focused proxy cleared on hide event (Part 2) r=tbsaunde
This commit is contained in:
Родитель
4c94b38c77
Коммит
edd5ded287
|
@ -5,6 +5,7 @@
|
|||
#ifndef mozilla_a11y_FocusManager_h_
|
||||
#define mozilla_a11y_FocusManager_h_
|
||||
|
||||
#include "mozilla/a11y/Accessible.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
class nsINode;
|
||||
|
@ -15,7 +16,6 @@ namespace mozilla {
|
|||
namespace a11y {
|
||||
|
||||
class AccEvent;
|
||||
class Accessible;
|
||||
class ProxyAccessible;
|
||||
class DocAccessible;
|
||||
|
||||
|
@ -37,6 +37,14 @@ public:
|
|||
*/
|
||||
ProxyAccessible* FocusedRemoteAccessible() const { return mFocusedProxy; }
|
||||
|
||||
/**
|
||||
* Set focused accessible to null.
|
||||
*/
|
||||
void ResetFocusedAccessible()
|
||||
{
|
||||
mFocusedAcc = nullptr;
|
||||
mFocusedProxy = nullptr;
|
||||
}
|
||||
/**
|
||||
* Return true if given accessible is focused.
|
||||
*/
|
||||
|
|
|
@ -1896,6 +1896,11 @@ Accessible::Shutdown()
|
|||
mDoc = nullptr;
|
||||
if (SelectionMgr() && SelectionMgr()->AccessibleWithCaret(nullptr) == this)
|
||||
SelectionMgr()->ResetCaretOffset();
|
||||
|
||||
if (FocusMgr()->IsFocused(this)) {
|
||||
FocusMgr()->ResetFocusedAccessible();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Accessible protected
|
||||
|
|
|
@ -43,6 +43,10 @@ ProxyAccessible::Shutdown()
|
|||
mChildren[0]->AsDoc()->Unbind();
|
||||
}
|
||||
|
||||
if (FocusMgr()->FocusedRemoteAccessible() == this) {
|
||||
FocusMgr()->ResetFocusedAccessible();
|
||||
}
|
||||
|
||||
mChildren.Clear();
|
||||
ProxyDestroyed(this);
|
||||
mDoc->RemoveAccessible(this);
|
||||
|
|
Загрузка…
Ссылка в новой задаче