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

Unified Diff: Source/core/html/forms/CheckboxInputType.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/CheckboxInputType.h ('k') | Source/core/html/forms/ColorInputType.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/CheckboxInputType.cpp
diff --git a/Source/core/html/forms/CheckboxInputType.cpp b/Source/core/html/forms/CheckboxInputType.cpp
index 8fe408c21dccacebf807dd1b70d0b026eb560ad7..19df75fbdd9f8e1c36154077b094dd880c8f7489 100644
--- a/Source/core/html/forms/CheckboxInputType.cpp
+++ b/Source/core/html/forms/CheckboxInputType.cpp
@@ -40,7 +40,7 @@
namespace WebCore {
-PassRefPtr<InputType> CheckboxInputType::create(HTMLInputElement* element)
+PassRefPtr<InputType> CheckboxInputType::create(HTMLInputElement& element)
{
return adoptRef(new CheckboxInputType(element));
}
@@ -52,7 +52,7 @@ const AtomicString& CheckboxInputType::formControlType() const
bool CheckboxInputType::valueMissing(const String&) const
{
- return element()->isRequired() && !element()->checked();
+ return element().isRequired() && !element().checked();
}
String CheckboxInputType::valueMissingText() const
@@ -75,13 +75,13 @@ PassOwnPtr<ClickHandlingState> CheckboxInputType::willDispatchClick()
OwnPtr<ClickHandlingState> state = adoptPtr(new ClickHandlingState);
- state->checked = element()->checked();
- state->indeterminate = element()->indeterminate();
+ state->checked = element().checked();
+ state->indeterminate = element().indeterminate();
if (state->indeterminate)
- element()->setIndeterminate(false);
+ element().setIndeterminate(false);
- element()->setChecked(!state->checked, DispatchChangeEvent);
+ element().setChecked(!state->checked, DispatchChangeEvent);
return state.release();
}
@@ -89,8 +89,8 @@ PassOwnPtr<ClickHandlingState> CheckboxInputType::willDispatchClick()
void CheckboxInputType::didDispatchClick(Event* event, const ClickHandlingState& state)
{
if (event->defaultPrevented() || event->defaultHandled()) {
- element()->setIndeterminate(state.indeterminate);
- element()->setChecked(state.checked);
+ element().setIndeterminate(state.indeterminate);
+ element().setChecked(state.checked);
}
// The work we did in willDispatchClick was default handling.
« no previous file with comments | « Source/core/html/forms/CheckboxInputType.h ('k') | Source/core/html/forms/ColorInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698