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

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: Remove aria-modal, finish inspector protocol for other 4 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
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 AXContentNodeDataSparseAttributeAdapter(AXContentNodeData* dst) : dst_(dst) { 71 AXContentNodeDataSparseAttributeAdapter(AXContentNodeData* dst) : dst_(dst) {
72 DCHECK(dst_); 72 DCHECK(dst_);
73 } 73 }
74 ~AXContentNodeDataSparseAttributeAdapter() override {} 74 ~AXContentNodeDataSparseAttributeAdapter() override {}
75 75
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 switch (attribute) {
82 default:
83 NOTREACHED();
84 }
82 } 85 }
83 86
84 void addStringAttribute(blink::WebAXStringAttribute attribute, 87 void addStringAttribute(blink::WebAXStringAttribute attribute,
85 const blink::WebString& value) override { 88 const blink::WebString& value) override {
86 NOTREACHED(); 89 switch (attribute) {
90 case blink::WebAXStringAttribute::AriaKeyShortcuts:
91 // TODO(dmazzoni): implement aria-keyshortcuts. http://crbug.com/644766
92 break;
93 case blink::WebAXStringAttribute::AriaRoleDescription:
94 // TODO(dmazzoni): implement aria-roledescription.
95 // http://crbug.com/644766
96 break;
97 default:
98 NOTREACHED();
99 }
87 } 100 }
88 101
89 void addObjectAttribute(blink::WebAXObjectAttribute attribute, 102 void addObjectAttribute(blink::WebAXObjectAttribute attribute,
90 const blink::WebAXObject& value) override { 103 const blink::WebAXObject& value) override {
91 switch (attribute) { 104 switch (attribute) {
92 case blink::WebAXObjectAttribute::AriaActiveDescendant: 105 case blink::WebAXObjectAttribute::AriaActiveDescendant:
93 dst_->AddIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, value.axID()); 106 dst_->AddIntAttribute(ui::AX_ATTR_ACTIVEDESCENDANT_ID, value.axID());
94 break; 107 break;
108 case blink::WebAXObjectAttribute::AriaErrorMessage:
109 // TODO
aboxhall 2017/01/27 01:41:21 TODO needs completing (still TODO?)
dmazzoni 2017/01/31 00:31:54 Coming in the immediately-following change: https
110 break;
95 default: 111 default:
96 NOTREACHED(); 112 NOTREACHED();
97 } 113 }
98 } 114 }
99 115
100 void addObjectVectorAttribute( 116 void addObjectVectorAttribute(
101 blink::WebAXObjectVectorAttribute attribute, 117 blink::WebAXObjectVectorAttribute attribute,
102 const blink::WebVector<WebAXObject>& value) override { 118 const blink::WebVector<WebAXObject>& value) override {
103 switch (attribute) { 119 switch (attribute) {
104 case blink::WebAXObjectVectorAttribute::AriaControls: 120 case blink::WebAXObjectVectorAttribute::AriaControls:
105 AddIntListAttributeFromWebObjects(ui::AX_ATTR_CONTROLS_IDS, value, 121 AddIntListAttributeFromWebObjects(ui::AX_ATTR_CONTROLS_IDS, value,
106 dst_); 122 dst_);
107 break; 123 break;
124 case blink::WebAXObjectVectorAttribute::AriaDetails:
125 // TODO
126 break;
108 case blink::WebAXObjectVectorAttribute::AriaFlowTo: 127 case blink::WebAXObjectVectorAttribute::AriaFlowTo:
109 AddIntListAttributeFromWebObjects(ui::AX_ATTR_FLOWTO_IDS, value, dst_); 128 AddIntListAttributeFromWebObjects(ui::AX_ATTR_FLOWTO_IDS, value, dst_);
110 break; 129 break;
111 default: 130 default:
112 NOTREACHED(); 131 NOTREACHED();
113 } 132 }
114 } 133 }
115 }; 134 };
116 135
117 WebAXObject ParentObjectUnignored(WebAXObject child) { 136 WebAXObject ParentObjectUnignored(WebAXObject child) {
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 return WebAXObject(); 859 return WebAXObject();
841 860
842 WebDocument document = render_frame_->GetWebFrame()->document(); 861 WebDocument document = render_frame_->GetWebFrame()->document();
843 if (!document.isNull()) 862 if (!document.isNull())
844 return document.accessibilityObject(); 863 return document.accessibilityObject();
845 864
846 return WebAXObject(); 865 return WebAXObject();
847 } 866 }
848 867
849 } // namespace content 868 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698