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

Unified Diff: Source/web/WebFormControlElement.cpp

Issue 200723002: Use new is*Element() helper functions more in web/ code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use same assertion as in operator->() Created 6 years, 9 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/web/TextFinder.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFormControlElement.cpp
diff --git a/Source/web/WebFormControlElement.cpp b/Source/web/WebFormControlElement.cpp
index 585260f9128cf504a3271050c653b73089137eba..bbabc8e918b81a41942c956d7341519a16caea12 100644
--- a/Source/web/WebFormControlElement.cpp
+++ b/Source/web/WebFormControlElement.cpp
@@ -85,91 +85,91 @@ WebString WebFormControlElement::nameForAutofill() const
bool WebFormControlElement::autoComplete() const
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
return constUnwrap<HTMLInputElement>()->shouldAutocomplete();
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
return constUnwrap<HTMLTextAreaElement>()->shouldAutocomplete();
return false;
}
void WebFormControlElement::setValue(const WebString& value, bool sendChangeEvent)
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
unwrap<HTMLInputElement>()->setValue(value, sendChangeEvent ? DispatchChangeEvent : DispatchNoEvent);
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
unwrap<HTMLTextAreaElement>()->setValue(value);
- if (m_private->hasTagName(HTMLNames::selectTag))
+ if (isHTMLSelectElement(*m_private))
unwrap<HTMLSelectElement>()->setValue(value);
}
WebString WebFormControlElement::value() const
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
return constUnwrap<HTMLInputElement>()->value();
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
return constUnwrap<HTMLTextAreaElement>()->value();
- if (m_private->hasTagName(HTMLNames::selectTag))
+ if (isHTMLSelectElement(*m_private))
return constUnwrap<HTMLSelectElement>()->value();
return WebString();
}
void WebFormControlElement::setSuggestedValue(const WebString& value)
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
unwrap<HTMLInputElement>()->setSuggestedValue(value);
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
unwrap<HTMLTextAreaElement>()->setSuggestedValue(value);
}
WebString WebFormControlElement::suggestedValue() const
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
return constUnwrap<HTMLInputElement>()->suggestedValue();
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
return constUnwrap<HTMLTextAreaElement>()->suggestedValue();
return WebString();
}
WebString WebFormControlElement::editingValue() const
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
return constUnwrap<HTMLInputElement>()->innerTextValue();
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
return constUnwrap<HTMLTextAreaElement>()->innerTextValue();
return WebString();
}
void WebFormControlElement::setSelectionRange(int start, int end)
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
unwrap<HTMLInputElement>()->setSelectionRange(start, end);
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
unwrap<HTMLTextAreaElement>()->setSelectionRange(start, end);
}
int WebFormControlElement::selectionStart() const
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
return constUnwrap<HTMLInputElement>()->selectionStart();
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
return constUnwrap<HTMLTextAreaElement>()->selectionStart();
return 0;
}
int WebFormControlElement::selectionEnd() const
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
return constUnwrap<HTMLInputElement>()->selectionEnd();
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
return constUnwrap<HTMLTextAreaElement>()->selectionEnd();
return 0;
}
WebString WebFormControlElement::directionForFormData() const
{
- if (m_private->hasTagName(HTMLNames::inputTag))
+ if (isHTMLInputElement(*m_private))
return constUnwrap<HTMLInputElement>()->directionForFormData();
- if (m_private->hasTagName(HTMLNames::textareaTag))
+ if (isHTMLTextAreaElement(*m_private))
return constUnwrap<HTMLTextAreaElement>()->directionForFormData();
return WebString();
}
« no previous file with comments | « Source/web/TextFinder.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698