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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 String EmailInputType::typeMismatchText() const | 85 String EmailInputType::typeMismatchText() const |
86 { | 86 { |
87 return element()->multiple() ? validationMessageTypeMismatchForMultipleEmail
Text() : validationMessageTypeMismatchForEmailText(); | 87 return element()->multiple() ? validationMessageTypeMismatchForMultipleEmail
Text() : validationMessageTypeMismatchForEmailText(); |
88 } | 88 } |
89 | 89 |
90 bool EmailInputType::isEmailField() const | 90 bool EmailInputType::isEmailField() const |
91 { | 91 { |
92 return true; | 92 return true; |
93 } | 93 } |
94 | 94 |
95 String EmailInputType::sanitizeValue(const String& proposedValue) | 95 String EmailInputType::sanitizeValue(const String& proposedValue) const |
96 { | 96 { |
97 String noLineBreakValue = proposedValue.removeCharacters(isHTMLLineBreak); | 97 String noLineBreakValue = proposedValue.removeCharacters(isHTMLLineBreak); |
98 if (!element()->multiple()) | 98 if (!element()->multiple()) |
99 return noLineBreakValue; | 99 return noLineBreakValue; |
100 Vector<String> addresses; | 100 Vector<String> addresses; |
101 noLineBreakValue.split(',', true, addresses); | 101 noLineBreakValue.split(',', true, addresses); |
102 StringBuilder strippedValue; | 102 StringBuilder strippedValue; |
103 for (unsigned i = 0; i < addresses.size(); ++i) { | 103 for (unsigned i = 0; i < addresses.size(); ++i) { |
104 if (i > 0) | 104 if (i > 0) |
105 strippedValue.append(","); | 105 strippedValue.append(","); |
106 strippedValue.append(stripLeadingAndTrailingHTMLSpaces(addresses[i])); | 106 strippedValue.append(stripLeadingAndTrailingHTMLSpaces(addresses[i])); |
107 } | 107 } |
108 return strippedValue.toString(); | 108 return strippedValue.toString(); |
109 } | 109 } |
110 | 110 |
111 } // namespace WebCore | 111 } // namespace WebCore |
OLD | NEW |