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

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

Issue 813473004: Introducing new API placeHolder() to expose placeholder attribute on MAC (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporating comments Created 6 years 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/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | 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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 958
959 const AtomicString& ariaAutoComplete = getAttribute(aria_autocompleteAttr).l ower(); 959 const AtomicString& ariaAutoComplete = getAttribute(aria_autocompleteAttr).l ower();
960 960
961 if (ariaAutoComplete == "inline" || ariaAutoComplete == "list" 961 if (ariaAutoComplete == "inline" || ariaAutoComplete == "list"
962 || ariaAutoComplete == "both") 962 || ariaAutoComplete == "both")
963 return ariaAutoComplete; 963 return ariaAutoComplete;
964 964
965 return String(); 965 return String();
966 } 966 }
967 967
968 String AXNodeObject::placeholder() const
969 {
970 String placeholder = String();
dmazzoni 2014/12/22 08:03:27 The = String() isn't needed; just "String placehol
971 if (node()) {
972 if (isHTMLInputElement(*node())) {
973 HTMLInputElement* inputElement = toHTMLInputElement(node());
974 placeholder = inputElement->strippedPlaceholder();
975 } else if (isHTMLTextAreaElement(*node())) {
976 HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(node()) ;
977 placeholder = textAreaElement->strippedPlaceholder();
978 }
979 }
980 return placeholder;
981 }
982
968 String AXNodeObject::text() const 983 String AXNodeObject::text() const
969 { 984 {
970 // If this is a user defined static text, use the accessible name computatio n. 985 // If this is a user defined static text, use the accessible name computatio n.
971 if (ariaRoleAttribute() == StaticTextRole) 986 if (ariaRoleAttribute() == StaticTextRole)
972 return ariaAccessibilityDescription(); 987 return ariaAccessibilityDescription();
973 988
974 if (!isTextControl()) 989 if (!isTextControl())
975 return String(); 990 return String();
976 991
977 Node* node = this->node(); 992 Node* node = this->node();
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 float range = maxValueForRange() - minValueForRange(); 1866 float range = maxValueForRange() - minValueForRange();
1852 float value = valueForRange(); 1867 float value = valueForRange();
1853 1868
1854 value += range * (percentChange / 100); 1869 value += range * (percentChange / 100);
1855 setValue(String::number(value)); 1870 setValue(String::number(value));
1856 1871
1857 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); 1872 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true);
1858 } 1873 }
1859 1874
1860 } // namespace blink 1875 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.h ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698