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, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
6 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 6 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 String valueWithHardLineBreaks() const; | 128 String valueWithHardLineBreaks() const; |
129 | 129 |
130 virtual bool shouldDispatchFormControlChangeEvent(String&, String&); | 130 virtual bool shouldDispatchFormControlChangeEvent(String&, String&); |
131 | 131 |
132 private: | 132 private: |
133 int computeSelectionStart() const; | 133 int computeSelectionStart() const; |
134 int computeSelectionEnd() const; | 134 int computeSelectionEnd() const; |
135 TextFieldSelectionDirection computeSelectionDirection() const; | 135 TextFieldSelectionDirection computeSelectionDirection() const; |
136 | 136 |
137 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusType) overr
ide final; | 137 virtual void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType) ov
erride final; |
138 virtual void dispatchBlurEvent(Element* newFocusedElement) override final; | 138 virtual void dispatchBlurEvent(Element* newFocusedElement) override final; |
139 void scheduleSelectEvent(); | 139 void scheduleSelectEvent(); |
140 | 140 |
141 // Returns true if user-editable value is empty. Used to check placeholder v
isibility. | 141 // Returns true if user-editable value is empty. Used to check placeholder v
isibility. |
142 virtual bool isEmptyValue() const = 0; | 142 virtual bool isEmptyValue() const = 0; |
143 // Returns true if suggested value is empty. Used to check placeholder visib
ility. | 143 // Returns true if suggested value is empty. Used to check placeholder visib
ility. |
144 virtual bool isEmptySuggestedValue() const { return true; } | 144 virtual bool isEmptySuggestedValue() const { return true; } |
145 // Called in dispatchFocusEvent(), after placeholder process, before calling
parent's dispatchFocusEvent(). | 145 // Called in dispatchFocusEvent(), after placeholder process, before calling
parent's dispatchFocusEvent(). |
146 virtual void handleFocusEvent(Element* /* oldFocusedNode */, FocusType) { } | 146 virtual void handleFocusEvent(Element* /* oldFocusedNode */, WebFocusType) {
} |
147 // Called in dispatchBlurEvent(), after placeholder process, before calling
parent's dispatchBlurEvent(). | 147 // Called in dispatchBlurEvent(), after placeholder process, before calling
parent's dispatchBlurEvent(). |
148 virtual void handleBlurEvent() { } | 148 virtual void handleBlurEvent() { } |
149 | 149 |
150 String m_textAsOfLastFormControlChangeEvent; | 150 String m_textAsOfLastFormControlChangeEvent; |
151 bool m_lastChangeWasUserEdit; | 151 bool m_lastChangeWasUserEdit; |
152 | 152 |
153 int m_cachedSelectionStart; | 153 int m_cachedSelectionStart; |
154 int m_cachedSelectionEnd; | 154 int m_cachedSelectionEnd; |
155 TextFieldSelectionDirection m_cachedSelectionDirection; | 155 TextFieldSelectionDirection m_cachedSelectionDirection; |
156 }; | 156 }; |
157 | 157 |
158 inline bool isHTMLTextFormControlElement(const Element& element) | 158 inline bool isHTMLTextFormControlElement(const Element& element) |
159 { | 159 { |
160 return element.isTextFormControl(); | 160 return element.isTextFormControl(); |
161 } | 161 } |
162 | 162 |
163 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); | 163 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); |
164 | 164 |
165 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); | 165 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); |
166 HTMLTextFormControlElement* enclosingTextFormControl(Node*); | 166 HTMLTextFormControlElement* enclosingTextFormControl(Node*); |
167 | 167 |
168 } // namespace | 168 } // namespace |
169 | 169 |
170 #endif | 170 #endif |
OLD | NEW |