| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 HTMLTextFormControlElement(const QualifiedName&, Document&, HTMLFormElement*
); | 90 HTMLTextFormControlElement(const QualifiedName&, Document&, HTMLFormElement*
); |
| 91 bool isPlaceholderEmpty() const; | 91 bool isPlaceholderEmpty() const; |
| 92 virtual void updatePlaceholderText() = 0; | 92 virtual void updatePlaceholderText() = 0; |
| 93 | 93 |
| 94 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 94 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
| 95 | 95 |
| 96 void cacheSelection(int start, int end, TextFieldSelectionDirection directio
n) | 96 void cacheSelection(int start, int end, TextFieldSelectionDirection directio
n) |
| 97 { | 97 { |
| 98 ASSERT(start >= 0); |
| 98 m_cachedSelectionStart = start; | 99 m_cachedSelectionStart = start; |
| 99 m_cachedSelectionEnd = end; | 100 m_cachedSelectionEnd = end; |
| 100 m_cachedSelectionDirection = direction; | 101 m_cachedSelectionDirection = direction; |
| 101 } | 102 } |
| 102 | 103 |
| 103 void restoreCachedSelection(); | 104 void restoreCachedSelection(); |
| 104 bool hasCachedSelection() const { return m_cachedSelectionStart >= 0; } | |
| 105 | 105 |
| 106 virtual void defaultEventHandler(Event*) OVERRIDE; | 106 virtual void defaultEventHandler(Event*) OVERRIDE; |
| 107 virtual void subtreeHasChanged() = 0; | 107 virtual void subtreeHasChanged() = 0; |
| 108 | 108 |
| 109 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } | 109 void setLastChangeWasNotUserEdit() { m_lastChangeWasUserEdit = false; } |
| 110 | 110 |
| 111 String valueWithHardLineBreaks() const; | 111 String valueWithHardLineBreaks() const; |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 int computeSelectionStart() const; | 114 int computeSelectionStart() const; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 140 return element.isTextFormControl(); | 140 return element.isTextFormControl(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); | 143 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLTextFormControlElement); |
| 144 | 144 |
| 145 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); | 145 HTMLTextFormControlElement* enclosingTextFormControl(const Position&); |
| 146 | 146 |
| 147 } // namespace | 147 } // namespace |
| 148 | 148 |
| 149 #endif | 149 #endif |
| OLD | NEW |