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

Unified Diff: Source/core/html/HTMLButtonElement.cpp

Issue 1186823007: Code cleanup in core/html/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/HTMLBodyElement.cpp ('k') | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLButtonElement.cpp
diff --git a/Source/core/html/HTMLButtonElement.cpp b/Source/core/html/HTMLButtonElement.cpp
index ff5e93197be8f42c862c36420be27bdcf34a4f4d..70f007e25d3828e3fdcbdd67a201fec7821e4c2b 100644
--- a/Source/core/html/HTMLButtonElement.cpp
+++ b/Source/core/html/HTMLButtonElement.cpp
@@ -64,18 +64,18 @@ LayoutObject* HTMLButtonElement::createLayoutObject(const ComputedStyle&)
const AtomicString& HTMLButtonElement::formControlType() const
{
switch (m_type) {
- case SUBMIT: {
- DEFINE_STATIC_LOCAL(const AtomicString, submit, ("submit", AtomicString::ConstructFromLiteral));
- return submit;
- }
- case BUTTON: {
- DEFINE_STATIC_LOCAL(const AtomicString, button, ("button", AtomicString::ConstructFromLiteral));
- return button;
- }
- case RESET: {
- DEFINE_STATIC_LOCAL(const AtomicString, reset, ("reset", AtomicString::ConstructFromLiteral));
- return reset;
- }
+ case SUBMIT: {
+ DEFINE_STATIC_LOCAL(const AtomicString, submit, ("submit", AtomicString::ConstructFromLiteral));
+ return submit;
+ }
+ case BUTTON: {
+ DEFINE_STATIC_LOCAL(const AtomicString, button, ("button", AtomicString::ConstructFromLiteral));
+ return button;
+ }
+ case RESET: {
+ DEFINE_STATIC_LOCAL(const AtomicString, reset, ("reset", AtomicString::ConstructFromLiteral));
+ return reset;
+ }
}
ASSERT_NOT_REACHED();
@@ -103,8 +103,9 @@ void HTMLButtonElement::parseAttribute(const QualifiedName& name, const AtomicSt
else
m_type = SUBMIT;
setNeedsWillValidateCheck();
- } else
+ } else {
HTMLFormControlElement::parseAttribute(name, value);
+ }
}
void HTMLButtonElement::defaultEventHandler(Event* event)
@@ -130,14 +131,14 @@ void HTMLButtonElement::defaultEventHandler(Event* event)
}
if (event->type() == EventTypeNames::keypress) {
switch (toKeyboardEvent(event)->charCode()) {
- case '\r':
- dispatchSimulatedClick(event);
- event->setDefaultHandled();
- return;
- case ' ':
- // Prevent scrolling down the page.
- event->setDefaultHandled();
- return;
+ case '\r':
+ dispatchSimulatedClick(event);
+ event->setDefaultHandled();
+ return;
+ case ' ':
+ // Prevent scrolling down the page.
+ event->setDefaultHandled();
+ return;
}
}
if (event->type() == EventTypeNames::keyup && toKeyboardEvent(event)->keyIdentifier() == "U+0020") {
« no previous file with comments | « Source/core/html/HTMLBodyElement.cpp ('k') | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698