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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void HTMLTextFormControlElement::dispatchFormControlChangeEvent() { | 217 void HTMLTextFormControlElement::dispatchFormControlChangeEvent() { |
218 String newValue = value(); | 218 String newValue = value(); |
219 if (shouldDispatchFormControlChangeEvent(m_textAsOfLastFormControlChangeEvent, | 219 if (shouldDispatchFormControlChangeEvent(m_textAsOfLastFormControlChangeEvent, |
220 newValue)) { | 220 newValue)) { |
221 setTextAsOfLastFormControlChangeEvent(newValue); | 221 setTextAsOfLastFormControlChangeEvent(newValue); |
222 dispatchChangeEvent(); | 222 dispatchChangeEvent(); |
223 } | 223 } |
224 setChangedSinceLastFormControlChangeEvent(false); | 224 setChangedSinceLastFormControlChangeEvent(false); |
225 } | 225 } |
226 | 226 |
| 227 void HTMLTextFormControlElement::enqueueChangeEvent() { |
| 228 String newValue = value(); |
| 229 if (shouldDispatchFormControlChangeEvent(m_textAsOfLastFormControlChangeEvent, |
| 230 newValue)) { |
| 231 setTextAsOfLastFormControlChangeEvent(newValue); |
| 232 Event* event = Event::createBubble(EventTypeNames::change); |
| 233 event->setTarget(this); |
| 234 document().enqueueAnimationFrameEvent(event); |
| 235 } |
| 236 setChangedSinceLastFormControlChangeEvent(false); |
| 237 } |
| 238 |
227 void HTMLTextFormControlElement::setRangeText(const String& replacement, | 239 void HTMLTextFormControlElement::setRangeText(const String& replacement, |
228 ExceptionState& exceptionState) { | 240 ExceptionState& exceptionState) { |
229 setRangeText(replacement, selectionStart(), selectionEnd(), "preserve", | 241 setRangeText(replacement, selectionStart(), selectionEnd(), "preserve", |
230 exceptionState); | 242 exceptionState); |
231 } | 243 } |
232 | 244 |
233 void HTMLTextFormControlElement::setRangeText(const String& replacement, | 245 void HTMLTextFormControlElement::setRangeText(const String& replacement, |
234 unsigned start, | 246 unsigned start, |
235 unsigned end, | 247 unsigned end, |
236 const String& selectionMode, | 248 const String& selectionMode, |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 | 1099 |
1088 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement( | 1100 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement( |
1089 const Element& source) { | 1101 const Element& source) { |
1090 const HTMLTextFormControlElement& sourceElement = | 1102 const HTMLTextFormControlElement& sourceElement = |
1091 static_cast<const HTMLTextFormControlElement&>(source); | 1103 static_cast<const HTMLTextFormControlElement&>(source); |
1092 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; | 1104 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; |
1093 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); | 1105 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
1094 } | 1106 } |
1095 | 1107 |
1096 } // namespace blink | 1108 } // namespace blink |
OLD | NEW |