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

Unified Diff: third_party/WebKit/Source/core/html/forms/EmailInputType.cpp

Issue 2740673002: Prepare Chromium and Blink for ICU 59 (Closed)
Patch Set: revert accidental revert of sftnly roll during rebase Created 3 years, 9 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 | « net/ftp/ftp_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/EmailInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp b/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp
index 755ae39ddb5aa61af50616607431d2c6bdadbf52..52be833b101f4f6c5b1a01ad011a3c126ee20f67 100644
--- a/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/EmailInputType.cpp
@@ -23,6 +23,9 @@
#include "core/html/forms/EmailInputType.h"
+#include <unicode/idna.h>
+#include <unicode/unistr.h>
+#include <unicode/uvernum.h>
#include "bindings/core/v8/ScriptRegexp.h"
#include "core/InputTypeNames.h"
#include "core/html/HTMLInputElement.h"
@@ -31,8 +34,10 @@
#include "platform/text/PlatformLocale.h"
#include "public/platform/Platform.h"
#include "wtf/text/StringBuilder.h"
-#include <unicode/idna.h>
-#include <unicode/unistr.h>
+
+#if U_ICU_VERSION_MAJOR_NUM >= 59
+#include <unicode/char16ptr.h>
+#endif
namespace blink {
@@ -87,7 +92,11 @@ String EmailInputType::convertEmailAddressToASCII(const ScriptRegexp& regexp,
StringBuilder builder;
builder.append(address, 0, atPosition + 1);
+#if U_ICU_VERSION_MAJOR_NUM >= 59
+ builder.append(icu::toUCharPtr(domainName.getBuffer()), domainName.length());
+#else
builder.append(domainName.getBuffer(), domainName.length());
+#endif
String asciiEmail = builder.toString();
return isValidEmailAddress(regexp, asciiEmail) ? asciiEmail : address;
}
« no previous file with comments | « net/ftp/ftp_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698