Bug 1310794 - implement aria-details and aria-errormessage, r=davidb

This commit is contained in:
Alexander Surkov 2016-10-25 13:51:27 -04:00
Родитель 817b9ee6c5
Коммит 4657cb7a0f
11 изменённых файлов: 134 добавлений и 3 удалений

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

@ -827,8 +827,10 @@ static const AttrCharacteristics gWAIUnivAttrMap[] = {
{&nsGkAtoms::aria_checked, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, /* exposes checkable obj attr */
{&nsGkAtoms::aria_controls, ATTR_BYPASSOBJ | ATTR_GLOBAL },
{&nsGkAtoms::aria_describedby, ATTR_BYPASSOBJ | ATTR_GLOBAL },
{&nsGkAtoms::aria_details, ATTR_BYPASSOBJ | ATTR_GLOBAL },
{&nsGkAtoms::aria_disabled, ATTR_BYPASSOBJ | ATTR_VALTOKEN | ATTR_GLOBAL },
{&nsGkAtoms::aria_dropeffect, ATTR_VALTOKEN | ATTR_GLOBAL },
{&nsGkAtoms::aria_errormessage, ATTR_BYPASSOBJ | ATTR_GLOBAL },
{&nsGkAtoms::aria_expanded, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsGkAtoms::aria_flowto, ATTR_BYPASSOBJ | ATTR_GLOBAL },
{&nsGkAtoms::aria_grabbed, ATTR_VALTOKEN | ATTR_GLOBAL },

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

@ -127,8 +127,34 @@ enum class RelationType {
*/
CONTAINING_APPLICATION = 0x14,
LAST = CONTAINING_APPLICATION
/**
* The target object provides the detailed, extended description for this
* object. It provides more detailed information than would normally be
* provided using the DESCRIBED_BY relation. A common use for this relation is
* in digital publishing where an extended description needs to be conveyed in
* a book that requires structural markup or the embedding of other technology
* to provide illustrative content.
*/
DETAILS = 0x15,
/**
* This object provides the detailed, extended description for the target
* object. See DETAILS relation.
*/
DETAILS_FOR = 0x16,
/**
* The target object is the error message for this object.
*/
ERRORMSG = 0x17,
/**
* This object is the error message for the target object.
*/
ERRORMSG_FOR = 0x18,
LAST = ERRORMSG_FOR
};
} // namespace a11y

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

@ -128,3 +128,27 @@ RELATIONTYPE(CONTAINING_APPLICATION,
ATK_RELATION_NULL,
NAVRELATION_CONTAINING_APPLICATION,
IA2_RELATION_CONTAINING_APPLICATION)
RELATIONTYPE(DETAILS,
"details",
ATK_RELATION_NULL,
NAVRELATION_DETAILS,
IA2_RELATION_DETAILS)
RELATIONTYPE(DETAILS_FOR,
"details for",
ATK_RELATION_NULL,
NAVRELATION_DETAILS_FOR,
IA2_RELATION_DETAILS_FOR)
RELATIONTYPE(ERRORMSG,
"error",
ATK_RELATION_NULL,
NAVRELATION_ERROR,
IA2_RELATION_ERROR)
RELATIONTYPE(ERRORMSG_FOR,
"error for",
ATK_RELATION_NULL,
NAVRELATION_ERROR_FOR,
IA2_RELATION_ERROR_FOR)

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

@ -1747,12 +1747,24 @@ Accessible::RelationByType(RelationType aType)
}
}
}
return Relation();
return Relation();
}
case RelationType::CONTAINING_APPLICATION:
return Relation(ApplicationAcc());
case RelationType::DETAILS:
return Relation(new IDRefsIterator(mDoc, mContent, nsGkAtoms::aria_details));
case RelationType::DETAILS_FOR:
return Relation(new RelatedAccIterator(mDoc, mContent, nsGkAtoms::aria_details));
case RelationType::ERRORMSG:
return Relation(new IDRefsIterator(mDoc, mContent, nsGkAtoms::aria_errormessage));
case RelationType::ERRORMSG_FOR:
return Relation(new RelatedAccIterator(mDoc, mContent, nsGkAtoms::aria_errormessage));
default:
return Relation();
}

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

@ -63,9 +63,11 @@ static nsIAtom** kRelationAttrs[] =
{
&nsGkAtoms::aria_labelledby,
&nsGkAtoms::aria_describedby,
&nsGkAtoms::aria_details,
&nsGkAtoms::aria_owns,
&nsGkAtoms::aria_controls,
&nsGkAtoms::aria_flowto,
&nsGkAtoms::aria_errormessage,
&nsGkAtoms::_for,
&nsGkAtoms::control
};

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

@ -124,6 +124,32 @@ interface nsIAccessibleRelation : nsISupports
*/
const unsigned long RELATION_CONTAINING_APPLICATION = 0x14;
/**
* The target object provides the detailed, extended description for this
* object. It provides more detailed information than would normally be
* provided using the DESCRIBED_BY relation. A common use for this relation is
* in digital publishing where an extended description needs to be conveyed in
* a book that requires structural markup or the embedding of other technology
* to provide illustrative content.
*/
const unsigned long RELATION_DETAILS = 0x15;
/**
* This object provides the detailed, extended description for the target
* object. See DETAILS relation.
*/
const unsigned long RELATION_DETAILS_FOR = 0x16;
/**
* The target object is the error message for this object.
*/
const unsigned long RELATION_ERRORMSG = 0x17;
/**
* This object is the error message for the target object.
*/
const unsigned long RELATION_ERRORMSG_FOR = 0x18;
/**
* Returns the type of the relation.
*/

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

@ -21,6 +21,10 @@ var RELATION_SUBWINDOW_OF = nsIAccessibleRelation.RELATION_SUBWINDOW_OF;
var RELATION_CONTAINING_DOCUMENT = nsIAccessibleRelation.RELATION_CONTAINING_DOCUMENT;
var RELATION_CONTAINING_TAB_PANE = nsIAccessibleRelation.RELATION_CONTAINING_TAB_PANE;
var RELATION_CONTAINING_APPLICATION = nsIAccessibleRelation.RELATION_CONTAINING_APPLICATION;
const RELATION_DETAILS = nsIAccessibleRelation.RELATION_DETAILS;
const RELATION_DETAILS_FOR = nsIAccessibleRelation.RELATION_DETAILS_FOR;
const RELATION_ERRORMSG = nsIAccessibleRelation.RELATION_ERRORMSG;
const RELATION_ERRORMSG_FOR = nsIAccessibleRelation.RELATION_ERRORMSG_FOR;
////////////////////////////////////////////////////////////////////////////////
// General

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

@ -188,6 +188,14 @@
testRelation("control1_1", RELATION_CONTAINING_TAB_PANE, getTabDocAccessible("control1_1"));
testRelation("control1_1", RELATION_CONTAINING_APPLICATION, getApplicationAccessible());
// details
testRelation("has_details", RELATION_DETAILS, "details");
testRelation("details", RELATION_DETAILS_FOR, "has_details");
// error
testRelation("has_error", RELATION_ERRORMSG, "error");
testRelation("error", RELATION_ERRORMSG_FOR, "has_error");
// finish test
SimpleTest.finish();
}
@ -391,5 +399,8 @@
<legend id="legend">legend</legend>
<input />
</fieldset>
<input id="has_details" aria-details="details"><section id="details"></section>
<input id="has_error" aria-errormessage="error"><section id="error"></section>
</body>
</html>

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

@ -236,7 +236,11 @@ protected:
NAVRELATION_NODE_PARENT_OF = 0x1010,
NAVRELATION_CONTAINING_DOCUMENT = 0x1011,
NAVRELATION_CONTAINING_TAB_PANE = 0x1012,
NAVRELATION_CONTAINING_APPLICATION = 0x1014
NAVRELATION_CONTAINING_APPLICATION = 0x1014,
NAVRELATION_DETAILS = 0x1015,
NAVRELATION_DETAILS_FOR = 0x1016,
NAVRELATION_ERROR = 0x1017,
NAVRELATION_ERROR_FOR = 0x1018
};
};

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

@ -2325,8 +2325,10 @@ GK_ATOM(aria_colcount, "aria-colcount")
GK_ATOM(aria_colindex, "aria-colindex")
GK_ATOM(aria_controls, "aria-controls")
GK_ATOM(aria_describedby, "aria-describedby")
GK_ATOM(aria_details, "aria-details")
GK_ATOM(aria_disabled, "aria-disabled")
GK_ATOM(aria_dropeffect, "aria-dropeffect")
GK_ATOM(aria_errormessage, "aria-errormessage")
GK_ATOM(aria_expanded, "aria-expanded")
GK_ATOM(aria_flowto, "aria-flowto")
GK_ATOM(aria_grabbed, "aria-grabbed")

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

@ -154,6 +154,24 @@ const WCHAR *const IA2_RELATION_PREVIOUS_TABBABLE = L"previousTabbable";
/** This object is a sub window of a target object. */
const WCHAR *const IA2_RELATION_SUBWINDOW_OF = L"subwindowOf";
/** The target object provides the detailed, extended description for this
object. It provides more detailed information than would normally be provided
using the IA2_RELATION_DESCRIBED_BY relation. A common use for this relation is
in digital publishing where an extended description needs to be conveyed in
a book that requires structural markup or the embedding of other technology to
provide illustrative content. */
const WCHAR *const IA2_RELATION_DETAILS = L"details";
/** This object provides the detailed, extended description for the target
object. See IA2_RELATION_DETAILS. */
const WCHAR *const IA2_RELATION_DETAILS_FOR = L"detailsFor";
/** The target object is the error message for this object. */
const WCHAR *const IA2_RELATION_ERROR = L"error";
/** This object is the error message for the target object. */
const WCHAR *const IA2_RELATION_ERROR_FOR = L"errorFor";
///@}
/** This interface gives access to an object's set of relations.