Bug 1252260 - get rid of HTML table CacheChildren, r=marcoz

This commit is contained in:
Alexander Surkov
2016-03-01 10:54:49 -05:00
parent f5a667ea0e
commit 4dfc69aed7
5 changed files with 89 additions and 15 deletions

View File

@@ -393,24 +393,14 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableAccessible, Accessible)
////////////////////////////////////////////////////////////////////////////////
// HTMLTableAccessible: Accessible
void
HTMLTableAccessible::CacheChildren()
bool
HTMLTableAccessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
{
// Move caption accessible so that it's the first child. Check for the first
// caption only, because nsAccessibilityService ensures we don't create
// accessibles for the other captions, since only the first is actually
// visible.
TreeWalker walker(this, mContent);
Accessible* child = nullptr;
while ((child = walker.Next())) {
if (child->Role() == roles::CAPTION) {
InsertChildAt(0, child);
while ((child = walker.Next()) && AppendChild(child));
break;
}
AppendChild(child);
}
return Accessible::InsertChildAt(aChild->IsHTMLCaption() ? 0 : aIndex, aChild);
}
role