mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1053765 - Putting role=log on a table tag breaks row and cell accessibles, r=tbsaunde
This commit is contained in:
parent
fcb6f98d56
commit
ef0231619d
@ -972,10 +972,10 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
|
||||
// If table has strong ARIA role then all table descendants shouldn't
|
||||
// expose their native roles.
|
||||
if (!roleMapEntry && newAcc) {
|
||||
if (!roleMapEntry && newAcc && aContext->HasStrongARIARole()) {
|
||||
if (frame->AccessibleType() == eHTMLTableRowType) {
|
||||
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
|
||||
if (contextRoleMap && !(contextRoleMap->IsOfType(eTable)))
|
||||
if (!contextRoleMap->IsOfType(eTable))
|
||||
roleMapEntry = &aria::gEmptyRoleMap;
|
||||
|
||||
} else if (frame->AccessibleType() == eHTMLTableCellType &&
|
||||
@ -987,7 +987,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
|
||||
content->Tag() == nsGkAtoms::dd ||
|
||||
frame->AccessibleType() == eHTMLLiType) {
|
||||
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
|
||||
if (contextRoleMap && !(contextRoleMap->IsOfType(eList)))
|
||||
if (!contextRoleMap->IsOfType(eList))
|
||||
roleMapEntry = &aria::gEmptyRoleMap;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,12 @@ Accessible::IsARIARole(nsIAtom* aARIARole) const
|
||||
return mRoleMapEntry && mRoleMapEntry->Is(aARIARole);
|
||||
}
|
||||
|
||||
inline bool
|
||||
Accessible::HasStrongARIARole() const
|
||||
{
|
||||
return mRoleMapEntry && mRoleMapEntry->roleRule == kUseMapRole;
|
||||
}
|
||||
|
||||
inline mozilla::a11y::role
|
||||
Accessible::ARIARole()
|
||||
{
|
||||
|
@ -219,6 +219,7 @@ public:
|
||||
*/
|
||||
bool HasARIARole() const { return mRoleMapEntry; }
|
||||
bool IsARIARole(nsIAtom* aARIARole) const;
|
||||
bool HasStrongARIARole() const;
|
||||
|
||||
/**
|
||||
* Retrun ARIA role map if any.
|
||||
|
@ -162,6 +162,18 @@
|
||||
};
|
||||
testAccessibleTree("table5", accTree);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// log table
|
||||
accTree =
|
||||
{ TABLE: [
|
||||
{ ROW: [
|
||||
{ CELL: [
|
||||
{ TEXT_LEAF: [ ] }
|
||||
] }
|
||||
] }
|
||||
] };
|
||||
testAccessibleTree("logtable", accTree);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -264,5 +276,7 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="logtable" role="log"><tr><td>blah</td></tr></table>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user