Bug 834120 - Table cell accessibles not exposed for CSS table without table-row, r=tbsaunde

This commit is contained in:
Alexander Surkov 2013-02-16 14:42:00 +09:00
parent 6743609509
commit ffad930fa8
5 changed files with 35 additions and 14 deletions

View File

@ -1422,8 +1422,10 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
newAcc = new HTMLTableAccessibleWrap(aContent, document);
break;
case eHTMLTableCellType:
// Accessible HTML table cell must be a child of accessible HTML table row.
if (aContext->IsHTMLTableRow())
// Accessible HTML table cell should be a child of accessible HTML table
// or its row (CSS HTML tables are polite to the used markup at
// certain degree).
if (aContext->IsHTMLTableRow() || aContext->IsHTMLTable())
newAcc = new HTMLTableCellAccessibleWrap(aContent, document);
break;

View File

@ -487,6 +487,7 @@ public:
bool IsHTMLListItem() const { return mType == eHTMLLiType; }
HTMLLIAccessible* AsHTMLListItem();
bool IsHTMLTable() const { return mType == eHTMLTableType; }
bool IsHTMLTableRow() const { return mType == eHTMLTableRowType; }
bool IsImage() const { return mType == eImageType; }

View File

@ -343,16 +343,6 @@ HTMLTableRowAccessible::NativeRole()
// HTMLTableAccessible
////////////////////////////////////////////////////////////////////////////////
HTMLTableAccessible::
HTMLTableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
{
mGenericTypes |= eTable;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLTableAccessible: nsISupports implementation
NS_IMPL_ISUPPORTS_INHERITED1(HTMLTableAccessible, Accessible,
nsIAccessibleTable)

View File

@ -121,7 +121,12 @@ class HTMLTableAccessible : public AccessibleWrap,
public TableAccessible
{
public:
HTMLTableAccessible(nsIContent* aContent, DocAccessible* aDoc);
HTMLTableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
{
mType = eHTMLTableType;
mGenericTypes |= eTable;
}
NS_DECL_ISUPPORTS_INHERITED

View File

@ -128,6 +128,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
];
testTableIndexes("tableinsane6", idxes);
//////////////////////////////////////////////////////////////////////////
// csstablecrazy1 (no rows)
idxes = [
[0, 1]
];
testTableIndexes("csstablecrazy1", idxes);
SimpleTest.finish();
}
@ -137,7 +145,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
<a target="_blank"
title="GetIndexAt and GetRowAtIndex and GetColumnAtIndex on HTML tables are inconsistent"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">
Bug 410052
</a>
<a target="_blank"
title="Table cell accessibles not exposed for CSS table without table-row "
href="https://bugzilla.mozilla.org/show_bug.cgi?id=834120">
Bug 834120
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -402,5 +419,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=410052
</tbody>
</table>
<div id="csstablecrazy1"
style="width: 100%; border: 1px solid red; display:table;">
<div style="display:table-cell;">cell1</div>
<div style="display:table-cell;">cell2</div>
</div>
</body>
</html>