Bug 1261167 - remove Accessible::TestChildCache, r=marcoz

This commit is contained in:
Alexander Surkov 2016-04-05 17:35:31 -04:00
Родитель 167cbebba2
Коммит c2cdfb8b81
4 изменённых файлов: 9 добавлений и 55 удалений

Просмотреть файл

@ -2519,27 +2519,6 @@ Accessible::LastRelease()
delete this;
}
void
Accessible::TestChildCache(Accessible* aCachedChild) const
{
#ifdef DEBUG
int32_t childCount = mChildren.Length();
if (childCount == 0) {
return;
}
Accessible* child = nullptr;
for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
child = mChildren[childIdx];
if (child == aCachedChild)
break;
}
NS_ASSERTION(child == aCachedChild,
"[TestChildCache] cached accessible wasn't found. Wrong accessible tree!");
#endif
}
Accessible*
Accessible::GetSiblingAtOffset(int32_t aOffset, nsresult* aError) const
{

Просмотреть файл

@ -502,12 +502,6 @@ public:
virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
uint32_t aLength = UINT32_MAX);
/**
* Assert if child not in parent's cache if the cache was initialized at this
* point.
*/
void TestChildCache(Accessible* aCachedChild) const;
/**
* Return boundaries in screen coordinates.
*/

Просмотреть файл

@ -390,33 +390,6 @@ DocAccessible::DocType(nsAString& aType) const
docType->GetPublicId(aType);
}
Accessible*
DocAccessible::GetAccessible(nsINode* aNode) const
{
Accessible* accessible = mNodeToAccessibleMap.Get(aNode);
// No accessible in the cache, check if the given ID is unique ID of this
// document accessible.
if (!accessible) {
if (GetNode() != aNode)
return nullptr;
accessible = const_cast<DocAccessible*>(this);
}
#ifdef DEBUG
// All cached accessible nodes should be in the parent
// It will assert if not all the children were created
// when they were first cached, and no invalidation
// ever corrected parent accessible's child cache.
Accessible* parent = accessible->Parent();
if (parent)
parent->TestChildCache(accessible);
#endif
return accessible;
}
////////////////////////////////////////////////////////////////////////////////
// Accessible
@ -2280,6 +2253,10 @@ DocAccessible::CacheChildrenInSubtree(Accessible* aRoot,
mt.Done();
}
#ifdef A11Y_LOG
logging::TreeInfo("cached children", logging::eVerbose, aRoot);
#endif
// Fire document load complete on ARIA documents.
// XXX: we should delay an event if the ARIA document has aria-busy.
if (aRoot->HasARIARole() && !aRoot->IsDoc()) {

Просмотреть файл

@ -228,7 +228,11 @@ public:
*
* @return the accessible object
*/
Accessible* GetAccessible(nsINode* aNode) const;
Accessible* GetAccessible(nsINode* aNode) const
{
return aNode == mDocumentNode ?
const_cast<DocAccessible*>(this) : mNodeToAccessibleMap.Get(aNode);
}
/**
* Return an accessible for the given node even if the node is not in