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

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

Issue 557613002: Remove a part of type checking predicates of HTMLInputElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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/AXNodeObject.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXRenderObject.cpp
diff --git a/Source/core/accessibility/AXRenderObject.cpp b/Source/core/accessibility/AXRenderObject.cpp
index 3a6c45b7e48aa3d03685fef75879044ec81cdb00..d048503795b4c2dfe36ccc0a60e2e3997c672a5b 100644
--- a/Source/core/accessibility/AXRenderObject.cpp
+++ b/Source/core/accessibility/AXRenderObject.cpp
@@ -30,6 +30,7 @@
#include "core/accessibility/AXRenderObject.h"
#include "bindings/core/v8/ExceptionStatePlaceholder.h"
+#include "core/InputTypeNames.h"
#include "core/accessibility/AXImageMapLink.h"
#include "core/accessibility/AXInlineTextBox.h"
#include "core/accessibility/AXObjectCache.h"
@@ -304,15 +305,14 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole()
if (isHTMLInputElement(node)) {
HTMLInputElement& input = toHTMLInputElement(*node);
- if (input.isCheckbox())
+ const AtomicString& type = input.type();
+ if (type == InputTypeNames::checkbox)
return CheckBoxRole;
- if (input.isRadioButton())
+ if (type == InputTypeNames::radio)
return RadioButtonRole;
if (input.isTextButton())
return buttonRoleType();
-
- const AtomicString& type = input.getAttribute(typeAttr);
- if (equalIgnoringCase(type, "color"))
+ if (type == InputTypeNames::color)
return ColorWellRole;
}
@@ -450,12 +450,7 @@ bool AXRenderObject::isAttachment() const
bool AXRenderObject::isFileUploadButton() const
{
- if (m_renderer && isHTMLInputElement(m_renderer->node())) {
- HTMLInputElement& input = toHTMLInputElement(*m_renderer->node());
- return input.isFileUpload();
- }
-
- return false;
+ return m_renderer && isHTMLInputElement(m_renderer->node()) && toHTMLInputElement(*m_renderer->node()).type() == InputTypeNames::file;
}
static bool isLinkable(const AXObject& object)
« no previous file with comments | « Source/core/accessibility/AXNodeObject.cpp ('k') | Source/core/editing/FrameSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698