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

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: Move TextInputType to AXNodeObject 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 if (isTextControl()) 1034 if (isTextControl())
1035 return text(); 1035 return text();
1036 1036
1037 // FIXME: We might need to implement a value here for more types 1037 // FIXME: We might need to implement a value here for more types
1038 // FIXME: It would be better not to advertise a value at all for the types f or which we don't implement one; 1038 // FIXME: It would be better not to advertise a value at all for the types f or which we don't implement one;
1039 // this would require subclassing or making accessibilityAttributeNames do s omething other than return a 1039 // this would require subclassing or making accessibilityAttributeNames do s omething other than return a
1040 // single static array. 1040 // single static array.
1041 return String(); 1041 return String();
1042 } 1042 }
1043 1043
1044
1045 const AtomicString& AXNodeObject::textInputType() const
1046 {
1047 Node* node = this->node();
1048 if (!isHTMLInputElement(node))
1049 return nullAtom;
1050
1051 HTMLInputElement& input = toHTMLInputElement(*node);
1052 if (input.type() == InputTypeNames::tel || input.type() == InputTypeNames::u rl
dglazkov 2014/10/01 04:37:11 Should this just be input.isTextField()?
je_julie(Not used) 2014/10/01 04:53:52 I'm referencing to implementation from FireFox for
dmazzoni 2014/10/01 05:22:57 I think isTextField is probably more correct. Sear
1053 || input.type() == InputTypeNames::email || input.type() == InputTypeNam es::search)
1054 return input.type();
1055 return nullAtom;
1056 }
1057
1044 String AXNodeObject::ariaDescribedByAttribute() const 1058 String AXNodeObject::ariaDescribedByAttribute() const
1045 { 1059 {
1046 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; 1060 WillBeHeapVector<RawPtrWillBeMember<Element> > elements;
1047 elementsFromAttribute(elements, aria_describedbyAttr); 1061 elementsFromAttribute(elements, aria_describedbyAttr);
1048 1062
1049 return accessibilityDescriptionForElements(elements); 1063 return accessibilityDescriptionForElements(elements);
1050 } 1064 }
1051 1065
1052 1066
1053 String AXNodeObject::ariaLabeledByAttribute() const 1067 String AXNodeObject::ariaLabeledByAttribute() const
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 float range = maxValueForRange() - minValueForRange(); 1718 float range = maxValueForRange() - minValueForRange();
1705 float value = valueForRange(); 1719 float value = valueForRange();
1706 1720
1707 value += range * (percentChange / 100); 1721 value += range * (percentChange / 100);
1708 setValue(String::number(value)); 1722 setValue(String::number(value));
1709 1723
1710 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e); 1724 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e);
1711 } 1725 }
1712 1726
1713 } // namespace blink 1727 } // 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