Bug 404881. Accessible tree for role=log table not updated for td's without aria-live set, r=surkov, a=dsicore

This commit is contained in:
aaronleventhal@moonset.net 2008-01-28 19:56:06 -08:00
Родитель b1b4357e04
Коммит 0fb847ce8c
2 изменённых файлов: 64 добавлений и 59 удалений

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

@ -1418,45 +1418,50 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
nsIAccessibleRole::ROLE_EQUATION);
}
} else if (!newAcc) { // HTML accessibles
PRBool tryTagNameOrFrame = PR_TRUE;
if (!content->IsFocusable()) {
// If we're in unfocusable table-related subcontent, check for the
// Presentation role on the containing table
if (frame->GetType() == nsAccessibilityAtoms::tableCaptionFrame ||
frame->GetType() == nsAccessibilityAtoms::tableCellFrame ||
frame->GetType() == nsAccessibilityAtoms::tableRowGroupFrame ||
frame->GetType() == nsAccessibilityAtoms::tableRowFrame) {
nsIAtom *frameType = frame->GetType();
if (!roleMapEntry &&
(frameType == nsAccessibilityAtoms::tableCaptionFrame ||
frameType == nsAccessibilityAtoms::tableCellFrame ||
frameType == nsAccessibilityAtoms::tableRowGroupFrame ||
frameType == nsAccessibilityAtoms::tableRowFrame)) {
// Table-related frames don't get table-related roles
// unless they are inside a table, but they may still get generic
// accessibles
nsIContent *tableContent = content;
while ((tableContent = tableContent->GetParent()) != nsnull) {
nsIFrame *tableFrame = aPresShell->GetPrimaryFrameFor(tableContent);
if (tableFrame &&
tableFrame->GetType() == nsAccessibilityAtoms::tableOuterFrame) {
if (!tableFrame)
continue;
if (tableFrame->GetType() == nsAccessibilityAtoms::tableOuterFrame) {
nsCOMPtr<nsIDOMNode> tableNode(do_QueryInterface(tableContent));
if (tableNode) {
nsRoleMapEntry *tableRoleMapEntry =
nsAccUtils::GetRoleMapEntry(tableNode);
if (tableRoleMapEntry &&
tableRoleMapEntry != &nsARIAMap::gLandmarkRoleMap)
tryTagNameOrFrame = PR_FALSE;
nsCOMPtr<nsIAccessible> tableAccessible;
GetAccessibleInShell(tableNode, aPresShell, getter_AddRefs(tableAccessible));
if (!tableAccessible && !content->IsFocusable()) {
#ifdef DEBUG
nsRoleMapEntry *tableRoleMapEntry = nsAccUtils::GetRoleMapEntry(tableNode);
NS_ASSERTION(roleMapEntry && !nsCRT::strcmp(roleMapEntry->roleString, "presentation"),
"No accessible for parent table and it didn't have role of presentation");
#endif
// Table-related descendants of presentation table are also presentation
// Don't create accessibles for them unless they need to fire focus events
return NS_OK;
}
if (nsAccessible::Role(tableAccessible) != nsIAccessibleRole::ROLE_TABLE) {
NS_ASSERTION(!roleMapEntry, "Should not be changing ARIA role, just overriding impl class role");
roleMapEntry = &nsARIAMap::gLandmarkRoleMap; // Not in table: override role (roleMap entry was null)
}
break;
}
if (tableContent->Tag() == nsAccessibilityAtoms::table) {
tryTagNameOrFrame = PR_FALSE;
else if (tableFrame->GetType() == nsAccessibilityAtoms::tableCellFrame) {
// Stop before we are fooled by any additional table ancestors
// This table cell frameis part of a separate ancestor table.
NS_ASSERTION(!roleMapEntry, "Should not be changing ARIA role, just overriding impl class role");
roleMapEntry = &nsARIAMap::gLandmarkRoleMap; // Not in table: override role
break;
}
}
if (!tableContent)
tryTagNameOrFrame = PR_FALSE;
}
}
if (tryTagNameOrFrame) {
// Prefer to use markup (mostly tag name, perhaps attributes) to
// decide if and what kind of accessible to create.
// The method creates accessibles for table related content too therefore
@ -1483,7 +1488,6 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
frame->GetAccessible(getter_AddRefs(newAcc)); // Try using frame to do it
}
}
}
if (!newAcc) {
GetAccessibleForDeckChildren(aNode, getter_AddRefs(newAcc));

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

@ -1986,10 +1986,11 @@ NS_IMETHODIMP nsAccessible::GetFinalRole(PRUint32 *aRole)
}
}
if (*aRole != nsIAccessibleRole::ROLE_NOTHING) {
// We can now expose ROLE_NOTHING when there is a role map entry, which will
// cause ATK to use ROLE_UNKNOWN and MSAA to use a BSTR role with the ARIA role or element's tag.
// In either case the AT can also use the object attributes tag and xml-roles to find out more.
return NS_OK;
}
}
return mDOMNode ? GetRole(aRole) : NS_ERROR_FAILURE; // Node already shut down
}