OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the WebKit project. | 2 * This file is part of the WebKit project. |
3 * | 3 * |
4 * Copyright (C) 2009 Michelangelo De Simone <micdesim@gmail.com> | 4 * Copyright (C) 2009 Michelangelo De Simone <micdesim@gmail.com> |
5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 return false; | 134 return false; |
135 return domain.find("..") == kNotFound; | 135 return domain.find("..") == kNotFound; |
136 } | 136 } |
137 | 137 |
138 bool EmailInputType::isValidEmailAddress(const String& address) | 138 bool EmailInputType::isValidEmailAddress(const String& address) |
139 { | 139 { |
140 int addressLength = address.length(); | 140 int addressLength = address.length(); |
141 if (!addressLength) | 141 if (!addressLength) |
142 return false; | 142 return false; |
143 | 143 |
144 WTF_ANNOTATE_SCOPED_MEMORY_LEAK; | 144 LEAK_SANITIZER_DISABLED_SCOPE; |
145 DEFINE_STATIC_LOCAL(const ScriptRegexp, regExp, (emailPattern, TextCaseInsen
sitive)); | 145 DEFINE_STATIC_LOCAL(const ScriptRegexp, regExp, (emailPattern, TextCaseInsen
sitive)); |
146 | 146 |
147 int matchLength; | 147 int matchLength; |
148 int matchOffset = regExp.match(address, 0, &matchLength); | 148 int matchOffset = regExp.match(address, 0, &matchLength); |
149 | 149 |
150 return !matchOffset && matchLength == addressLength; | 150 return !matchOffset && matchLength == addressLength; |
151 } | 151 } |
152 | 152 |
153 PassRefPtrWillBeRawPtr<InputType> EmailInputType::create(HTMLInputElement& eleme
nt) | 153 PassRefPtrWillBeRawPtr<InputType> EmailInputType::create(HTMLInputElement& eleme
nt) |
154 { | 154 { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 builder.reserveCapacity(value.length()); | 301 builder.reserveCapacity(value.length()); |
302 for (size_t i = 0; i < addresses.size(); ++i) { | 302 for (size_t i = 0; i < addresses.size(); ++i) { |
303 if (i > 0) | 303 if (i > 0) |
304 builder.append(','); | 304 builder.append(','); |
305 builder.append(convertEmailAddressToUnicode(addresses[i])); | 305 builder.append(convertEmailAddressToUnicode(addresses[i])); |
306 } | 306 } |
307 return builder.toString(); | 307 return builder.toString(); |
308 } | 308 } |
309 | 309 |
310 } // namespace blink | 310 } // namespace blink |
OLD | NEW |