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

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

Issue 836113002: Input type url with line break and leading-trailing whitespace should be stripped. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update 1 : Used testharness.js for LayoutTests. Created 5 years, 11 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/URLInputType.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/URLInputType.cpp
diff --git a/Source/core/html/forms/URLInputType.cpp b/Source/core/html/forms/URLInputType.cpp
index db6942b559e9790e16c4222df4f0be986cfb7f99..dd16ba32d6bfa666a27dd5c8965cd5a41fa45417 100644
--- a/Source/core/html/forms/URLInputType.cpp
+++ b/Source/core/html/forms/URLInputType.cpp
@@ -33,6 +33,7 @@
#include "core/InputTypeNames.h"
#include "core/html/HTMLInputElement.h"
+#include "core/html/parser/HTMLParserIdioms.h"
#include "platform/text/PlatformLocale.h"
#include "wtf/PassOwnPtr.h"
@@ -53,6 +54,12 @@ const AtomicString& URLInputType::formControlType() const
return InputTypeNames::url;
}
+String URLInputType::sanitizeValue(const String& proposedValue) const
+{
+ String value = proposedValue.removeCharacters(isHTMLLineBreak);
+ return stripLeadingAndTrailingHTMLSpaces(value);
+}
+
bool URLInputType::typeMismatchFor(const String& value) const
{
return !value.isEmpty() && !KURL(KURL(), value).isValid();
« no previous file with comments | « Source/core/html/forms/URLInputType.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698