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

Side by Side Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 2653063002: Add 4 ARIA 1.1 attributes using new sparse attribute interface. (Closed)
Patch Set: Rebase Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-aria-1.1.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/accessibility/blink_ax_tree_source.h" 5 #include "content/renderer/accessibility/blink_ax_tree_source.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 private: 76 private:
77 AXContentNodeData* dst_; 77 AXContentNodeData* dst_;
78 78
79 void addBoolAttribute(blink::WebAXBoolAttribute attribute, 79 void addBoolAttribute(blink::WebAXBoolAttribute attribute,
80 bool value) override { 80 bool value) override {
81 NOTREACHED(); 81 NOTREACHED();
82 } 82 }
83 83
84 void addStringAttribute(blink::WebAXStringAttribute attribute, 84 void addStringAttribute(blink::WebAXStringAttribute attribute,
85 const blink::WebString& value) override { 85 const blink::WebString& value) override {
86 NOTREACHED(); 86 switch (attribute) {
87 case blink::WebAXStringAttribute::AriaKeyShortcuts:
88 // TODO(dmazzoni): implement aria-keyshortcuts. http://crbug.com/644766
89 break;
90 case blink::WebAXStringAttribute::AriaRoleDescription:
91 // TODO(dmazzoni): implement aria-roledescription.
92 // http://crbug.com/644766
93 break;
94 default:
95 NOTREACHED();
96 }
87 } 97 }
88 98
89 void addObjectAttribute(blink::WebAXObjectAttribute attribute, 99 void addObjectAttribute(blink::WebAXObjectAttribute attribute,
90 const blink::WebAXObject& value) override { 100 const blink::WebAXObject& value) override {
91 switch (attribute) { 101 switch (attribute) {
92 case blink::WebAXObjectAttribute::AriaActiveDescendant: 102 case blink::WebAXObjectAttribute::AriaActiveDescendant:
93 dst_->AddIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, value.axID()); 103 dst_->AddIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, value.axID());
94 break; 104 break;
105 case blink::WebAXObjectAttribute::AriaErrorMessage:
106 // TODO(dmazzoni): implement aria-errormessage.
107 // http://crbug.com/644766
108 break;
95 default: 109 default:
96 NOTREACHED(); 110 NOTREACHED();
97 } 111 }
98 } 112 }
99 113
100 void addObjectVectorAttribute( 114 void addObjectVectorAttribute(
101 blink::WebAXObjectVectorAttribute attribute, 115 blink::WebAXObjectVectorAttribute attribute,
102 const blink::WebVector<WebAXObject>& value) override { 116 const blink::WebVector<WebAXObject>& value) override {
103 switch (attribute) { 117 switch (attribute) {
104 case blink::WebAXObjectVectorAttribute::AriaControls: 118 case blink::WebAXObjectVectorAttribute::AriaControls:
105 AddIntListAttributeFromWebObjects(ui::AX_ATTR_CONTROLS_IDS, value, 119 AddIntListAttributeFromWebObjects(ui::AX_ATTR_CONTROLS_IDS, value,
106 dst_); 120 dst_);
107 break; 121 break;
122 case blink::WebAXObjectVectorAttribute::AriaDetails:
123 // TODO(dmazzoni): implement aria-details. http://crbug.com/644766
124 break;
108 case blink::WebAXObjectVectorAttribute::AriaFlowTo: 125 case blink::WebAXObjectVectorAttribute::AriaFlowTo:
109 AddIntListAttributeFromWebObjects(ui::AX_ATTR_FLOWTO_IDS, value, dst_); 126 AddIntListAttributeFromWebObjects(ui::AX_ATTR_FLOWTO_IDS, value, dst_);
110 break; 127 break;
111 default: 128 default:
112 NOTREACHED(); 129 NOTREACHED();
113 } 130 }
114 } 131 }
115 }; 132 };
116 133
117 WebAXObject ParentObjectUnignored(WebAXObject child) { 134 WebAXObject ParentObjectUnignored(WebAXObject child) {
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 return WebAXObject(); 857 return WebAXObject();
841 858
842 WebDocument document = render_frame_->GetWebFrame()->document(); 859 WebDocument document = render_frame_->GetWebFrame()->document();
843 if (!document.isNull()) 860 if (!document.isNull())
844 return document.accessibilityObject(); 861 return document.accessibilityObject();
845 862
846 return WebAXObject(); 863 return WebAXObject();
847 } 864 }
848 865
849 } // namespace content 866 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-aria-1.1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698