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

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

Issue 596393004: Add AX attribute for input type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using isTextField() Created 6 years, 2 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/core/accessibility/AXNodeObject.h ('k') | Source/core/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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 if (isTextControl()) 1051 if (isTextControl())
1052 return text(); 1052 return text();
1053 1053
1054 // FIXME: We might need to implement a value here for more types 1054 // FIXME: We might need to implement a value here for more types
1055 // FIXME: It would be better not to advertise a value at all for the types f or which we don't implement one; 1055 // FIXME: It would be better not to advertise a value at all for the types f or which we don't implement one;
1056 // this would require subclassing or making accessibilityAttributeNames do s omething other than return a 1056 // this would require subclassing or making accessibilityAttributeNames do s omething other than return a
1057 // single static array. 1057 // single static array.
1058 return String(); 1058 return String();
1059 } 1059 }
1060 1060
1061
1062 const AtomicString& AXNodeObject::textInputType() const
1063 {
1064 Node* node = this->node();
1065 if (!isHTMLInputElement(node))
1066 return nullAtom;
1067
1068 HTMLInputElement& input = toHTMLInputElement(*node);
1069 if (input.isTextField())
1070 return input.type();
1071 return nullAtom;
1072 }
1073
1061 String AXNodeObject::ariaDescribedByAttribute() const 1074 String AXNodeObject::ariaDescribedByAttribute() const
1062 { 1075 {
1063 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; 1076 WillBeHeapVector<RawPtrWillBeMember<Element> > elements;
1064 elementsFromAttribute(elements, aria_describedbyAttr); 1077 elementsFromAttribute(elements, aria_describedbyAttr);
1065 1078
1066 return accessibilityDescriptionForElements(elements); 1079 return accessibilityDescriptionForElements(elements);
1067 } 1080 }
1068 1081
1069 1082
1070 String AXNodeObject::ariaLabeledByAttribute() const 1083 String AXNodeObject::ariaLabeledByAttribute() const
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 float range = maxValueForRange() - minValueForRange(); 1734 float range = maxValueForRange() - minValueForRange();
1722 float value = valueForRange(); 1735 float value = valueForRange();
1723 1736
1724 value += range * (percentChange / 100); 1737 value += range * (percentChange / 100);
1725 setValue(String::number(value)); 1738 setValue(String::number(value));
1726 1739
1727 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e); 1740 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e);
1728 } 1741 }
1729 1742
1730 } // namespace blink 1743 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXNodeObject.h ('k') | Source/core/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698