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

Unified Diff: Source/core/accessibility/AXObject.cpp

Issue 596393004: Add AX attribute for input type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/accessibility/AXObject.h ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXObject.cpp
diff --git a/Source/core/accessibility/AXObject.cpp b/Source/core/accessibility/AXObject.cpp
index 1b68e94a7fbcf98e1e814eefba9b4962f64e4a8b..f6fe5786a6758029fecb4499757a64bce70d4457 100644
--- a/Source/core/accessibility/AXObject.cpp
+++ b/Source/core/accessibility/AXObject.cpp
@@ -29,6 +29,7 @@
#include "config.h"
#include "core/accessibility/AXObject.h"
+#include "core/InputTypeNames.h"
#include "core/accessibility/AXObjectCache.h"
#include "core/dom/NodeTraversal.h"
#include "core/editing/VisibleUnits.h"
@@ -630,6 +631,25 @@ const AtomicString& AXObject::getAttribute(const QualifiedName& attribute) const
return element->fastGetAttribute(attribute);
}
+const AtomicString& AXObject::textInputType() const
dmazzoni 2014/09/26 15:17:26 This looks great, but please move it to AXNodeObje
je_julie(Not used) 2014/09/27 09:05:46 Thanks. I'll update it. On 2014/09/26 15:17:26, dm
+{
+ Node* elementNode = node();
+ if (!elementNode)
+ return nullAtom;
+
+ if (!elementNode->isElementNode() ||!isHTMLInputElement(*elementNode))
dmazzoni 2014/09/26 15:17:26 nit: space between || and !
je_julie(Not used) 2014/09/27 09:05:46 Thanks, I'll update it. On 2014/09/26 15:17:26, dm
+ return nullAtom;
+
+ Element* element = toElement(elementNode);
+ const AtomicString& value = element->fastGetAttribute(typeAttr);
+
+ if (equalIgnoringCase(value, InputTypeNames::tel) || equalIgnoringCase(value, InputTypeNames::url)
+ || equalIgnoringCase(value, InputTypeNames::email) || equalIgnoringCase(value, InputTypeNames::search))
+ return value;
+
+ return nullAtom;
+}
+
bool AXObject::press() const
{
Element* actionElem = actionElement();
« no previous file with comments | « Source/core/accessibility/AXObject.h ('k') | Source/web/WebAXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698