bug 920738 - don't unbind accessibles in XULTextFieldAccessible::CacheChildren() r=surkov

This commit is contained in:
Trevor Saunders 2013-09-25 16:30:00 -04:00
parent 2a773817b4
commit 522186108b
2 changed files with 12 additions and 10 deletions

View File

@ -768,6 +768,15 @@ XULTextFieldAccessible::CanHaveAnonChildren()
return false;
}
bool
XULTextFieldAccessible::IsAcceptableChild(Accessible* aPossibleChild) const
{
// XXX: entry shouldn't contain anything but text leafs. Currently it may
// contain a trailing fake HTML br element added for layout needs. We don't
// need to expose it since it'd be confusing for AT.
return aPossibleChild->IsTextLeaf();
}
already_AddRefed<nsIEditor>
XULTextFieldAccessible::GetEditor() const
{
@ -794,17 +803,9 @@ XULTextFieldAccessible::CacheChildren()
if (!inputContent)
return;
// XXX: entry shouldn't contain anything but text leafs. Currently it may
// contain a trailing fake HTML br element added for layout needs. We don't
// need to expose it since it'd be confusing for AT.
TreeWalker walker(this, inputContent);
Accessible* child = nullptr;
while ((child = walker.NextChild())) {
if (child->IsTextLeaf())
AppendChild(child);
else
Document()->UnbindFromDocument(child);
}
while (Accessible* child = walker.NextChild())
AppendChild(child);
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -240,6 +240,7 @@ public:
virtual mozilla::a11y::role NativeRole();
virtual uint64_t NativeState();
virtual bool CanHaveAnonChildren();
virtual bool IsAcceptableChild(Accessible* aPossibleChild) const MOZ_OVERRIDE;
// ActionAccessible
virtual uint8_t ActionCount();