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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 2886243002: Multiselectable touchups for ARIA widgets (Closed)
Patch Set: Fix tests Created 3 years, 7 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 | « third_party/WebKit/Source/modules/accessibility/AXARIAGrid.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 1040
1041 bool AXNodeObject::IsMenuButton() const { 1041 bool AXNodeObject::IsMenuButton() const {
1042 return RoleValue() == kMenuButtonRole; 1042 return RoleValue() == kMenuButtonRole;
1043 } 1043 }
1044 1044
1045 bool AXNodeObject::IsMeter() const { 1045 bool AXNodeObject::IsMeter() const {
1046 return RoleValue() == kMeterRole; 1046 return RoleValue() == kMeterRole;
1047 } 1047 }
1048 1048
1049 bool AXNodeObject::IsMultiSelectable() const { 1049 bool AXNodeObject::IsMultiSelectable() const {
1050 bool multiselectable = false; 1050 switch (RoleValue()) {
1051 if (HasAOMPropertyOrARIAAttribute(AOMBooleanProperty::kMultiselectable, 1051 case kGridRole:
1052 multiselectable)) { 1052 case kTreeGridRole:
1053 return multiselectable; 1053 case kTreeRole:
1054 case kListBoxRole:
1055 case kTabListRole: {
1056 bool multiselectable = false;
1057 if (HasAOMPropertyOrARIAAttribute(AOMBooleanProperty::kMultiselectable,
1058 multiselectable)) {
1059 return multiselectable;
1060 }
1061
1062 return isHTMLSelectElement(GetNode()) &&
dmazzoni 2017/05/19 19:40:56 I'm not sure this covers all of the possible roles
1063 toHTMLSelectElement(*GetNode()).IsMultiple();
1064 }
1065 default:
1066 break;
1054 } 1067 }
1055 1068
1056 return isHTMLSelectElement(GetNode()) && 1069 return false;
1057 toHTMLSelectElement(*GetNode()).IsMultiple();
1058 } 1070 }
1059 1071
1060 bool AXNodeObject::IsNativeCheckboxOrRadio() const { 1072 bool AXNodeObject::IsNativeCheckboxOrRadio() const {
1061 Node* node = this->GetNode(); 1073 Node* node = this->GetNode();
1062 if (!isHTMLInputElement(node)) 1074 if (!isHTMLInputElement(node))
1063 return false; 1075 return false;
1064 1076
1065 HTMLInputElement* input = toHTMLInputElement(node); 1077 HTMLInputElement* input = toHTMLInputElement(node);
1066 return input->type() == InputTypeNames::checkbox || 1078 return input->type() == InputTypeNames::checkbox ||
1067 input->type() == InputTypeNames::radio; 1079 input->type() == InputTypeNames::radio;
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after
3226 return String(); 3238 return String();
3227 return ToTextControlElement(node)->StrippedPlaceholder(); 3239 return ToTextControlElement(node)->StrippedPlaceholder();
3228 } 3240 }
3229 3241
3230 DEFINE_TRACE(AXNodeObject) { 3242 DEFINE_TRACE(AXNodeObject) {
3231 visitor->Trace(node_); 3243 visitor->Trace(node_);
3232 AXObjectImpl::Trace(visitor); 3244 AXObjectImpl::Trace(visitor);
3233 } 3245 }
3234 3246
3235 } // namespace blink 3247 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXARIAGrid.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698