Bug 727722 - Create an accessible for HTML table row by frame, r=tbsaunde, roc, surkov

This commit is contained in:
Michał Frontczak 2012-04-25 12:06:21 +09:00
Родитель 2414ef63bc
Коммит cb5273c12a
5 изменённых файлов: 53 добавлений и 7 удалений

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

@ -426,6 +426,16 @@ nsAccessibilityService::CreateHTMLTableCellAccessible(nsIContent* aContent,
return accessible;
}
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTableRowAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
{
nsAccessible* accessible =
new nsEnumRoleAccessible(aContent, GetDocAccessible(aPresShell), roles::ROW);
NS_ADDREF(accessible);
return accessible;
}
already_AddRefed<nsAccessible>
nsAccessibilityService::CreateHTMLTextAccessible(nsIContent* aContent,
nsIPresShell* aPresShell)
@ -1684,13 +1694,6 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
return accessible;
}
if (tag == nsGkAtoms::tr) {
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
roles::ROW);
NS_IF_ADDREF(accessible);
return accessible;
}
if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
aDoc);

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

@ -131,6 +131,8 @@ public:
CreateHTMLTableAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
already_AddRefed<nsAccessible>
CreateHTMLTableCellAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
already_AddRefed<nsAccessible>
CreateHTMLTableRowAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
already_AddRefed<nsAccessible>
CreateHTMLTextAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
already_AddRefed<nsAccessible>

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

@ -128,6 +128,17 @@
testAccessibleTree("table3", accTree);
/////////////////////////////////////////////////////////////////////////
// table4 (display: table-row)
accTree =
{ TABLE: [
{ ROW: [
{ CELL: [
{ TEXT_LEAF: [ ] }
] }
] } ]
};
testAccessibleTree("table4", accTree);
SimpleTest.finish();
}
@ -142,6 +153,11 @@
href="https://bugzilla.mozilla.org/show_bug.cgi?id=529621">
Mozilla Bug 529621
</a>
<a target="_blank"
title="when div has display style table-row"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=727722">
Mozilla Bug 727722
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
@ -189,5 +205,11 @@
<td>cell</td>
</tr>
</table>
<table id="table4">
<div style="display: table-row">
<td>cell1</td>
</div>
</table>
</body>
</html>

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

@ -50,6 +50,9 @@
#include "nsTableColFrame.h"
#include "nsCOMPtr.h"
#include "nsDisplayList.h"
#ifdef ACCESSIBILITY
#include "nsAccessibilityService.h"
#endif
using namespace mozilla;
@ -1346,7 +1349,19 @@ void nsTableRowFrame::SetContinuousBCBorderWidth(PRUint8 aForSide,
NS_ERROR("invalid NS_SIDE arg");
}
}
#ifdef ACCESSIBILITY
already_AddRefed<nsAccessible>
nsTableRowFrame::CreateAccessible()
{
nsAccessibilityService* accService = nsIPresShell::AccService();
if (accService) {
return accService->CreateHTMLTableRowAccessible(mContent,
PresContext()->PresShell());
}
return nsnull;
}
#endif
/**
* Sets the NS_ROW_HAS_CELL_WITH_STYLE_HEIGHT bit to indicate whether
* this row has any cells that have non-auto-height. (Row-spanning

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

@ -255,6 +255,10 @@ public:
void SetContinuousBCBorderWidth(PRUint8 aForSide,
BCPixelSize aPixelValue);
#ifdef ACCESSIBILITY
virtual already_AddRefed<nsAccessible> CreateAccessible();
#endif
protected:
/** protected constructor.