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

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

Issue 1047253003: Revert of Expose multiline attribute from blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 return ColorWellRole; 238 return ColorWellRole;
239 if (type == InputTypeNames::time) 239 if (type == InputTypeNames::time)
240 return TimeRole; 240 return TimeRole;
241 return TextFieldRole; 241 return TextFieldRole;
242 } 242 }
243 if (isHTMLSelectElement(*node())) { 243 if (isHTMLSelectElement(*node())) {
244 HTMLSelectElement& selectElement = toHTMLSelectElement(*node()); 244 HTMLSelectElement& selectElement = toHTMLSelectElement(*node());
245 return selectElement.multiple() ? ListBoxRole : PopUpButtonRole; 245 return selectElement.multiple() ? ListBoxRole : PopUpButtonRole;
246 } 246 }
247 if (isHTMLTextAreaElement(*node())) 247 if (isHTMLTextAreaElement(*node()))
248 return TextFieldRole; 248 return TextAreaRole;
249 if (headingLevel()) 249 if (headingLevel())
250 return HeadingRole; 250 return HeadingRole;
251 if (isHTMLDivElement(*node())) 251 if (isHTMLDivElement(*node()))
252 return DivRole; 252 return DivRole;
253 if (isHTMLMeterElement(*node())) 253 if (isHTMLMeterElement(*node()))
254 return MeterRole; 254 return MeterRole;
255 if (isHTMLOutputElement(*node())) 255 if (isHTMLOutputElement(*node()))
256 return StatusRole; 256 return StatusRole;
257 if (isHTMLParagraphElement(*node())) 257 if (isHTMLParagraphElement(*node()))
258 return ParagraphRole; 258 return ParagraphRole;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 AccessibilityRole role = ariaRoleToWebCoreRole(ariaRole); 306 AccessibilityRole role = ariaRoleToWebCoreRole(ariaRole);
307 307
308 // ARIA states if an item can get focus, it should not be presentational. 308 // ARIA states if an item can get focus, it should not be presentational.
309 if ((role == NoneRole || role == PresentationalRole) && canSetFocusAttribute ()) 309 if ((role == NoneRole || role == PresentationalRole) && canSetFocusAttribute ())
310 return UnknownRole; 310 return UnknownRole;
311 311
312 if (role == ButtonRole) 312 if (role == ButtonRole)
313 role = buttonRoleType(); 313 role = buttonRoleType();
314 314
315 if (role == TextAreaRole && !ariaIsMultiline())
316 role = TextFieldRole;
317
315 role = remapAriaRoleDueToParent(role); 318 role = remapAriaRoleDueToParent(role);
316 319
317 if (role) 320 if (role)
318 return role; 321 return role;
319 322
320 return UnknownRole; 323 return UnknownRole;
321 } 324 }
322 325
323 void AXNodeObject::elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Ele ment>>& elements, const QualifiedName& attribute) const 326 void AXNodeObject::elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Ele ment>>& elements, const QualifiedName& attribute) const
324 { 327 {
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 return false; 662 return false;
660 } 663 }
661 664
662 bool AXNodeObject::isPasswordField() const 665 bool AXNodeObject::isPasswordField() const
663 { 666 {
664 Node* node = this->node(); 667 Node* node = this->node();
665 if (!isHTMLInputElement(node)) 668 if (!isHTMLInputElement(node))
666 return false; 669 return false;
667 670
668 AccessibilityRole ariaRole = ariaRoleAttribute(); 671 AccessibilityRole ariaRole = ariaRoleAttribute();
669 if (ariaRole != TextFieldRole) 672 if (ariaRole != TextFieldRole && ariaRole != TextAreaRole)
670 return false; 673 return false;
671 674
672 return toHTMLInputElement(node)->type() == InputTypeNames::password; 675 return toHTMLInputElement(node)->type() == InputTypeNames::password;
673 } 676 }
674 677
675 bool AXNodeObject::isProgressIndicator() const 678 bool AXNodeObject::isProgressIndicator() const
676 { 679 {
677 return roleValue() == ProgressIndicatorRole; 680 return roleValue() == ProgressIndicatorRole;
678 } 681 }
679 682
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 level++; 952 level++;
950 else if (parentRole == TreeRole) 953 else if (parentRole == TreeRole)
951 break; 954 break;
952 } 955 }
953 956
954 return level; 957 return level;
955 } 958 }
956 959
957 String AXNodeObject::ariaAutoComplete() const 960 String AXNodeObject::ariaAutoComplete() const
958 { 961 {
959 if (roleValue() != ComboBoxRole) 962 if (roleValue() != ComboBoxRole && roleValue() != TextAreaRole)
960 return String(); 963 return String();
961 964
962 const AtomicString& ariaAutoComplete = getAttribute(aria_autocompleteAttr).l ower(); 965 const AtomicString& ariaAutoComplete = getAttribute(aria_autocompleteAttr).l ower();
963 966
964 if (ariaAutoComplete == "inline" || ariaAutoComplete == "list" 967 if (ariaAutoComplete == "inline" || ariaAutoComplete == "list"
965 || ariaAutoComplete == "both") 968 || ariaAutoComplete == "both")
966 return ariaAutoComplete; 969 return ariaAutoComplete;
967 970
968 return String(); 971 return String();
969 } 972 }
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 float range = maxValueForRange() - minValueForRange(); 1997 float range = maxValueForRange() - minValueForRange();
1995 float value = valueForRange(); 1998 float value = valueForRange();
1996 1999
1997 value += range * (percentChange / 100); 2000 value += range * (percentChange / 100);
1998 setValue(String::number(value)); 2001 setValue(String::number(value));
1999 2002
2000 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ; 2003 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged) ;
2001 } 2004 }
2002 2005
2003 } // namespace blink 2006 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698