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

Side by Side Diff: Source/WebCore/html/EmailInputType.cpp

Issue 8336009: Merge 97351 - REGRESSION(r89915): <input type=email multiple> don't show the default value (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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 unified diff | Download patch
« no previous file with comments | « Source/WebCore/html/EmailInputType.h ('k') | Source/WebCore/html/HTMLInputElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/WebCore/html/EmailInputType.h ('k') | Source/WebCore/html/HTMLInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698