зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1260237 - remove InvalidateChildren, r=yzen
This commit is contained in:
Родитель
35d213f532
Коммит
7e614aef9d
|
@ -264,10 +264,8 @@ EventQueue::CoalesceReorderEvents(AccEvent* aTailEvent)
|
|||
AccReorderEvent* tailReorder = downcast_accEvent(aTailEvent);
|
||||
uint32_t eventType = tailReorder->IsShowHideEventTarget(thisParent);
|
||||
|
||||
// Sometimes InvalidateChildren() and
|
||||
// DocAccessible::CacheChildrenInSubtree() can conspire to reparent an
|
||||
// accessible in this case no need for mutation events. Se bug 883708
|
||||
// for details.
|
||||
// It can be either hide or show events which may occur because of
|
||||
// accessible reparenting.
|
||||
if (eventType == nsIAccessibleEvent::EVENT_SHOW ||
|
||||
eventType == nsIAccessibleEvent::EVENT_HIDE) {
|
||||
AccReorderEvent* thisReorder = downcast_accEvent(thisEvent);
|
||||
|
|
|
@ -1881,7 +1881,14 @@ Accessible::Shutdown()
|
|||
// other accessibles, also make sure none of its children point to this parent
|
||||
mStateFlags |= eIsDefunct;
|
||||
|
||||
InvalidateChildren();
|
||||
int32_t childCount = mChildren.Length();
|
||||
for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
mChildren.ElementAt(childIdx)->UnbindFromParent();
|
||||
}
|
||||
mChildren.Clear();
|
||||
|
||||
mEmbeddedObjCollector = nullptr;
|
||||
|
||||
if (mParent)
|
||||
mParent->RemoveChild(this);
|
||||
|
||||
|
@ -2069,19 +2076,6 @@ Accessible::Language(nsAString& aLanguage)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Accessible::InvalidateChildren()
|
||||
{
|
||||
int32_t childCount = mChildren.Length();
|
||||
for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
mChildren.ElementAt(childIdx)->UnbindFromParent();
|
||||
}
|
||||
|
||||
mEmbeddedObjCollector = nullptr;
|
||||
mChildren.Clear();
|
||||
SetChildrenFlag(eChildrenUninitialized);
|
||||
}
|
||||
|
||||
bool
|
||||
Accessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
|
||||
{
|
||||
|
|
|
@ -380,14 +380,6 @@ public:
|
|||
*/
|
||||
void EnsureChildren();
|
||||
|
||||
/**
|
||||
* Set the child count to -1 (unknown) and null out cached child pointers.
|
||||
* Should be called when accessible tree is changed because document has
|
||||
* transformed. Note, if accessible cares about its parent relation chain
|
||||
* itself should override this method to do nothing.
|
||||
*/
|
||||
virtual void InvalidateChildren();
|
||||
|
||||
/**
|
||||
* Append/insert/remove a child. Return true if operation was successful.
|
||||
*/
|
||||
|
|
|
@ -149,13 +149,6 @@ ApplicationAccessible::NativeState()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
ApplicationAccessible::InvalidateChildren()
|
||||
{
|
||||
// Do nothing because application children are kept updated by AppendChild()
|
||||
// and RemoveChild() method calls.
|
||||
}
|
||||
|
||||
KeyBinding
|
||||
ApplicationAccessible::AccessKey() const
|
||||
{
|
||||
|
|
|
@ -52,8 +52,6 @@ public:
|
|||
EWhichChildAtPoint aWhichChild) override;
|
||||
virtual Accessible* FocusedChild() override;
|
||||
|
||||
virtual void InvalidateChildren() override;
|
||||
|
||||
// ActionAccessible
|
||||
virtual KeyBinding AccessKey() const override;
|
||||
|
||||
|
|
|
@ -1889,11 +1889,10 @@ HyperTextAccessible::NativeName(nsString& aName)
|
|||
}
|
||||
|
||||
void
|
||||
HyperTextAccessible::InvalidateChildren()
|
||||
HyperTextAccessible::Shutdown()
|
||||
{
|
||||
mOffsets.Clear();
|
||||
|
||||
AccessibleWrap::InvalidateChildren();
|
||||
AccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
virtual mozilla::a11y::role NativeRole() override;
|
||||
virtual uint64_t NativeState() override;
|
||||
|
||||
virtual void InvalidateChildren() override;
|
||||
virtual void Shutdown() override;
|
||||
virtual bool RemoveChild(Accessible* aAccessible) override;
|
||||
virtual Relation RelationByType(RelationType aType) override;
|
||||
|
||||
|
|
|
@ -101,21 +101,6 @@ OuterDocAccessible::Shutdown()
|
|||
AccessibleWrap::Shutdown();
|
||||
}
|
||||
|
||||
void
|
||||
OuterDocAccessible::InvalidateChildren()
|
||||
{
|
||||
// Do not invalidate children because DocManager is responsible for
|
||||
// document accessible lifetime when DOM document is created or destroyed. If
|
||||
// DOM document isn't destroyed but its presshell is destroyed (for example,
|
||||
// when DOM node of outerdoc accessible is hidden), then outerdoc accessible
|
||||
// notifies DocManager about this. If presshell is created for existing
|
||||
// DOM document (for example when DOM node of outerdoc accessible is shown)
|
||||
// then allow DocManager to handle this case since the document
|
||||
// accessible is created and appended as a child when it's requested.
|
||||
|
||||
SetChildrenFlag(eChildrenUninitialized);
|
||||
}
|
||||
|
||||
bool
|
||||
OuterDocAccessible::InsertChildAt(uint32_t aIdx, Accessible* aAccessible)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,6 @@ public:
|
|||
virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
|
||||
EWhichChildAtPoint aWhichChild) override;
|
||||
|
||||
virtual void InvalidateChildren() override;
|
||||
virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
|
||||
virtual bool RemoveChild(Accessible* aAccessible) override;
|
||||
|
||||
|
|
|
@ -348,15 +348,6 @@ HTMLComboboxAccessible::NativeRole()
|
|||
return roles::COMBOBOX;
|
||||
}
|
||||
|
||||
void
|
||||
HTMLComboboxAccessible::InvalidateChildren()
|
||||
{
|
||||
AccessibleWrap::InvalidateChildren();
|
||||
|
||||
if (mListAccessible)
|
||||
mListAccessible->InvalidateChildren();
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLComboboxAccessible::RemoveChild(Accessible* aChild)
|
||||
{
|
||||
|
@ -397,7 +388,10 @@ void
|
|||
HTMLComboboxAccessible::Shutdown()
|
||||
{
|
||||
MOZ_ASSERT(mDoc->IsDefunct() || !mListAccessible);
|
||||
mListAccessible = nullptr;
|
||||
if (mListAccessible) {
|
||||
mListAccessible->Shutdown();
|
||||
mListAccessible = nullptr;
|
||||
}
|
||||
|
||||
AccessibleWrap::Shutdown();
|
||||
}
|
||||
|
|
|
@ -168,7 +168,6 @@ public:
|
|||
virtual void Value(nsString& aValue) override;
|
||||
virtual a11y::role NativeRole() override;
|
||||
virtual uint64_t NativeState() override;
|
||||
virtual void InvalidateChildren() override;
|
||||
virtual bool RemoveChild(Accessible* aChild) override;
|
||||
|
||||
// ActionAccessible
|
||||
|
|
|
@ -46,7 +46,6 @@ public: // construction, destruction
|
|||
virtual Class GetNativeType ();
|
||||
|
||||
virtual void Shutdown () override;
|
||||
virtual void InvalidateChildren() override;
|
||||
|
||||
virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
|
||||
virtual bool RemoveChild(Accessible* aAccessible) override;
|
||||
|
|
|
@ -135,18 +135,6 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
void
|
||||
AccessibleWrap::InvalidateChildren()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
[GetNativeObject() invalidateChildren];
|
||||
|
||||
Accessible::InvalidateChildren();
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
bool
|
||||
AccessibleWrap::InsertChildAt(uint32_t aIdx, Accessible* aAccessible)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче