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

Unified Diff: Source/core/html/forms/HiddenInputType.cpp

Issue 27746003: Have InputType factories take an HTMLInputElement reference in parameter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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/HiddenInputType.h ('k') | Source/core/html/forms/ImageInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/HiddenInputType.cpp
diff --git a/Source/core/html/forms/HiddenInputType.cpp b/Source/core/html/forms/HiddenInputType.cpp
index 512522e749e129a24d3d3179a9f5fd3e3ba0e1f2..2a9a0ea69dbf136ef099771388d84ae6970eb470 100644
--- a/Source/core/html/forms/HiddenInputType.cpp
+++ b/Source/core/html/forms/HiddenInputType.cpp
@@ -43,7 +43,7 @@ namespace WebCore {
using namespace HTMLNames;
-PassRefPtr<InputType> HiddenInputType::create(HTMLInputElement* element)
+PassRefPtr<InputType> HiddenInputType::create(HTMLInputElement& element)
{
return adoptRef(new HiddenInputType(element));
}
@@ -59,12 +59,12 @@ FormControlState HiddenInputType::saveFormControlState() const
// controls create by createElement() or cloneNode(). It's ok for
// now because we restore values only to form controls created by
// parsing.
- return element()->valueAttributeWasUpdatedAfterParsing() ? FormControlState(element()->value()) : FormControlState();
+ return element().valueAttributeWasUpdatedAfterParsing() ? FormControlState(element().value()) : FormControlState();
}
void HiddenInputType::restoreFormControlState(const FormControlState& state)
{
- element()->setAttribute(valueAttr, state[0]);
+ element().setAttribute(valueAttr, state[0]);
}
bool HiddenInputType::supportsValidation() const
@@ -94,7 +94,7 @@ bool HiddenInputType::storesValueSeparateFromAttribute()
void HiddenInputType::setValue(const String& sanitizedValue, bool, TextFieldEventBehavior)
{
- element()->setAttribute(valueAttr, sanitizedValue);
+ element().setAttribute(valueAttr, sanitizedValue);
}
bool HiddenInputType::isHiddenType() const
@@ -104,8 +104,8 @@ bool HiddenInputType::isHiddenType() const
bool HiddenInputType::appendFormData(FormDataList& encoding, bool isMultipartForm) const
{
- if (equalIgnoringCase(element()->name(), "_charset_")) {
- encoding.appendData(element()->name(), String(encoding.encoding().name()));
+ if (equalIgnoringCase(element().name(), "_charset_")) {
+ encoding.appendData(element().name(), String(encoding.encoding().name()));
return true;
}
return InputType::appendFormData(encoding, isMultipartForm);
« no previous file with comments | « Source/core/html/forms/HiddenInputType.h ('k') | Source/core/html/forms/ImageInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698