OLD | NEW |
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. |
(...skipping 27 matching lines...) Expand all Loading... |
38 public: | 38 public: |
39 static HTMLTextAreaElement* create(Document&); | 39 static HTMLTextAreaElement* create(Document&); |
40 | 40 |
41 unsigned cols() const { return m_cols; } | 41 unsigned cols() const { return m_cols; } |
42 unsigned rows() const { return m_rows; } | 42 unsigned rows() const { return m_rows; } |
43 | 43 |
44 bool shouldWrapText() const { return m_wrap != NoWrap; } | 44 bool shouldWrapText() const { return m_wrap != NoWrap; } |
45 | 45 |
46 String value() const override; | 46 String value() const override; |
47 void setValue(const String&, | 47 void setValue(const String&, |
48 TextFieldEventBehavior = DispatchNoEvent) override; | 48 TextFieldEventBehavior = DispatchNoEvent, |
| 49 TextControlSetValueSelection = |
| 50 TextControlSetValueSelection::kSetSelectionToEnd) override; |
49 String defaultValue() const; | 51 String defaultValue() const; |
50 void setDefaultValue(const String&); | 52 void setDefaultValue(const String&); |
51 int textLength() const { return value().length(); } | 53 int textLength() const { return value().length(); } |
52 | 54 |
53 String suggestedValue() const; | 55 String suggestedValue() const; |
54 void setSuggestedValue(const String&); | 56 void setSuggestedValue(const String&); |
55 | 57 |
56 // For ValidityState | 58 // For ValidityState |
57 String validationMessage() const override; | 59 String validationMessage() const override; |
58 bool valueMissing() const override; | 60 bool valueMissing() const override; |
(...skipping 13 matching lines...) Expand all Loading... |
72 void didAddUserAgentShadowRoot(ShadowRoot&) override; | 74 void didAddUserAgentShadowRoot(ShadowRoot&) override; |
73 // FIXME: Author shadows should be allowed | 75 // FIXME: Author shadows should be allowed |
74 // https://bugs.webkit.org/show_bug.cgi?id=92608 | 76 // https://bugs.webkit.org/show_bug.cgi?id=92608 |
75 bool areAuthorShadowsAllowed() const override { return false; } | 77 bool areAuthorShadowsAllowed() const override { return false; } |
76 | 78 |
77 void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) const; | 79 void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*) const; |
78 static String sanitizeUserInputValue(const String&, unsigned maxLength); | 80 static String sanitizeUserInputValue(const String&, unsigned maxLength); |
79 void updateValue() const; | 81 void updateValue() const; |
80 void setInnerEditorValue(const String&) override; | 82 void setInnerEditorValue(const String&) override; |
81 void setNonDirtyValue(const String&); | 83 void setNonDirtyValue(const String&); |
82 void setValueCommon(const String&, TextFieldEventBehavior); | 84 void setValueCommon(const String&, |
| 85 TextFieldEventBehavior, |
| 86 TextControlSetValueSelection); |
83 | 87 |
84 bool isPlaceholderVisible() const override { return m_isPlaceholderVisible; } | 88 bool isPlaceholderVisible() const override { return m_isPlaceholderVisible; } |
85 void setPlaceholderVisibility(bool) override; | 89 void setPlaceholderVisibility(bool) override; |
86 bool supportsPlaceholder() const override { return true; } | 90 bool supportsPlaceholder() const override { return true; } |
87 void updatePlaceholderText() override; | 91 void updatePlaceholderText() override; |
88 bool isEmptyValue() const override { return value().isEmpty(); } | 92 bool isEmptyValue() const override { return value().isEmpty(); } |
89 bool isEmptySuggestedValue() const final { | 93 bool isEmptySuggestedValue() const final { |
90 return suggestedValue().isEmpty(); | 94 return suggestedValue().isEmpty(); |
91 } | 95 } |
92 bool supportsAutocapitalize() const override { return true; } | 96 bool supportsAutocapitalize() const override { return true; } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 mutable String m_value; | 149 mutable String m_value; |
146 mutable bool m_isDirty; | 150 mutable bool m_isDirty; |
147 bool m_valueIsUpToDate; | 151 bool m_valueIsUpToDate; |
148 unsigned m_isPlaceholderVisible : 1; | 152 unsigned m_isPlaceholderVisible : 1; |
149 String m_suggestedValue; | 153 String m_suggestedValue; |
150 }; | 154 }; |
151 | 155 |
152 } // namespace blink | 156 } // namespace blink |
153 | 157 |
154 #endif // HTMLTextAreaElement_h | 158 #endif // HTMLTextAreaElement_h |
OLD | NEW |