Bug 301436. Start using official DHTML a11y namespaces. r+sr=jst, a=asa

This commit is contained in:
aaronleventhal%moonset.net 2005-07-20 19:34:55 +00:00
Родитель 53beab23e9
Коммит f3ae3ea672
4 изменённых файлов: 17 добавлений и 17 удалений

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

@ -140,7 +140,7 @@ nsresult nsAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
// If either attribute (role or multiselect) change, then we'll
// destroy this accessible so that we can follow COM identity rules.
nsAutoString multiSelect;
content->GetAttr(kNameSpaceID_StatesWAI_Unofficial,
content->GetAttr(kNameSpaceID_WAIProperties,
nsAccessibilityAtoms::multiselect,
multiSelect);
if (!multiSelect.IsEmpty() && !multiSelect.EqualsLiteral("false")) {
@ -309,8 +309,8 @@ NS_IMETHODIMP nsAccessible::Init()
nsCOMPtr<nsIDOM3Node> dom3Node(do_QueryInterface(content));
if (dom3Node) {
nsAutoString prefix;
NS_NAMED_LITERAL_STRING(kRolesWAI_Namespace, "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#");
dom3Node->LookupPrefix(kRolesWAI_Namespace, prefix);
NS_NAMED_LITERAL_STRING(kWAIRoles_Namespace, "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#");
dom3Node->LookupPrefix(kWAIRoles_Namespace, prefix);
if (prefix.IsEmpty()) {
// In HTML we are hardcoded to allow the exact prefix "wairole:" to
// always indicate that we are using the WAI roles. This allows DHTML accessibility
@ -1058,7 +1058,7 @@ nsresult nsAccessible::SetNonTextSelection(PRBool aSelect)
NS_ASSERTION(content, "Called for dead accessible");
// For DHTML widgets use WAI namespace
PRUint32 nameSpaceID = mRoleMapEntry ? kNameSpaceID_StatesWAI_Unofficial : kNameSpaceID_None;
PRUint32 nameSpaceID = mRoleMapEntry ? kNameSpaceID_WAIProperties : kNameSpaceID_None;
if (aSelect) {
return content->SetAttr(nameSpaceID, nsAccessibilityAtoms::selected, NS_LITERAL_STRING("true"), PR_TRUE);
}
@ -1411,7 +1411,7 @@ nsresult nsAccessible::GetTextFromRelationID(nsIAtom *aIDAttrib, nsString &aName
nsAutoString id;
if (NS_CONTENT_ATTR_HAS_VALUE !=
content->GetAttr(kNameSpaceID_StatesWAI_Unofficial, aIDAttrib, id)) {
content->GetAttr(kNameSpaceID_WAIProperties, aIDAttrib, id)) {
return NS_ERROR_FAILURE;
}
@ -1768,7 +1768,7 @@ PRBool nsAccessible::MappedAttrState(nsIContent *aContent, PRUint32 *aStateInOut
nsAutoString attribValue;
nsCOMPtr<nsIAtom> attribAtom = do_GetAtom(aStateMapEntry->attributeName); // XXX put atoms directly in entry
if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_StatesWAI_Unofficial,
if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_WAIProperties,
attribAtom,
attribValue)) {
if (aStateMapEntry->attributeValue == BOOL_STATE) {
@ -1852,7 +1852,7 @@ NS_IMETHODIMP nsAccessible::GetFinalValue(nsAString& aValue)
}
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
if (content &&
NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_StatesWAI_Unofficial,
NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_WAIProperties,
nsAccessibilityAtoms::valuenow,
aValue)) {
return NS_OK;
@ -1973,7 +1973,7 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce
}
case RELATION_DESCRIBED_BY:
{
content->GetAttr(kNameSpaceID_StatesWAI_Unofficial,
content->GetAttr(kNameSpaceID_WAIProperties,
nsAccessibilityAtoms::describedby, relatedID);
if (relatedID.IsEmpty()) {
nsIContent *description =
@ -1995,7 +1995,7 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce
(start = start->GetParent()) != nsnull) {
nsIContent *description = GetContentPointingTo(&controlID, start,
nsAccessibilityAtoms::describedby,
kNameSpaceID_StatesWAI_Unofficial,
kNameSpaceID_WAIProperties,
nsnull);
relatedNode = do_QueryInterface(description);
}

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

@ -767,7 +767,7 @@ nsDocAccessible::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent,
FireToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
multiSelect, nsnull);
nsAutoString attrValue;
aContent->GetAttr(kNameSpaceID_StatesWAI_Unofficial,
aContent->GetAttr(kNameSpaceID_WAIProperties,
nsAccessibilityAtoms::selected, attrValue);
if (attrValue.IsEmpty() || attrValue.EqualsLiteral("false")) {
eventType = nsIAccessibleEvent::EVENT_SELECTION_REMOVE;
@ -777,7 +777,7 @@ nsDocAccessible::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent,
}
}
}
else if (aNameSpaceID == kNameSpaceID_StatesWAI_Unofficial) {
else if (aNameSpaceID == kNameSpaceID_WAIProperties) {
// DHTML accessibility attributes
nsCOMPtr<nsIContent> changedContent(do_QueryInterface(targetNode));
if (!changedContent->HasAttr(kNameSpaceID_XHTML2_Unofficial,

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

@ -63,8 +63,8 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
#define kSVGNameSpaceURI "http://www.w3.org/2000/svg"
#define kXMLEventsNameSpaceURI "http://www.w3.org/2001/xml-events"
#define kXHTML2UnofficialNameSpaceURI "http://www.w3.org/TR/xhtml2" // Will eventually change
#define kRolesWAIUnofficialNameSpaceURI "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#" // Will eventually change
#define kStatesWAIUnofficialNameSpaceURI "http://www.w3.org/2005/01/wai-rdf/GUIStateTaxonomy#" // Will eventually change
#define kWAIRolesNameSpaceURI "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"
#define kWAIPropertiesNameSpaceURI "http://www.w3.org/2005/07/aaa"
class nsNameSpaceEntry : public PLDHashEntryHdr
{
@ -172,8 +172,8 @@ nsresult NameSpaceManagerImpl::Init()
AddNameSpace(NS_LITERAL_STRING(kSVGNameSpaceURI), kNameSpaceID_SVG);
AddNameSpace(NS_LITERAL_STRING(kXMLEventsNameSpaceURI), kNameSpaceID_XMLEvents);
AddNameSpace(NS_LITERAL_STRING(kXHTML2UnofficialNameSpaceURI), kNameSpaceID_XHTML2_Unofficial);
AddNameSpace(NS_LITERAL_STRING(kRolesWAIUnofficialNameSpaceURI), kNameSpaceID_RolesWAI_Unofficial);
AddNameSpace(NS_LITERAL_STRING(kStatesWAIUnofficialNameSpaceURI), kNameSpaceID_StatesWAI_Unofficial);
AddNameSpace(NS_LITERAL_STRING(kWAIRolesNameSpaceURI), kNameSpaceID_WAIRoles);
AddNameSpace(NS_LITERAL_STRING(kWAIStatesNameSpaceURI), kNameSpaceID_WAIProperties);
return NS_OK;
}

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

@ -431,7 +431,7 @@
<xul:radiogroup anonid="selector" orient="horizontal" class="paneSelector chromeclass-toolbar"
xmlns:xhtml2="http://www.w3.org/TR/xhtml2"
xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#"
xmlns:waistate="http://www.w3.org/2005/01/wai-rdf/GUIStateTaxonomy#"
xmlns:waistate="http://www.w3.org/2005/07/aaa"
xhtml2:role="wairole:list"/> <!-- Expose to accessibility APIs as a list -->
<xul:hbox flex="1" class="paneDeckContainer">
<xul:deck anonid="paneDeck" flex="1">
@ -562,7 +562,7 @@
// Expose preference group choice to accessibility APIs as an unchecked list item
// The parent group is exposed to accessibility APIs as a list
radio.setAttributeNS("http://www.w3.org/TR/xhtml2", "role", "wairole:listitem");
radio.setAttributeNS("http://www.w3.org/2005/01/wai-rdf/GUIStateTaxonomy#", "checked", "false");
radio.setAttributeNS("http://www.w3.org/2005/07/aaa", "checked", "false");
if (aPaneElement.image)
radio.setAttribute("src", aPaneElement.image);
radio.style.listStyleImage = aPaneElement.style.listStyleImage;