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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLTextAreaElement.h

Issue 1846913005: Newline characters in pasted text are not counted correctly for textarea[maxlength]. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple 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.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 * 21 *
22 */ 22 */
23 23
24 #ifndef HTMLTextAreaElement_h 24 #ifndef HTMLTextAreaElement_h
25 #define HTMLTextAreaElement_h 25 #define HTMLTextAreaElement_h
26 26
27 #include "base/gtest_prod_util.h"
27 #include "core/CoreExport.h" 28 #include "core/CoreExport.h"
28 #include "core/html/HTMLTextFormControlElement.h" 29 #include "core/html/HTMLTextFormControlElement.h"
29 30
30 namespace blink { 31 namespace blink {
31 32
32 class BeforeTextInsertedEvent; 33 class BeforeTextInsertedEvent;
33 class ExceptionState; 34 class ExceptionState;
34 35
35 class CORE_EXPORT HTMLTextAreaElement final : public HTMLTextFormControlElement { 36 class CORE_EXPORT HTMLTextAreaElement final : public HTMLTextFormControlElement {
36 DEFINE_WRAPPERTYPEINFO(); 37 DEFINE_WRAPPERTYPEINFO();
(...skipping 22 matching lines...) Expand all
59 String validationMessage() const override; 60 String validationMessage() const override;
60 bool valueMissing() const override; 61 bool valueMissing() const override;
61 bool tooLong() const override; 62 bool tooLong() const override;
62 bool tooShort() const override; 63 bool tooShort() const override;
63 bool isValidValue(const String&) const; 64 bool isValidValue(const String&) const;
64 65
65 void setCols(unsigned); 66 void setCols(unsigned);
66 void setRows(unsigned); 67 void setRows(unsigned);
67 68
68 private: 69 private:
70 FRIEND_TEST_ALL_PREFIXES(HTMLTextAreaElementTest, SanitizeUserInputValue);
69 HTMLTextAreaElement(Document&, HTMLFormElement*); 71 HTMLTextAreaElement(Document&, HTMLFormElement*);
70 72
71 enum WrapMethod { NoWrap, SoftWrap, HardWrap }; 73 enum WrapMethod { NoWrap, SoftWrap, HardWrap };
72 enum SetValueCommonOption { 74 enum SetValueCommonOption {
73 NotSetSelection, 75 NotSetSelection,
74 SetSeletion 76 SetSeletion
75 }; 77 };
76 78
77 void didAddUserAgentShadowRoot(ShadowRoot&) override; 79 void didAddUserAgentShadowRoot(ShadowRoot&) override;
78 // FIXME: Author shadows should be allowed 80 // FIXME: Author shadows should be allowed
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 mutable String m_value; 146 mutable String m_value;
145 mutable bool m_isDirty; 147 mutable bool m_isDirty;
146 bool m_valueIsUpToDate; 148 bool m_valueIsUpToDate;
147 unsigned m_isPlaceholderVisible : 1; 149 unsigned m_isPlaceholderVisible : 1;
148 String m_suggestedValue; 150 String m_suggestedValue;
149 }; 151 };
150 152
151 } // namespace blink 153 } // namespace blink
152 154
153 #endif // HTMLTextAreaElement_h 155 #endif // HTMLTextAreaElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698