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

Unified Diff: Source/core/html/forms/RadioInputType.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/html/forms/RadioInputType.h ('k') | Source/core/html/forms/RangeInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/RadioInputType.cpp
diff --git a/Source/core/html/forms/RadioInputType.cpp b/Source/core/html/forms/RadioInputType.cpp
index 36a2c66bc42a3cbbfdf00fb8457eac8df5aa0e30..7b96112b0229f625446a000931b7471f6aeef62c 100644
--- a/Source/core/html/forms/RadioInputType.cpp
+++ b/Source/core/html/forms/RadioInputType.cpp
@@ -103,7 +103,7 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
HTMLInputElement* inputElement = toHTMLInputElement(htmlElement);
if (inputElement->form() != element().form())
break;
- if (inputElement->isRadioButton() && inputElement->name() == element().name() && inputElement->isFocusable()) {
+ if (inputElement->type() == InputTypeNames::radio && inputElement->name() == element().name() && inputElement->isFocusable()) {
RefPtrWillBeRawPtr<HTMLInputElement> protector(inputElement);
document.setFocusedElement(inputElement);
inputElement->dispatchSimulatedClick(event, SendNoEvents);
@@ -139,7 +139,7 @@ bool RadioInputType::isKeyboardFocusable() const
Element* currentFocusedElement = element().document().focusedElement();
if (isHTMLInputElement(currentFocusedElement)) {
HTMLInputElement& focusedInput = toHTMLInputElement(*currentFocusedElement);
- if (focusedInput.isRadioButton() && focusedInput.form() == element().form() && focusedInput.name() == element().name())
+ if (focusedInput.type() == InputTypeNames::radio && focusedInput.form() == element().form() && focusedInput.name() == element().name())
return false;
}
@@ -179,7 +179,7 @@ void RadioInputType::didDispatchClick(Event* event, const ClickHandlingState& st
// Make sure it is still a radio button and only do the restoration if it still belongs to our group.
HTMLInputElement* checkedRadioButton = state.checkedRadioButton.get();
if (checkedRadioButton
- && checkedRadioButton->isRadioButton()
+ && checkedRadioButton->type() == InputTypeNames::radio
&& checkedRadioButton->form() == element().form()
&& checkedRadioButton->name() == element().name()) {
checkedRadioButton->setChecked(true);
@@ -190,11 +190,6 @@ void RadioInputType::didDispatchClick(Event* event, const ClickHandlingState& st
event->setDefaultHandled();
}
-bool RadioInputType::isRadioButton() const
-{
- return true;
-}
-
bool RadioInputType::shouldAppearIndeterminate() const
{
return !element().checkedRadioButtonForGroup();
« no previous file with comments | « Source/core/html/forms/RadioInputType.h ('k') | Source/core/html/forms/RangeInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698