| 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 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. | 7 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 void defaultEventHandler(Event*) override; | 149 void defaultEventHandler(Event*) override; |
| 150 virtual void subtreeHasChanged() = 0; | 150 virtual void subtreeHasChanged() = 0; |
| 151 | 151 |
| 152 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } | 152 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } |
| 153 void addPlaceholderBreakElementIfNecessary(); | 153 void addPlaceholderBreakElementIfNecessary(); |
| 154 String valueWithHardLineBreaks() const; | 154 String valueWithHardLineBreaks() const; |
| 155 | 155 |
| 156 virtual bool shouldDispatchFormControlChangeEvent(String&, String&); | 156 virtual bool shouldDispatchFormControlChangeEvent(String&, String&); |
| 157 void copyNonAttributePropertiesFromElement(const Element&) override; | 157 void copyNonAttributePropertiesFromElement(const Element&) override; |
| 158 | 158 |
| 159 void disabledAttributeChanged() override; |
| 160 void readonlyAttributeChanged() override; |
| 161 |
| 159 private: | 162 private: |
| 160 int computeSelectionStart() const; | 163 int computeSelectionStart() const; |
| 161 int computeSelectionEnd() const; | 164 int computeSelectionEnd() const; |
| 162 TextFieldSelectionDirection computeSelectionDirection() const; | 165 TextFieldSelectionDirection computeSelectionDirection() const; |
| 163 void cacheSelection(int start, | 166 void cacheSelection(int start, |
| 164 int end, | 167 int end, |
| 165 TextFieldSelectionDirection direction) { | 168 TextFieldSelectionDirection direction) { |
| 166 DCHECK_GE(start, 0); | 169 DCHECK_GE(start, 0); |
| 167 DCHECK_LE(start, end); | 170 DCHECK_LE(start, end); |
| 168 m_cachedSelectionStart = start; | 171 m_cachedSelectionStart = start; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 187 virtual bool isEmptySuggestedValue() const { return true; } | 190 virtual bool isEmptySuggestedValue() const { return true; } |
| 188 // Called in dispatchFocusEvent(), after placeholder process, before calling | 191 // Called in dispatchFocusEvent(), after placeholder process, before calling |
| 189 // parent's dispatchFocusEvent(). | 192 // parent's dispatchFocusEvent(). |
| 190 virtual void handleFocusEvent(Element* /* oldFocusedNode */, WebFocusType) {} | 193 virtual void handleFocusEvent(Element* /* oldFocusedNode */, WebFocusType) {} |
| 191 // Called in dispatchBlurEvent(), after placeholder process, before calling | 194 // Called in dispatchBlurEvent(), after placeholder process, before calling |
| 192 // parent's dispatchBlurEvent(). | 195 // parent's dispatchBlurEvent(). |
| 193 virtual void handleBlurEvent() {} | 196 virtual void handleBlurEvent() {} |
| 194 | 197 |
| 195 bool placeholderShouldBeVisible() const; | 198 bool placeholderShouldBeVisible() const; |
| 196 | 199 |
| 200 void removeSpellingAndGrammarMarkersOnInnerEditor(); |
| 201 |
| 197 String m_textAsOfLastFormControlChangeEvent; | 202 String m_textAsOfLastFormControlChangeEvent; |
| 198 bool m_wasChangedSinceLastFormControlChangeEvent = false; | 203 bool m_wasChangedSinceLastFormControlChangeEvent = false; |
| 199 bool m_lastChangeWasUserEdit; | 204 bool m_lastChangeWasUserEdit; |
| 200 | 205 |
| 201 int m_cachedSelectionStart; | 206 int m_cachedSelectionStart; |
| 202 int m_cachedSelectionEnd; | 207 int m_cachedSelectionEnd; |
| 203 TextFieldSelectionDirection m_cachedSelectionDirection; | 208 TextFieldSelectionDirection m_cachedSelectionDirection; |
| 204 | 209 |
| 205 FRIEND_TEST_ALL_PREFIXES(TextControlElementTest, IndexForPosition); | 210 FRIEND_TEST_ALL_PREFIXES(TextControlElementTest, IndexForPosition); |
| 206 }; | 211 }; |
| 207 | 212 |
| 208 inline bool isTextControlElement(const Element& element) { | 213 inline bool isTextControlElement(const Element& element) { |
| 209 return element.isTextControl(); | 214 return element.isTextControl(); |
| 210 } | 215 } |
| 211 | 216 |
| 212 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(TextControlElement); | 217 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(TextControlElement); |
| 213 | 218 |
| 214 TextControlElement* enclosingTextControl(const Position&); | 219 TextControlElement* enclosingTextControl(const Position&); |
| 215 TextControlElement* enclosingTextControl(const Node*); | 220 TextControlElement* enclosingTextControl(const Node*); |
| 216 | 221 |
| 217 } // namespace blink | 222 } // namespace blink |
| 218 | 223 |
| 219 #endif | 224 #endif |
| OLD | NEW |