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

Side by Side Diff: Source/modules/accessibility/InspectorAccessibilityAgent.cpp

Issue 1045693002: Expose multiline attribute from blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reland Created 5 years, 8 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 | « Source/modules/accessibility/AXObject.cpp ('k') | Source/web/AssertMatchingEnums.cpp » ('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 "config.h" 5 #include "config.h"
6 6
7 #include "modules/accessibility/InspectorAccessibilityAgent.h" 7 #include "modules/accessibility/InspectorAccessibilityAgent.h"
8 8
9 #include "core/dom/AXObjectCache.h" 9 #include "core/dom/AXObjectCache.h"
10 #include "core/dom/DOMNodeIds.h" 10 #include "core/dom/DOMNodeIds.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 return role == GridRole || role == ListBoxRole || role == TabListRole || rol e == TreeGridRole || role == TreeRole; 206 return role == GridRole || role == ListBoxRole || role == TabListRole || rol e == TreeGridRole || role == TreeRole;
207 } 207 }
208 208
209 bool roleAllowsOrientation(AccessibilityRole role) 209 bool roleAllowsOrientation(AccessibilityRole role)
210 { 210 {
211 return role == ScrollBarRole || role == SplitterRole || role == SliderRole; 211 return role == ScrollBarRole || role == SplitterRole || role == SliderRole;
212 } 212 }
213 213
214 bool roleAllowsReadonly(AccessibilityRole role) 214 bool roleAllowsReadonly(AccessibilityRole role)
215 { 215 {
216 return role == GridRole || role == CellRole || role == TextAreaRole || role == TextFieldRole || role == ColumnHeaderRole || role == RowHeaderRole || role == TreeGridRole; 216 return role == GridRole || role == CellRole || role == TextFieldRole || role == ColumnHeaderRole || role == RowHeaderRole || role == TreeGridRole;
217 } 217 }
218 218
219 bool roleAllowsRequired(AccessibilityRole role) 219 bool roleAllowsRequired(AccessibilityRole role)
220 { 220 {
221 return role == ComboBoxRole || role == CellRole || role == ListBoxRole || ro le == RadioGroupRole || role == SpinButtonRole || role == TextAreaRole || role = = TextFieldRole || role == TreeRole || role == ColumnHeaderRole || role == RowHe aderRole || role == TreeGridRole; 221 return role == ComboBoxRole || role == CellRole || role == ListBoxRole || ro le == RadioGroupRole || role == SpinButtonRole || role == TextFieldRole || role == TreeRole || role == ColumnHeaderRole || role == RowHeaderRole || role == Tree GridRole;
222 } 222 }
223 223
224 bool roleAllowsSort(AccessibilityRole role) 224 bool roleAllowsSort(AccessibilityRole role)
225 { 225 {
226 return role == ColumnHeaderRole || role == RowHeaderRole; 226 return role == ColumnHeaderRole || role == RowHeaderRole;
227 } 227 }
228 228
229 bool roleAllowsRangeValues(AccessibilityRole role) 229 bool roleAllowsRangeValues(AccessibilityRole role)
230 { 230 {
231 return role == ProgressIndicatorRole || role == ScrollBarRole || role == Sli derRole || role == SpinButtonRole; 231 return role == ProgressIndicatorRole || role == ScrollBarRole || role == Sli derRole || role == SpinButtonRole;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 break; 273 break;
274 case AccessibilityOrientationHorizontal: 274 case AccessibilityOrientationHorizontal:
275 properties->addItem(createProperty(AXWidgetAttributes::Orientation, createValue("horizontal", AXValueType::Token))); 275 properties->addItem(createProperty(AXWidgetAttributes::Orientation, createValue("horizontal", AXValueType::Token)));
276 break; 276 break;
277 case AccessibilityOrientationUndefined: 277 case AccessibilityOrientationUndefined:
278 break; 278 break;
279 } 279 }
280 } 280 }
281 281
282 if (role == TextFieldRole) 282 if (role == TextFieldRole)
283 properties->addItem(createProperty(AXWidgetAttributes::Multiline, create BooleanValue(false))); 283 properties->addItem(createProperty(AXWidgetAttributes::Multiline, create BooleanValue(axObject->isMultiline())));
284 else if (role == TextAreaRole)
285 properties->addItem(createProperty(AXWidgetAttributes::Multiline, create BooleanValue(true)));
286 284
287 if (roleAllowsReadonly(role)) { 285 if (roleAllowsReadonly(role)) {
288 properties->addItem(createProperty(AXWidgetAttributes::Readonly, createB ooleanValue(axObject->isReadOnly()))); 286 properties->addItem(createProperty(AXWidgetAttributes::Readonly, createB ooleanValue(axObject->isReadOnly())));
289 } 287 }
290 288
291 if (roleAllowsRequired(role)) { 289 if (roleAllowsRequired(role)) {
292 properties->addItem(createProperty(AXWidgetAttributes::Required, createB ooleanValue(axObject->isRequired()))); 290 properties->addItem(createProperty(AXWidgetAttributes::Required, createB ooleanValue(axObject->isRequired())));
293 } 291 }
294 292
295 if (roleAllowsSort(role)) { 293 if (roleAllowsSort(role)) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties ); 441 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties );
444 } 442 }
445 443
446 DEFINE_TRACE(InspectorAccessibilityAgent) 444 DEFINE_TRACE(InspectorAccessibilityAgent)
447 { 445 {
448 visitor->trace(m_page); 446 visitor->trace(m_page);
449 InspectorBaseAgent::trace(visitor); 447 InspectorBaseAgent::trace(visitor);
450 } 448 }
451 449
452 } // namespace blink 450 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObject.cpp ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698