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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 void HTMLFormControlElement::removedFrom(ContainerNode* insertionPoint) | 248 void HTMLFormControlElement::removedFrom(ContainerNode* insertionPoint) |
249 { | 249 { |
250 m_validationMessage = nullptr; | 250 m_validationMessage = nullptr; |
251 m_ancestorDisabledState = AncestorDisabledStateUnknown; | 251 m_ancestorDisabledState = AncestorDisabledStateUnknown; |
252 m_dataListAncestorState = Unknown; | 252 m_dataListAncestorState = Unknown; |
253 HTMLElement::removedFrom(insertionPoint); | 253 HTMLElement::removedFrom(insertionPoint); |
254 FormAssociatedElement::removedFrom(insertionPoint); | 254 FormAssociatedElement::removedFrom(insertionPoint); |
255 } | 255 } |
256 | 256 |
257 bool HTMLFormControlElement::wasChangedSinceLastFormControlChangeEvent() const | |
258 { | |
259 return m_wasChangedSinceLastFormControlChangeEvent; | |
260 } | |
261 | |
262 void HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent(bool chan
ged) | 257 void HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent(bool chan
ged) |
263 { | 258 { |
264 m_wasChangedSinceLastFormControlChangeEvent = changed; | 259 m_wasChangedSinceLastFormControlChangeEvent = changed; |
265 } | 260 } |
266 | 261 |
267 void HTMLFormControlElement::dispatchChangeEvent() | 262 void HTMLFormControlElement::dispatchChangeEvent() |
268 { | 263 { |
269 dispatchScopedEvent(Event::createBubble(EventTypeNames::change)); | 264 dispatchScopedEvent(Event::createBubble(EventTypeNames::change)); |
270 } | 265 } |
271 | 266 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 { | 495 { |
501 String fullName = name(); | 496 String fullName = name(); |
502 String trimmedName = fullName.stripWhiteSpace(); | 497 String trimmedName = fullName.stripWhiteSpace(); |
503 if (!trimmedName.isEmpty()) | 498 if (!trimmedName.isEmpty()) |
504 return trimmedName; | 499 return trimmedName; |
505 fullName = getIdAttribute(); | 500 fullName = getIdAttribute(); |
506 trimmedName = fullName.stripWhiteSpace(); | 501 trimmedName = fullName.stripWhiteSpace(); |
507 return trimmedName; | 502 return trimmedName; |
508 } | 503 } |
509 | 504 |
| 505 void HTMLFormControlElement::setFocus(bool flag) |
| 506 { |
| 507 LabelableElement::setFocus(flag); |
| 508 |
| 509 if (!flag && wasChangedSinceLastFormControlChangeEvent()) |
| 510 dispatchFormControlChangeEvent(); |
| 511 } |
| 512 |
510 } // namespace Webcore | 513 } // namespace Webcore |
OLD | NEW |