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

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

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mike's comments Created 6 years, 1 month 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/HTMLImageElement.cpp ('k') | Source/core/html/HTMLKeygenElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLInputElement.cpp
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index d0704564663d4357c2add46e8a78209cd188920e..1d97194ccb36804bb4c08e50ad3ffafbc6f647d7 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -1104,12 +1104,12 @@ void* HTMLInputElement::preDispatchEventHandler(Event* event)
{
if (event->type() == EventTypeNames::textInput && m_inputTypeView->shouldSubmitImplicitly(event)) {
event->stopPropagation();
- return 0;
+ return nullptr;
}
if (event->type() != EventTypeNames::click)
- return 0;
+ return nullptr;
if (!event->isMouseEvent() || toMouseEvent(event)->button() != LeftButton)
- return 0;
+ return nullptr;
#if ENABLE(OILPAN)
return m_inputTypeView->willDispatchClick();
#else
@@ -1273,8 +1273,8 @@ static Vector<String> parseAcceptAttribute(const String& acceptString, bool (*pr
Vector<String> splitTypes;
acceptString.split(',', false, splitTypes);
- for (size_t i = 0; i < splitTypes.size(); ++i) {
- String trimmedType = stripLeadingAndTrailingHTMLSpaces(splitTypes[i]);
+ for (const String& splitType : splitTypes) {
+ String trimmedType = stripLeadingAndTrailingHTMLSpaces(splitType);
if (trimmedType.isEmpty())
continue;
if (!predicate(trimmedType))
@@ -1531,16 +1531,16 @@ HTMLElement* HTMLInputElement::list() const
HTMLDataListElement* HTMLInputElement::dataList() const
{
if (!m_hasNonEmptyList)
- return 0;
+ return nullptr;
if (!m_inputType->shouldRespectListAttribute())
- return 0;
+ return nullptr;
Element* element = treeScope().getElementById(fastGetAttribute(listAttr));
if (!element)
- return 0;
+ return nullptr;
if (!isHTMLDataListElement(*element))
- return 0;
+ return nullptr;
return toHTMLDataListElement(element);
}
@@ -1673,19 +1673,19 @@ HTMLInputElement* HTMLInputElement::checkedRadioButtonForGroup()
return this;
if (RadioButtonGroupScope* scope = radioButtonGroupScope())
return scope->checkedButtonForGroup(name());
- return 0;
+ return nullptr;
}
RadioButtonGroupScope* HTMLInputElement::radioButtonGroupScope() const
{
// FIXME: Remove type check.
if (type() != InputTypeNames::radio)
- return 0;
+ return nullptr;
if (HTMLFormElement* formElement = form())
return &formElement->radioButtonGroupScope();
if (inDocument())
return &document().formController().radioButtonGroupScope();
- return 0;
+ return nullptr;
}
inline void HTMLInputElement::addToRadioButtonGroup()
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | Source/core/html/HTMLKeygenElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698