Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp

Issue 2587343004: Finish implementation and tests of 5 ARIA 1.1 attributes. (Closed)
Patch Set: Rebase on previous change Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
index a3c0f837ae6b3a2d4a3e82454de75b6ee740cf4b..e9487a3ca677c164c5bb523e8fa9f14cc9565e9a 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
@@ -156,6 +156,10 @@ bool roleAllowsSelected(AccessibilityRole role) {
role == RowHeaderRole || role == TreeItemRole;
}
+bool roleAllowsModal(AccessibilityRole role) {
+ return role == DialogRole || role == AlertDialogRole;
+}
+
void fillWidgetProperties(AXObject& axObject,
protocol::Array<AXProperty>& properties) {
AccessibilityRole role = axObject.roleValue();
@@ -344,7 +348,10 @@ class SparseAttributeAXPropertyAdapter
void addBoolAttribute(AXBoolAttribute attribute, bool value) {
switch (attribute) {
case AXBoolAttribute::AriaModal:
- // TODO
+ if (roleAllowsModal(m_axObject->roleValue())) {
+ m_properties.addItem(createProperty(AXWidgetStatesEnum::Modal,
+ createBooleanValue(value)));
+ }
break;
}
}
@@ -352,10 +359,12 @@ class SparseAttributeAXPropertyAdapter
void addStringAttribute(AXStringAttribute attribute, const String& value) {
switch (attribute) {
case AXStringAttribute::AriaKeyShortcuts:
- // TODO
+ m_properties.addItem(createProperty(
+ AXWidgetAttributesEnum::Keyshortcuts, createValue(value)));
break;
case AXStringAttribute::AriaRoleDescription:
- // TODO
+ m_properties.addItem(createProperty(
+ AXWidgetAttributesEnum::Roledescription, createValue(value)));
break;
}
}
@@ -368,7 +377,9 @@ class SparseAttributeAXPropertyAdapter
createRelatedNodeListValue(*object)));
break;
case AXObjectAttribute::AriaErrorMessage:
- // TODO
+ m_properties.addItem(
+ createProperty(AXRelationshipAttributesEnum::Errormessage,
+ createRelatedNodeListValue(*object)));
break;
}
}
@@ -382,7 +393,9 @@ class SparseAttributeAXPropertyAdapter
*m_axObject));
break;
case AXObjectVectorAttribute::AriaDetails:
- // TODO
+ m_properties.addItem(createRelatedNodeListProperty(
+ AXRelationshipAttributesEnum::Details, objects, aria_controlsAttr,
+ *m_axObject));
break;
case AXObjectVectorAttribute::AriaFlowTo:
m_properties.addItem(createRelatedNodeListProperty(
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698