зеркало из https://github.com/mozilla/pjs.git
Bug 727722 - Create an accessible for HTML table row by frame, r=tbsaunde, roc, surkov
This commit is contained in:
Родитель
2414ef63bc
Коммит
cb5273c12a
|
@ -426,6 +426,16 @@ nsAccessibilityService::CreateHTMLTableCellAccessible(nsIContent* aContent,
|
||||||
return accessible;
|
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>
|
already_AddRefed<nsAccessible>
|
||||||
nsAccessibilityService::CreateHTMLTextAccessible(nsIContent* aContent,
|
nsAccessibilityService::CreateHTMLTextAccessible(nsIContent* aContent,
|
||||||
nsIPresShell* aPresShell)
|
nsIPresShell* aPresShell)
|
||||||
|
@ -1684,13 +1694,6 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
|
||||||
return accessible;
|
return accessible;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag == nsGkAtoms::tr) {
|
|
||||||
nsAccessible* accessible = new nsEnumRoleAccessible(aContent, aDoc,
|
|
||||||
roles::ROW);
|
|
||||||
NS_IF_ADDREF(accessible);
|
|
||||||
return accessible;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
|
if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
|
||||||
nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
|
nsAccessible* accessible = new nsHTMLTableHeaderCellAccessibleWrap(aContent,
|
||||||
aDoc);
|
aDoc);
|
||||||
|
|
|
@ -131,6 +131,8 @@ public:
|
||||||
CreateHTMLTableAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
CreateHTMLTableAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||||
already_AddRefed<nsAccessible>
|
already_AddRefed<nsAccessible>
|
||||||
CreateHTMLTableCellAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
CreateHTMLTableCellAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||||
|
already_AddRefed<nsAccessible>
|
||||||
|
CreateHTMLTableRowAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||||
already_AddRefed<nsAccessible>
|
already_AddRefed<nsAccessible>
|
||||||
CreateHTMLTextAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
CreateHTMLTextAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||||
already_AddRefed<nsAccessible>
|
already_AddRefed<nsAccessible>
|
||||||
|
|
|
@ -128,6 +128,17 @@
|
||||||
|
|
||||||
testAccessibleTree("table3", accTree);
|
testAccessibleTree("table3", accTree);
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
// table4 (display: table-row)
|
||||||
|
accTree =
|
||||||
|
{ TABLE: [
|
||||||
|
{ ROW: [
|
||||||
|
{ CELL: [
|
||||||
|
{ TEXT_LEAF: [ ] }
|
||||||
|
] }
|
||||||
|
] } ]
|
||||||
|
};
|
||||||
|
testAccessibleTree("table4", accTree);
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,6 +153,11 @@
|
||||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=529621">
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=529621">
|
||||||
Mozilla Bug 529621
|
Mozilla Bug 529621
|
||||||
</a>
|
</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>
|
<p id="display"></p>
|
||||||
<div id="content" style="display: none"></div>
|
<div id="content" style="display: none"></div>
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
|
@ -189,5 +205,11 @@
|
||||||
<td>cell</td>
|
<td>cell</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<table id="table4">
|
||||||
|
<div style="display: table-row">
|
||||||
|
<td>cell1</td>
|
||||||
|
</div>
|
||||||
|
</table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -50,6 +50,9 @@
|
||||||
#include "nsTableColFrame.h"
|
#include "nsTableColFrame.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsDisplayList.h"
|
#include "nsDisplayList.h"
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
#include "nsAccessibilityService.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
|
@ -1346,7 +1349,19 @@ void nsTableRowFrame::SetContinuousBCBorderWidth(PRUint8 aForSide,
|
||||||
NS_ERROR("invalid NS_SIDE arg");
|
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
|
* 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
|
* this row has any cells that have non-auto-height. (Row-spanning
|
||||||
|
|
|
@ -255,6 +255,10 @@ public:
|
||||||
void SetContinuousBCBorderWidth(PRUint8 aForSide,
|
void SetContinuousBCBorderWidth(PRUint8 aForSide,
|
||||||
BCPixelSize aPixelValue);
|
BCPixelSize aPixelValue);
|
||||||
|
|
||||||
|
#ifdef ACCESSIBILITY
|
||||||
|
virtual already_AddRefed<nsAccessible> CreateAccessible();
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/** protected constructor.
|
/** protected constructor.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче