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

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

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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
Index: Source/core/accessibility/AccessibilityRenderObject.cpp
diff --git a/Source/core/accessibility/AccessibilityRenderObject.cpp b/Source/core/accessibility/AccessibilityRenderObject.cpp
index 4c3e46c034abee7e96ce117976f9a93f5100acba..3d75a94926c03e279e9aac68b9fde11343ed4c07 100644
--- a/Source/core/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/core/accessibility/AccessibilityRenderObject.cpp
@@ -391,7 +391,7 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
return TextAreaRole;
if (node && node->hasTagName(inputTag)) {
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
+ HTMLInputElement* input = toHTMLInputElement(node);
if (input->isCheckbox())
return CheckBoxRole;
if (input->isRadioButton())
@@ -528,7 +528,7 @@ bool AccessibilityRenderObject::isAttachment() const
bool AccessibilityRenderObject::isFileUploadButton() const
{
if (m_renderer && m_renderer->node() && m_renderer->node()->hasTagName(inputTag)) {
- HTMLInputElement* input = static_cast<HTMLInputElement*>(m_renderer->node());
+ HTMLInputElement* input = toHTMLInputElement(m_renderer->node());
return input->isFileUpload();
}
@@ -1109,7 +1109,7 @@ KURL AccessibilityRenderObject::url() const
return static_cast<HTMLImageElement*>(m_renderer->node())->src();
if (isInputImage())
- return static_cast<HTMLInputElement*>(m_renderer->node())->src();
+ return toHTMLInputElement(m_renderer->node())->src();
return KURL();
}
@@ -2066,7 +2066,7 @@ void AccessibilityRenderObject::setValue(const String& string)
// FIXME: Do we want to do anything here for ARIA textboxes?
if (renderer->isTextField()) {
// FIXME: This is not safe! Other elements could have a TextField renderer.
- static_cast<HTMLInputElement*>(element)->setValue(string);
+ toHTMLInputElement(element)->setValue(string);
} else if (renderer->isTextArea()) {
// FIXME: This is not safe! Other elements could have a TextArea renderer.
static_cast<HTMLTextAreaElement*>(element)->setValue(string);
@@ -2683,7 +2683,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
if (!node || !node->hasTagName(inputTag))
return;
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
+ HTMLInputElement* input = toHTMLInputElement(node);
// if there's a form, then this is easy
if (input->form()) {
Vector<RefPtr<Node> > formElements;
@@ -2700,7 +2700,7 @@ void AccessibilityRenderObject::addRadioButtonGroupMembers(AccessibilityChildren
unsigned len = list->length();
for (unsigned i = 0; i < len; ++i) {
if (list->item(i)->hasTagName(inputTag)) {
- HTMLInputElement* associateElement = static_cast<HTMLInputElement*>(list->item(i));
+ HTMLInputElement* associateElement = toHTMLInputElement(list->item(i));
if (associateElement->isRadioButton() && associateElement->name() == input->name()) {
if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement))
linkedUIElements.append(object);
@@ -2977,7 +2977,7 @@ void AccessibilityRenderObject::addTextFieldChildren()
if (!node || !node->hasTagName(inputTag))
return;
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
+ HTMLInputElement* input = toHTMLInputElement(node);
HTMLElement* spinButtonElement = input->innerSpinButtonElement();
if (!spinButtonElement || !spinButtonElement->isSpinButtonElement())
return;
« no previous file with comments | « Source/core/accessibility/AccessibilityNodeObject.cpp ('k') | Source/core/accessibility/AccessibilitySlider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698