void nsHTMLTableAccessible::CacheChildren() { // 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. nsAccTreeWalker walker(mWeakShell, mContent, GetAllowsAnonChildAccessibles()); nsRefPtr<nsAccessible> child; while ((child = walker.GetNextChild())) { if (nsAccUtils::Role(child) == nsIAccessibleRole::ROLE_CAPTION) { InsertChildAt(0, child); while ((child = walker.GetNextChild()) && AppendChild(child)); break; } AppendChild(child); } }
void nsHTMLLIAccessible::UpdateBullet(bool aHasBullet) { if (aHasBullet == !!mBullet) { NS_NOTREACHED("Bullet and accessible are in sync already!"); return; } nsDocAccessible* document = GetDocAccessible(); if (aHasBullet) { mBullet = new nsHTMLListBulletAccessible(mContent, mWeakShell); if (document->BindToDocument(mBullet, nsnull)) { InsertChildAt(0, mBullet); } } else { RemoveChild(mBullet); document->UnbindFromDocument(mBullet); mBullet = nsnull; } // XXXtodo: fire show/hide and reorder events. That's hard to make it // right now because coalescence happens by DOM node. }