зеркало из https://github.com/mozilla/pjs.git
Bug 409009 Table cells should have a table in their ancestry, r=evan.yan, a=beltzner
This commit is contained in:
Родитель
6d703efb5a
Коммит
f8578883fe
|
@ -82,6 +82,8 @@ ACCESSIBILITY_ATOM(textFrame, "TextFrame")
|
|||
ACCESSIBILITY_ATOM(tableCaptionFrame, "TableCaptionFrame")
|
||||
ACCESSIBILITY_ATOM(tableCellFrame, "TableCellFrame")
|
||||
ACCESSIBILITY_ATOM(tableOuterFrame, "TableOuterFrame")
|
||||
ACCESSIBILITY_ATOM(tableRowGroupFrame, "TableRowGroupFrame")
|
||||
ACCESSIBILITY_ATOM(tableRowFrame, "TableRowFrame")
|
||||
|
||||
// Alphabetical list of tag names
|
||||
ACCESSIBILITY_ATOM(a, "a")
|
||||
|
|
|
@ -1395,17 +1395,16 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
|||
if (!content->IsFocusable()) {
|
||||
// If we're in unfocusable table-related subcontent, check for the
|
||||
// Presentation role on the containing table
|
||||
nsIAtom *tag = content->Tag();
|
||||
if (tag == nsAccessibilityAtoms::td ||
|
||||
tag == nsAccessibilityAtoms::th ||
|
||||
tag == nsAccessibilityAtoms::tr ||
|
||||
tag == nsAccessibilityAtoms::tbody ||
|
||||
tag == nsAccessibilityAtoms::tfoot ||
|
||||
tag == nsAccessibilityAtoms::thead) {
|
||||
if (frame->GetType() == nsAccessibilityAtoms::tableCaptionFrame ||
|
||||
frame->GetType() == nsAccessibilityAtoms::tableCellFrame ||
|
||||
frame->GetType() == nsAccessibilityAtoms::tableRowGroupFrame ||
|
||||
frame->GetType() == nsAccessibilityAtoms::tableRowFrame) {
|
||||
|
||||
nsIContent *tableContent = content;
|
||||
nsAutoString tableRole;
|
||||
while ((tableContent = tableContent->GetParent()) != nsnull) {
|
||||
if (tableContent->Tag() == nsAccessibilityAtoms::table) {
|
||||
nsIFrame *tableFrame = aPresShell->GetPrimaryFrameFor(tableContent);
|
||||
if (tableFrame &&
|
||||
tableFrame->GetType() == nsAccessibilityAtoms::tableOuterFrame) {
|
||||
// Table that we're a descendant of is not styled as a table,
|
||||
// and has no table accessible for an ancestor, or
|
||||
// table that we're a descendant of is presentational
|
||||
|
@ -1415,21 +1414,20 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
|||
nsRoleMapEntry *tableRoleMapEntry =
|
||||
nsAccUtils::GetRoleMapEntry(tableNode);
|
||||
if (tableRoleMapEntry &&
|
||||
tableRoleMapEntry != &nsARIAMap::gLandmarkRoleMap) {
|
||||
tableRoleMapEntry != &nsARIAMap::gLandmarkRoleMap)
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame *tableFrame =
|
||||
aPresShell->GetPrimaryFrameFor(tableContent);
|
||||
if (!tableFrame ||
|
||||
tableFrame->GetType() != nsAccessibilityAtoms::tableOuterFrame) {
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (tableContent->Tag() == nsAccessibilityAtoms::table) {
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!tableContent)
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче