Bug 1343537 - Implement ARIA DPUB extension. r=surkov
This commit is contained in:
@@ -697,6 +697,12 @@ getRoleCB(AtkObject *aAtkObj)
|
||||
aAtkObj->role = ATK_ROLE_LIST_ITEM;
|
||||
else if (aAtkObj->role == ATK_ROLE_MATH && !IsAtkVersionAtLeast(2, 12))
|
||||
aAtkObj->role = ATK_ROLE_SECTION;
|
||||
else if (aAtkObj->role == ATK_ROLE_COMMENT && !IsAtkVersionAtLeast(2, 12))
|
||||
aAtkObj->role = ATK_ROLE_SECTION;
|
||||
else if (aAtkObj->role == ATK_ROLE_LANDMARK && !IsAtkVersionAtLeast(2, 12))
|
||||
aAtkObj->role = ATK_ROLE_SECTION;
|
||||
else if (aAtkObj->role == ATK_ROLE_FOOTNOTE && !IsAtkVersionAtLeast(2, 25, 2))
|
||||
aAtkObj->role = ATK_ROLE_SECTION;
|
||||
else if (aAtkObj->role == ATK_ROLE_STATIC && !IsAtkVersionAtLeast(2, 16))
|
||||
aAtkObj->role = ATK_ROLE_TEXT;
|
||||
else if ((aAtkObj->role == ATK_ROLE_MATH_FRACTION ||
|
||||
|
||||
@@ -26,7 +26,7 @@ extern "C" __attribute__((weak,visibility("default"))) int atk_bridge_adaptor_in
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
int atkMajorVersion = 1, atkMinorVersion = 12;
|
||||
int atkMajorVersion = 1, atkMinorVersion = 12, atkMicroVersion = 0;
|
||||
|
||||
GType (*gAtkTableCellGetTypeFunc)();
|
||||
|
||||
@@ -168,8 +168,11 @@ a11y::PlatformInit()
|
||||
if (version) {
|
||||
char* endPtr = nullptr;
|
||||
atkMajorVersion = strtol(version, &endPtr, 10);
|
||||
if (*endPtr == '.')
|
||||
if (atkMajorVersion != 0L) {
|
||||
atkMinorVersion = strtol(endPtr + 1, &endPtr, 10);
|
||||
if (atkMinorVersion != 0L)
|
||||
atkMicroVersion = strtol(endPtr + 1, &endPtr, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,17 +75,19 @@ mozilla::a11y::AccessibleOrProxy GetInternalObj(AtkObject* aObj);
|
||||
AtkObject* GetWrapperFor(mozilla::a11y::ProxyAccessible* aProxy);
|
||||
AtkObject* GetWrapperFor(mozilla::a11y::AccessibleOrProxy aObj);
|
||||
|
||||
extern int atkMajorVersion, atkMinorVersion;
|
||||
extern int atkMajorVersion, atkMinorVersion, atkMicroVersion;
|
||||
|
||||
/**
|
||||
* Return true if the loaded version of libatk-1.0.so is at least
|
||||
* aMajor.aMinor.0.
|
||||
* aMajor.aMinor.aMicro.
|
||||
*/
|
||||
static inline bool
|
||||
IsAtkVersionAtLeast(int aMajor, int aMinor)
|
||||
IsAtkVersionAtLeast(int aMajor, int aMinor, int aMicro=0)
|
||||
{
|
||||
return aMajor < atkMajorVersion ||
|
||||
(aMajor == atkMajorVersion && aMinor <= atkMinorVersion);
|
||||
(aMajor == atkMajorVersion &&
|
||||
(aMinor < atkMinorVersion ||
|
||||
(aMinor == atkMinorVersion && aMicro <= atkMicroVersion)));
|
||||
}
|
||||
|
||||
// This is or'd with the pointer in MaiAtkObject::accWrap if the wrap-ee is a
|
||||
|
||||
@@ -186,6 +186,396 @@ static const nsRoleMapEntry sWAIRoleMaps[] =
|
||||
eList,
|
||||
states::READONLY
|
||||
},
|
||||
{ // doc-abstract
|
||||
&nsGkAtoms::docAbstract,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-acknowledgments
|
||||
&nsGkAtoms::docAcknowledgments,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-afterword
|
||||
&nsGkAtoms::docAfterword,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-appendix
|
||||
&nsGkAtoms::docAppendix,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-backlink
|
||||
&nsGkAtoms::docBacklink,
|
||||
roles::LINK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eJumpAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
states::LINKED
|
||||
},
|
||||
{ // doc-biblioentry
|
||||
&nsGkAtoms::docBiblioentry,
|
||||
roles::LISTITEM,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
states::READONLY
|
||||
},
|
||||
{ // doc-bibliography
|
||||
&nsGkAtoms::docBibliography,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-biblioref
|
||||
&nsGkAtoms::docBiblioref,
|
||||
roles::LINK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eJumpAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
states::LINKED
|
||||
},
|
||||
{ // doc-chapter
|
||||
&nsGkAtoms::docChapter,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-colophon
|
||||
&nsGkAtoms::docColophon,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-conclusion
|
||||
&nsGkAtoms::docConclusion,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-cover
|
||||
&nsGkAtoms::docCover,
|
||||
roles::GRAPHIC,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-credit
|
||||
&nsGkAtoms::docCredit,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-credits
|
||||
&nsGkAtoms::docCredits,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-dedication
|
||||
&nsGkAtoms::docDedication,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-endnote
|
||||
&nsGkAtoms::docEndnote,
|
||||
roles::LISTITEM,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
states::READONLY
|
||||
},
|
||||
{ // doc-endnotes
|
||||
&nsGkAtoms::docEndnotes,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-epigraph
|
||||
&nsGkAtoms::docEpigraph,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-epilogue
|
||||
&nsGkAtoms::docEpilogue,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-errata
|
||||
&nsGkAtoms::docErrata,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-example
|
||||
&nsGkAtoms::docExample,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-footnote
|
||||
&nsGkAtoms::docFootnote,
|
||||
roles::FOOTNOTE,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-foreword
|
||||
&nsGkAtoms::docForeword,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-glossary
|
||||
&nsGkAtoms::docGlossary,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-glossref
|
||||
&nsGkAtoms::docGlossref,
|
||||
roles::LINK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eJumpAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
states::LINKED
|
||||
},
|
||||
{ // doc-index
|
||||
&nsGkAtoms::docIndex,
|
||||
roles::NAVIGATION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-introduction
|
||||
&nsGkAtoms::docIntroduction,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-noteref
|
||||
&nsGkAtoms::docNoteref,
|
||||
roles::LINK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eJumpAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
states::LINKED
|
||||
},
|
||||
{ // doc-notice
|
||||
&nsGkAtoms::docNotice,
|
||||
roles::NOTE,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-pagebreak
|
||||
&nsGkAtoms::docPagebreak,
|
||||
roles::SEPARATOR,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-pagelist
|
||||
&nsGkAtoms::docPagelist,
|
||||
roles::NAVIGATION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-part
|
||||
&nsGkAtoms::docPart,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-preface
|
||||
&nsGkAtoms::docPreface,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-prologue
|
||||
&nsGkAtoms::docPrologue,
|
||||
roles::LANDMARK,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-pullquote
|
||||
&nsGkAtoms::docPullquote,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-qna
|
||||
&nsGkAtoms::docQna,
|
||||
roles::SECTION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-subtitle
|
||||
&nsGkAtoms::docSubtitle,
|
||||
roles::HEADING,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-tip
|
||||
&nsGkAtoms::docTip,
|
||||
roles::NOTE,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
kGenericAccType,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // doc-toc
|
||||
&nsGkAtoms::docToc,
|
||||
roles::NAVIGATION,
|
||||
kUseMapRole,
|
||||
eNoValue,
|
||||
eNoAction,
|
||||
eNoLiveAttr,
|
||||
eLandmark,
|
||||
kNoReqStates
|
||||
},
|
||||
{ // document
|
||||
&nsGkAtoms::document,
|
||||
roles::DOCUMENT,
|
||||
|
||||
@@ -982,7 +982,25 @@ enum Role {
|
||||
*/
|
||||
SUMMARY = 168,
|
||||
|
||||
LAST_ROLE = SUMMARY
|
||||
/**
|
||||
* An ARIA landmark. See related NAVIGATION role.
|
||||
*/
|
||||
LANDMARK = 169,
|
||||
|
||||
/**
|
||||
* A specific type of ARIA landmark. The ability to distinguish navigation
|
||||
* landmarks from other types of landmarks is, for example, needed on macOS
|
||||
* where specific AXSubrole and AXRoleDescription for navigation landmarks
|
||||
* are used.
|
||||
*/
|
||||
NAVIGATION = 170,
|
||||
|
||||
/**
|
||||
* An object that contains the text of a footnote.
|
||||
*/
|
||||
FOOTNOTE = 171,
|
||||
|
||||
LAST_ROLE = FOOTNOTE
|
||||
};
|
||||
|
||||
} // namespace role
|
||||
|
||||
@@ -1002,7 +1002,7 @@ ROLE(EMBEDDED_OBJECT,
|
||||
|
||||
ROLE(NOTE,
|
||||
"note",
|
||||
ATK_ROLE_SECTION,
|
||||
ATK_ROLE_COMMENT,
|
||||
NSAccessibilityGroupRole,
|
||||
USE_ROLE_STRING,
|
||||
IA2_ROLE_NOTE,
|
||||
@@ -1368,3 +1368,26 @@ ROLE(SUMMARY,
|
||||
ROLE_SYSTEM_PUSHBUTTON,
|
||||
eNameFromSubtreeRule)
|
||||
|
||||
ROLE(LANDMARK,
|
||||
"landmark",
|
||||
ATK_ROLE_LANDMARK,
|
||||
NSAccessibilityGroupRole,
|
||||
USE_ROLE_STRING,
|
||||
IA2_ROLE_LANDMARK,
|
||||
eNoNameRule)
|
||||
|
||||
ROLE(NAVIGATION,
|
||||
"navigation",
|
||||
ATK_ROLE_LANDMARK,
|
||||
NSAccessibilityGroupRole,
|
||||
USE_ROLE_STRING,
|
||||
IA2_ROLE_LANDMARK,
|
||||
eNoNameRule)
|
||||
|
||||
ROLE(FOOTNOTE,
|
||||
"footnote",
|
||||
ATK_ROLE_FOOTNOTE,
|
||||
NSAccessibilityGroupRole,
|
||||
USE_ROLE_STRING,
|
||||
IA2_ROLE_FOOTNOTE,
|
||||
eNoNameRule)
|
||||
|
||||
@@ -977,4 +977,21 @@ interface nsIAccessibleRole : nsISupports
|
||||
* SUMMARY role.
|
||||
*/
|
||||
const unsigned long ROLE_SUMMARY = 168;
|
||||
|
||||
/**
|
||||
* An ARIA landmark. See related NAVIGATION role.
|
||||
*/
|
||||
const unsigned long ROLE_LANDMARK = 169;
|
||||
|
||||
/**
|
||||
* A specific type of ARIA landmark. The ability to distinguish navigation
|
||||
* landmarks from other types of landmarks is needed because macOS has a
|
||||
* specific AXSubrole and AXRoleDescription for navigation landmarks.
|
||||
*/
|
||||
const unsigned long ROLE_NAVIGATION = 170;
|
||||
|
||||
/**
|
||||
* An object that contains the text of a footnote.
|
||||
*/
|
||||
const unsigned long ROLE_FOOTNOTE = 171;
|
||||
};
|
||||
|
||||
@@ -726,6 +726,8 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
else if (proxy)
|
||||
landmark = proxy->LandmarkRole();
|
||||
|
||||
// HTML Elements treated as landmarks
|
||||
// XXX bug 1371712
|
||||
if (landmark) {
|
||||
if (landmark == nsGkAtoms::application)
|
||||
return @"AXLandmarkApplication";
|
||||
@@ -747,6 +749,13 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
return @"AXSearchField";
|
||||
}
|
||||
|
||||
// macOS groups the specific landmark types of DPub ARIA into two broad
|
||||
// categories with corresponding subroles: Navigation and region/container.
|
||||
if (mRole == roles::NAVIGATION)
|
||||
return @"AXLandmarkNavigation";
|
||||
if (mRole == roles::LANDMARK)
|
||||
return @"AXLandmarkRegion";
|
||||
|
||||
// Now, deal with widget roles
|
||||
nsIAtom* roleAtom = nullptr;
|
||||
if (accWrap && accWrap->HasARIARole()) {
|
||||
@@ -889,6 +898,17 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
case roles::SUMMARY:
|
||||
return @"AXSummary";
|
||||
|
||||
case roles::NOTE:
|
||||
return @"AXDocumentNote";
|
||||
|
||||
// macOS added an AXSubrole value to distinguish generic AXGroup objects
|
||||
// from those which are AXGroups as a result of an explicit ARIA role,
|
||||
// such as the non-landmark, non-listitem text containers in DPub ARIA.
|
||||
case roles::SECTION:
|
||||
if (roleAtom)
|
||||
return @"AXApplicationGroup";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
support-files =
|
||||
!/accessible/tests/mochitest/*.js
|
||||
|
||||
[test_dpub_aria_xml-roles.html]
|
||||
[test_obj.html]
|
||||
[test_obj_css.html]
|
||||
[test_obj_css.xul]
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>XML roles tests</title>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../attributes.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// DPub ARIA roles should be exposed via the xml-roles object attribute.
|
||||
let dpub_attrs = [
|
||||
'doc-abstract',
|
||||
'doc-acknowledgments',
|
||||
'doc-afterword',
|
||||
'doc-appendix',
|
||||
'doc-backlink',
|
||||
'doc-biblioentry',
|
||||
'doc-bibliography',
|
||||
'doc-biblioref',
|
||||
'doc-chapter',
|
||||
'doc-colophon',
|
||||
'doc-conclusion',
|
||||
'doc-cover',
|
||||
'doc-credit',
|
||||
'doc-credits',
|
||||
'doc-dedication',
|
||||
'doc-endnote',
|
||||
'doc-endnotes',
|
||||
'doc-epigraph',
|
||||
'doc-epilogue',
|
||||
'doc-errata',
|
||||
'doc-example',
|
||||
'doc-footnote',
|
||||
'doc-foreword',
|
||||
'doc-glossary',
|
||||
'doc-glossref',
|
||||
'doc-index',
|
||||
'doc-introduction',
|
||||
'doc-noteref',
|
||||
'doc-notice',
|
||||
'doc-pagebreak',
|
||||
'doc-pagelist',
|
||||
'doc-part',
|
||||
'doc-preface',
|
||||
'doc-prologue',
|
||||
'doc-pullquote',
|
||||
'doc-qna',
|
||||
'doc-subtitle',
|
||||
'doc-tip',
|
||||
'doc-toc'
|
||||
];
|
||||
for (let attr of dpub_attrs) {
|
||||
testAttrs(attr, {"xml-roles" : attr}, true);
|
||||
}
|
||||
SimpleTest.finish();
|
||||
}
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1343537"
|
||||
title="implement ARIA DPUB extension">
|
||||
Bug 1343537
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<div id="doc-abstract" role="doc-abstract">abstract</div>
|
||||
<div id="doc-acknowledgments" role="doc-acknowledgments">acknowledgments</div>
|
||||
<div id="doc-afterword" role="doc-afterword">afterword</div>
|
||||
<div id="doc-appendix" role="doc-appendix">appendix</div>
|
||||
<div id="doc-backlink" role="doc-backlink">backlink</div>
|
||||
<div id="doc-biblioentry" role="doc-biblioentry">biblioentry</div>
|
||||
<div id="doc-bibliography" role="doc-bibliography">bibliography</div>
|
||||
<div id="doc-biblioref" role="doc-biblioref">biblioref</div>
|
||||
<div id="doc-chapter" role="doc-chapter">chapter</div>
|
||||
<div id="doc-colophon" role="doc-colophon">colophon</div>
|
||||
<div id="doc-conclusion" role="doc-conclusion">conclusion</div>
|
||||
<div id="doc-cover" role="doc-cover">cover</div>
|
||||
<div id="doc-credit" role="doc-credit">credit</div>
|
||||
<div id="doc-credits" role="doc-credits">credits</div>
|
||||
<div id="doc-dedication" role="doc-dedication">dedication</div>
|
||||
<div id="doc-endnote" role="doc-endnote">endnote</div>
|
||||
<div id="doc-endnotes" role="doc-endnotes">endnotes</div>
|
||||
<div id="doc-epigraph" role="doc-epigraph">epigraph</div>
|
||||
<div id="doc-epilogue" role="doc-epilogue">epilogue</div>
|
||||
<div id="doc-errata" role="doc-errata">errata</div>
|
||||
<div id="doc-example" role="doc-example">example</div>
|
||||
<div id="doc-footnote" role="doc-footnote">footnote</div>
|
||||
<div id="doc-foreword" role="doc-foreword">foreword</div>
|
||||
<div id="doc-glossary" role="doc-glossary">glossary</div>
|
||||
<div id="doc-glossref" role="doc-glossref">glossref</div>
|
||||
<div id="doc-index" role="doc-index">index</div>
|
||||
<div id="doc-introduction" role="doc-introduction">introduction</div>
|
||||
<div id="doc-noteref" role="doc-noteref">noteref</div>
|
||||
<div id="doc-notice" role="doc-notice">notice</div>
|
||||
<div id="doc-pagebreak" role="doc-pagebreak">pagebreak</div>
|
||||
<div id="doc-pagelist" role="doc-pagelist">pagelist</div>
|
||||
<div id="doc-part" role="doc-part">part</div>
|
||||
<div id="doc-preface" role="doc-preface">preface</div>
|
||||
<div id="doc-prologue" role="doc-prologue">prologue</div>
|
||||
<div id="doc-pullquote" role="doc-pullquote">pullquote</div>
|
||||
<div id="doc-qna" role="doc-qna">qna</div>
|
||||
<div id="doc-subtitle" role="doc-subtitle">subtitle</div>
|
||||
<div id="doc-tip" role="doc-tip">tip</div>
|
||||
<div id="doc-toc" role="doc-toc">toc</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -28,6 +28,7 @@ const ROLE_ENTRY = nsIAccessibleRole.ROLE_ENTRY;
|
||||
const ROLE_EQUATION = nsIAccessibleRole.ROLE_EQUATION;
|
||||
const ROLE_FIGURE = nsIAccessibleRole.ROLE_FIGURE;
|
||||
const ROLE_FOOTER = nsIAccessibleRole.ROLE_FOOTER;
|
||||
const ROLE_FOOTNOTE = nsIAccessibleRole.ROLE_FOOTNOTE;
|
||||
const ROLE_FLAT_EQUATION = nsIAccessibleRole.ROLE_FLAT_EQUATION;
|
||||
const ROLE_FORM = nsIAccessibleRole.ROLE_FORM;
|
||||
const ROLE_GRAPHIC = nsIAccessibleRole.ROLE_GRAPHIC;
|
||||
@@ -38,6 +39,7 @@ const ROLE_HEADING = nsIAccessibleRole.ROLE_HEADING;
|
||||
const ROLE_IMAGE_MAP = nsIAccessibleRole.ROLE_IMAGE_MAP;
|
||||
const ROLE_INTERNAL_FRAME = nsIAccessibleRole.ROLE_INTERNAL_FRAME;
|
||||
const ROLE_LABEL = nsIAccessibleRole.ROLE_LABEL;
|
||||
const ROLE_LANDMARK = nsIAccessibleRole.ROLE_LANDMARK;
|
||||
const ROLE_LINK = nsIAccessibleRole.ROLE_LINK;
|
||||
const ROLE_LIST = nsIAccessibleRole.ROLE_LIST;
|
||||
const ROLE_LISTBOX = nsIAccessibleRole.ROLE_LISTBOX;
|
||||
@@ -79,6 +81,7 @@ const ROLE_MATHML_STACK_LINE = nsIAccessibleRole.ROLE_MATHML_STACK_LINE;
|
||||
const ROLE_MENUBAR = nsIAccessibleRole.ROLE_MENUBAR;
|
||||
const ROLE_MENUITEM = nsIAccessibleRole.ROLE_MENUITEM;
|
||||
const ROLE_MENUPOPUP = nsIAccessibleRole.ROLE_MENUPOPUP;
|
||||
const ROLE_NAVIGATION = nsIAccessibleRole.ROLE_NAVIGATION;
|
||||
const ROLE_NOTHING = nsIAccessibleRole.ROLE_NOTHING;
|
||||
const ROLE_NOTE = nsIAccessibleRole.ROLE_NOTE;
|
||||
const ROLE_OPTION = nsIAccessibleRole.ROLE_OPTION;
|
||||
|
||||
@@ -5,6 +5,7 @@ support-files =
|
||||
|
||||
[test_aria.html]
|
||||
[test_aria.xul]
|
||||
[test_dpub_aria.html]
|
||||
[test_general.html]
|
||||
[test_general.xul]
|
||||
[test_svg.html]
|
||||
|
||||
116
accessible/tests/mochitest/role/test_dpub_aria.html
Normal file
116
accessible/tests/mochitest/role/test_dpub_aria.html
Normal file
@@ -0,0 +1,116 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test DPub ARIA roles</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// DPub ARIA role map.
|
||||
testRole("doc-abstract", ROLE_SECTION);
|
||||
testRole("doc-acknowledgments", ROLE_LANDMARK);
|
||||
testRole("doc-afterword", ROLE_LANDMARK);
|
||||
testRole("doc-appendix", ROLE_LANDMARK);
|
||||
testRole("doc-backlink", ROLE_LINK);
|
||||
testRole("doc-biblioentry", ROLE_LISTITEM);
|
||||
testRole("doc-bibliography", ROLE_LANDMARK);
|
||||
testRole("doc-biblioref", ROLE_LINK);
|
||||
testRole("doc-chapter", ROLE_LANDMARK);
|
||||
testRole("doc-colophon", ROLE_SECTION);
|
||||
testRole("doc-conclusion", ROLE_LANDMARK);
|
||||
testRole("doc-cover", ROLE_GRAPHIC);
|
||||
testRole("doc-credit", ROLE_SECTION);
|
||||
testRole("doc-credits", ROLE_LANDMARK);
|
||||
testRole("doc-dedication", ROLE_SECTION);
|
||||
testRole("doc-endnote", ROLE_LISTITEM);
|
||||
testRole("doc-endnotes", ROLE_LANDMARK);
|
||||
testRole("doc-epigraph", ROLE_SECTION);
|
||||
testRole("doc-epilogue", ROLE_LANDMARK);
|
||||
testRole("doc-errata", ROLE_LANDMARK);
|
||||
testRole("doc-example", ROLE_SECTION);
|
||||
testRole("doc-footnote", ROLE_FOOTNOTE);
|
||||
testRole("doc-foreword", ROLE_LANDMARK);
|
||||
testRole("doc-glossary", ROLE_LANDMARK);
|
||||
testRole("doc-glossref", ROLE_LINK);
|
||||
testRole("doc-index", ROLE_NAVIGATION);
|
||||
testRole("doc-introduction", ROLE_LANDMARK);
|
||||
testRole("doc-noteref", ROLE_LINK);
|
||||
testRole("doc-notice", ROLE_NOTE);
|
||||
testRole("doc-pagebreak", ROLE_SEPARATOR);
|
||||
testRole("doc-pagelist", ROLE_NAVIGATION);
|
||||
testRole("doc-part", ROLE_LANDMARK);
|
||||
testRole("doc-preface", ROLE_LANDMARK);
|
||||
testRole("doc-prologue", ROLE_LANDMARK);
|
||||
testRole("doc-pullquote", ROLE_SECTION);
|
||||
testRole("doc-qna", ROLE_SECTION);
|
||||
testRole("doc-subtitle", ROLE_HEADING);
|
||||
testRole("doc-tip", ROLE_NOTE);
|
||||
testRole("doc-toc", ROLE_NAVIGATION);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1343537"
|
||||
title="implement ARIA DPUB extension">
|
||||
Bug 1343537
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
<div id="doc-abstract" role="doc-abstract">abstract</div>
|
||||
<div id="doc-acknowledgments" role="doc-acknowledgments">acknowledgments</div>
|
||||
<div id="doc-afterword" role="doc-afterword">afterword</div>
|
||||
<div id="doc-appendix" role="doc-appendix">appendix</div>
|
||||
<div id="doc-backlink" role="doc-backlink">backlink</div>
|
||||
<div id="doc-biblioentry" role="doc-biblioentry">biblioentry</div>
|
||||
<div id="doc-bibliography" role="doc-bibliography">bibliography</div>
|
||||
<div id="doc-biblioref" role="doc-biblioref">biblioref</div>
|
||||
<div id="doc-chapter" role="doc-chapter">chapter</div>
|
||||
<div id="doc-colophon" role="doc-colophon">colophon</div>
|
||||
<div id="doc-conclusion" role="doc-conclusion">conclusion</div>
|
||||
<div id="doc-cover" role="doc-cover">cover</div>
|
||||
<div id="doc-credit" role="doc-credit">credit</div>
|
||||
<div id="doc-credits" role="doc-credits">credits</div>
|
||||
<div id="doc-dedication" role="doc-dedication">dedication</div>
|
||||
<div id="doc-endnote" role="doc-endnote">endnote</div>
|
||||
<div id="doc-endnotes" role="doc-endnotes">endnotes</div>
|
||||
<div id="doc-epigraph" role="doc-epigraph">epigraph</div>
|
||||
<div id="doc-epilogue" role="doc-epilogue">epilogue</div>
|
||||
<div id="doc-errata" role="doc-errata">errata</div>
|
||||
<div id="doc-example" role="doc-example">example</div>
|
||||
<div id="doc-footnote" role="doc-footnote">footnote</div>
|
||||
<div id="doc-foreword" role="doc-foreword">foreword</div>
|
||||
<div id="doc-glossary" role="doc-glossary">glossary</div>
|
||||
<div id="doc-glossref" role="doc-glossref">glossref</div>
|
||||
<div id="doc-index" role="doc-index">index</div>
|
||||
<div id="doc-introduction" role="doc-introduction">introduction</div>
|
||||
<div id="doc-noteref" role="doc-noteref">noteref</div>
|
||||
<div id="doc-notice" role="doc-notice">notice</div>
|
||||
<div id="doc-pagebreak" role="doc-pagebreak">pagebreak</div>
|
||||
<div id="doc-pagelist" role="doc-pagelist">pagelist</div>
|
||||
<div id="doc-part" role="doc-part">part</div>
|
||||
<div id="doc-preface" role="doc-preface">preface</div>
|
||||
<div id="doc-prologue" role="doc-prologue">prologue</div>
|
||||
<div id="doc-pullquote" role="doc-pullquote">pullquote</div>
|
||||
<div id="doc-qna" role="doc-qna">qna</div>
|
||||
<div id="doc-subtitle" role="doc-subtitle">subtitle</div>
|
||||
<div id="doc-tip" role="doc-tip">tip</div>
|
||||
<div id="doc-toc" role="doc-toc">toc</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -350,6 +350,45 @@ GK_ATOM(displayMode, "display-mode")
|
||||
GK_ATOM(distinct, "distinct")
|
||||
GK_ATOM(div, "div")
|
||||
GK_ATOM(dl, "dl")
|
||||
GK_ATOM(docAbstract, "doc-abstract")
|
||||
GK_ATOM(docAcknowledgments, "doc-acknowledgments")
|
||||
GK_ATOM(docAfterword, "doc-afterword")
|
||||
GK_ATOM(docAppendix, "doc-appendix")
|
||||
GK_ATOM(docBacklink, "doc-backlink")
|
||||
GK_ATOM(docBiblioentry, "doc-biblioentry")
|
||||
GK_ATOM(docBibliography, "doc-bibliography")
|
||||
GK_ATOM(docBiblioref, "doc-biblioref")
|
||||
GK_ATOM(docChapter, "doc-chapter")
|
||||
GK_ATOM(docColophon, "doc-colophon")
|
||||
GK_ATOM(docConclusion, "doc-conclusion")
|
||||
GK_ATOM(docCover, "doc-cover")
|
||||
GK_ATOM(docCredit, "doc-credit")
|
||||
GK_ATOM(docCredits, "doc-credits")
|
||||
GK_ATOM(docDedication, "doc-dedication")
|
||||
GK_ATOM(docEndnote, "doc-endnote")
|
||||
GK_ATOM(docEndnotes, "doc-endnotes")
|
||||
GK_ATOM(docEpigraph, "doc-epigraph")
|
||||
GK_ATOM(docEpilogue, "doc-epilogue")
|
||||
GK_ATOM(docErrata, "doc-errata")
|
||||
GK_ATOM(docExample, "doc-example")
|
||||
GK_ATOM(docFootnote, "doc-footnote")
|
||||
GK_ATOM(docForeword, "doc-foreword")
|
||||
GK_ATOM(docGlossary, "doc-glossary")
|
||||
GK_ATOM(docGlossref, "doc-glossref")
|
||||
GK_ATOM(docIndex, "doc-index")
|
||||
GK_ATOM(docIntroduction, "doc-introduction")
|
||||
GK_ATOM(docNoteref, "doc-noteref")
|
||||
GK_ATOM(docNotice, "doc-notice")
|
||||
GK_ATOM(docPagebreak, "doc-pagebreak")
|
||||
GK_ATOM(docPagelist, "doc-pagelist")
|
||||
GK_ATOM(docPart, "doc-part")
|
||||
GK_ATOM(docPreface, "doc-preface")
|
||||
GK_ATOM(docPrologue, "doc-prologue")
|
||||
GK_ATOM(docPullquote, "doc-pullquote")
|
||||
GK_ATOM(docQna, "doc-qna")
|
||||
GK_ATOM(docSubtitle, "doc-subtitle")
|
||||
GK_ATOM(docTip, "doc-tip")
|
||||
GK_ATOM(docToc, "doc-toc")
|
||||
GK_ATOM(doctypePublic, "doctype-public")
|
||||
GK_ATOM(doctypeSystem, "doctype-system")
|
||||
GK_ATOM(document, "document")
|
||||
|
||||
@@ -223,6 +223,11 @@ extern "C" {
|
||||
* @Since: ATK-2.16.
|
||||
*@ATK_ROLE_MATH_ROOT: An object that represents a mathematical expression
|
||||
* displayed with a radical. @Since: ATK-2.16.
|
||||
*@ATK_ROLE_SUBSCRIPT: An object that contains text that is displayed as a
|
||||
* subscript. @Since: ATK-2.16.
|
||||
*@ATK_ROLE_SUPERSCRIPT: An object that contains text that is displayed as a
|
||||
* superscript. @Since: ATK-2.16.
|
||||
*@ATK_ROLE_FOOTNOTE: An object that contains the text of a footnote. @Since: ATK-2.26.
|
||||
*@ATK_ROLE_LAST_DEFINED: not a valid role, used for finding end of the enumeration
|
||||
*
|
||||
* Describes the role of an object
|
||||
@@ -353,6 +358,9 @@ typedef enum
|
||||
ATK_ROLE_STATIC,
|
||||
ATK_ROLE_MATH_FRACTION,
|
||||
ATK_ROLE_MATH_ROOT,
|
||||
ATK_ROLE_SUBSCRIPT,
|
||||
ATK_ROLE_SUPERSCRIPT,
|
||||
ATK_ROLE_FOOTNOTE,
|
||||
ATK_ROLE_LAST_DEFINED
|
||||
} AtkRole;
|
||||
|
||||
|
||||
@@ -290,6 +290,12 @@ enum IA2Role {
|
||||
to the main content. If the complementary content is completely separable main
|
||||
content, it may be appropriate to use a more general role.
|
||||
*/
|
||||
IA2_ROLE_COMPLEMENTARY_CONTENT
|
||||
IA2_ROLE_COMPLEMENTARY_CONTENT,
|
||||
|
||||
/** An object representing a navigational landmark, a region on a page to
|
||||
which the user may want quick access, such as navigating, searching,
|
||||
perusing the primary content.
|
||||
*/
|
||||
IA2_ROLE_LANDMARK
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user