Index: Source/core/accessibility/AccessibilityNodeObject.cpp |
diff --git a/Source/core/accessibility/AccessibilityNodeObject.cpp b/Source/core/accessibility/AccessibilityNodeObject.cpp |
index b4e81226c12c4d81df31649b764341781bc4600f..0e71ec4bb4cf7276650956b890207a3a5614147c 100644 |
--- a/Source/core/accessibility/AccessibilityNodeObject.cpp |
+++ b/Source/core/accessibility/AccessibilityNodeObject.cpp |
@@ -78,7 +78,7 @@ static String accessibleNameForNode(Node* node) |
return toText(node)->data(); |
if (node->hasTagName(inputTag)) |
- return static_cast<HTMLInputElement*>(node)->value(); |
+ return toHTMLInputElement(node)->value(); |
if (node->isHTMLElement()) { |
const AtomicString& alt = toHTMLElement(node)->getAttribute(altAttr); |
@@ -183,7 +183,7 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole() |
if (node()->hasTagName(buttonTag)) |
return buttonRoleType(); |
if (node()->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); |
+ HTMLInputElement* input = toHTMLInputElement(node()); |
if (input->isCheckbox()) |
return CheckBoxRole; |
if (input->isRadioButton()) |
@@ -533,10 +533,8 @@ bool AccessibilityNodeObject::isInputImage() const |
if (!node) |
return false; |
- if (roleValue() == ButtonRole && node->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node); |
- return input->isImageButton(); |
- } |
+ if (roleValue() == ButtonRole && node->hasTagName(inputTag)) |
+ return toHTMLInputElement(node)->isImageButton(); |
return false; |
} |
@@ -615,10 +613,8 @@ bool AccessibilityNodeObject::isNativeImage() const |
if (node->hasTagName(appletTag) || node->hasTagName(embedTag) || node->hasTagName(objectTag)) |
return true; |
- if (node->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node); |
- return input->isImageButton(); |
- } |
+ if (node->hasTagName(inputTag)) |
+ return toHTMLInputElement(node)->isImageButton(); |
return false; |
} |
@@ -633,7 +629,7 @@ bool AccessibilityNodeObject::isNativeTextControl() const |
return true; |
if (node->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node); |
+ HTMLInputElement* input = toHTMLInputElement(node); |
return input->isText() || input->isNumberField(); |
} |
@@ -773,7 +769,7 @@ bool AccessibilityNodeObject::isReadOnly() const |
return static_cast<HTMLTextAreaElement*>(node)->isReadOnly(); |
if (node->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node); |
+ HTMLInputElement* input = toHTMLInputElement(node); |
if (input->isTextField()) |
return input->isReadOnly(); |
} |
@@ -936,7 +932,7 @@ void AccessibilityNodeObject::colorValue(int& r, int& g, int& b) const |
if (!node() || !node()->hasTagName(inputTag)) |
return; |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); |
+ HTMLInputElement* input = toHTMLInputElement(node()); |
const AtomicString& type = input->getAttribute(typeAttr); |
if (!equalIgnoringCase(type, "color")) |
return; |
@@ -959,7 +955,7 @@ String AccessibilityNodeObject::valueDescription() const |
float AccessibilityNodeObject::valueForRange() const |
{ |
if (node() && node()->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); |
+ HTMLInputElement* input = toHTMLInputElement(node()); |
if (input->isRangeControl()) |
return input->valueAsNumber(); |
} |
@@ -973,7 +969,7 @@ float AccessibilityNodeObject::valueForRange() const |
float AccessibilityNodeObject::maxValueForRange() const |
{ |
if (node() && node()->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); |
+ HTMLInputElement* input = toHTMLInputElement(node()); |
if (input->isRangeControl()) |
return input->maximum(); |
} |
@@ -987,7 +983,7 @@ float AccessibilityNodeObject::maxValueForRange() const |
float AccessibilityNodeObject::minValueForRange() const |
{ |
if (node() && node()->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node()); |
+ HTMLInputElement* input = toHTMLInputElement(node()); |
if (input->isRangeControl()) |
return input->minimum(); |
} |
@@ -1207,7 +1203,7 @@ String AccessibilityNodeObject::title() const |
bool isInputTag = node->hasTagName(inputTag); |
if (isInputTag) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node); |
+ HTMLInputElement* input = toHTMLInputElement(node); |
if (input->isTextButton()) |
return input->valueWithDefault(); |
} |
@@ -1458,7 +1454,7 @@ Element* AccessibilityNodeObject::actionElement() const |
return 0; |
if (node->hasTagName(inputTag)) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node); |
+ HTMLInputElement* input = toHTMLInputElement(node); |
if (!input->isDisabledFormControl() && (isCheckboxOrRadio() || input->isTextButton())) |
return input; |
} else if (node->hasTagName(buttonTag)) |
@@ -1735,7 +1731,7 @@ void AccessibilityNodeObject::visibleText(Vector<AccessibilityText>& textOrder) |
bool isInputTag = node->hasTagName(inputTag); |
if (isInputTag) { |
- HTMLInputElement* input = static_cast<HTMLInputElement*>(node); |
+ HTMLInputElement* input = toHTMLInputElement(node); |
if (input->isTextButton()) { |
textOrder.append(AccessibilityText(input->valueWithDefault(), VisibleText)); |
return; |