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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 return InsertionDone; | 80 return InsertionDone; |
81 String initialValue = value(); | 81 String initialValue = value(); |
82 setTextAsOfLastFormControlChangeEvent(initialValue.isNull() ? emptyString | 82 setTextAsOfLastFormControlChangeEvent(initialValue.isNull() ? emptyString |
83 : initialValue); | 83 : initialValue); |
84 return InsertionDone; | 84 return InsertionDone; |
85 } | 85 } |
86 | 86 |
87 void TextControlElement::dispatchFocusEvent( | 87 void TextControlElement::dispatchFocusEvent( |
88 Element* oldFocusedElement, | 88 Element* oldFocusedElement, |
89 WebFocusType type, | 89 WebFocusType type, |
90 InputDeviceCapabilities* sourceCapabilities) { | 90 const InputDeviceCapabilitiesValue& sourceCapabilities) { |
91 if (supportsPlaceholder()) | 91 if (supportsPlaceholder()) |
92 updatePlaceholderVisibility(); | 92 updatePlaceholderVisibility(); |
93 handleFocusEvent(oldFocusedElement, type); | 93 handleFocusEvent(oldFocusedElement, type); |
94 HTMLFormControlElementWithState::dispatchFocusEvent(oldFocusedElement, type, | 94 HTMLFormControlElementWithState::dispatchFocusEvent(oldFocusedElement, type, |
95 sourceCapabilities); | 95 sourceCapabilities); |
96 } | 96 } |
97 | 97 |
98 void TextControlElement::dispatchBlurEvent( | 98 void TextControlElement::dispatchBlurEvent( |
99 Element* newFocusedElement, | 99 Element* newFocusedElement, |
100 WebFocusType type, | 100 WebFocusType type, |
101 InputDeviceCapabilities* sourceCapabilities) { | 101 const InputDeviceCapabilitiesValue& sourceCapabilities) { |
102 if (supportsPlaceholder()) | 102 if (supportsPlaceholder()) |
103 updatePlaceholderVisibility(); | 103 updatePlaceholderVisibility(); |
104 handleBlurEvent(); | 104 handleBlurEvent(); |
105 HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement, type, | 105 HTMLFormControlElementWithState::dispatchBlurEvent(newFocusedElement, type, |
106 sourceCapabilities); | 106 sourceCapabilities); |
107 } | 107 } |
108 | 108 |
109 void TextControlElement::defaultEventHandler(Event* event) { | 109 void TextControlElement::defaultEventHandler(Event* event) { |
110 if (event->type() == EventTypeNames::webkitEditableContentChanged && | 110 if (event->type() == EventTypeNames::webkitEditableContentChanged && |
111 layoutObject() && layoutObject()->isTextControl()) { | 111 layoutObject() && layoutObject()->isTextControl()) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 | 193 |
194 void TextControlElement::setSelectionDirection(const String& direction) { | 194 void TextControlElement::setSelectionDirection(const String& direction) { |
195 setSelectionRangeForBinding(selectionStart(), selectionEnd(), direction); | 195 setSelectionRangeForBinding(selectionStart(), selectionEnd(), direction); |
196 } | 196 } |
197 | 197 |
198 void TextControlElement::select() { | 198 void TextControlElement::select() { |
199 setSelectionRangeForBinding(0, std::numeric_limits<unsigned>::max()); | 199 setSelectionRangeForBinding(0, std::numeric_limits<unsigned>::max()); |
200 // Avoid SelectionBehaviorOnFocus::Restore, which scrolls containers to show | 200 // Avoid SelectionBehaviorOnFocus::Restore, which scrolls containers to show |
201 // the selection. | 201 // the selection. |
202 focus(FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, nullptr)); | 202 focus(FocusParams(SelectionBehaviorOnFocus::None, WebFocusTypeNone, |
| 203 InputDeviceCapabilities::Null)); |
203 restoreCachedSelection(); | 204 restoreCachedSelection(); |
204 } | 205 } |
205 | 206 |
206 void TextControlElement::setChangedSinceLastFormControlChangeEvent( | 207 void TextControlElement::setChangedSinceLastFormControlChangeEvent( |
207 bool changed) { | 208 bool changed) { |
208 m_wasChangedSinceLastFormControlChangeEvent = changed; | 209 m_wasChangedSinceLastFormControlChangeEvent = changed; |
209 } | 210 } |
210 | 211 |
211 void TextControlElement::setFocused(bool flag) { | 212 void TextControlElement::setFocused(bool flag) { |
212 HTMLFormControlElementWithState::setFocused(flag); | 213 HTMLFormControlElementWithState::setFocused(flag); |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 | 898 |
898 void TextControlElement::copyNonAttributePropertiesFromElement( | 899 void TextControlElement::copyNonAttributePropertiesFromElement( |
899 const Element& source) { | 900 const Element& source) { |
900 const TextControlElement& sourceElement = | 901 const TextControlElement& sourceElement = |
901 static_cast<const TextControlElement&>(source); | 902 static_cast<const TextControlElement&>(source); |
902 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; | 903 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; |
903 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); | 904 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
904 } | 905 } |
905 | 906 |
906 } // namespace blink | 907 } // namespace blink |
OLD | NEW |