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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 , m_wasFocusedByMouse(false) | 58 , m_wasFocusedByMouse(false) |
59 { | 59 { |
60 setHasCustomStyleCallbacks(); | 60 setHasCustomStyleCallbacks(); |
61 associateByParser(form); | 61 associateByParser(form); |
62 } | 62 } |
63 | 63 |
64 HTMLFormControlElement::~HTMLFormControlElement() | 64 HTMLFormControlElement::~HTMLFormControlElement() |
65 { | 65 { |
66 #if !ENABLE(OILPAN) | 66 #if !ENABLE(OILPAN) |
67 setForm(0); | 67 setForm(0); |
68 hideVisibleValidationMessage(); | |
69 #endif | 68 #endif |
70 } | 69 } |
71 | 70 |
72 void HTMLFormControlElement::trace(Visitor* visitor) | 71 void HTMLFormControlElement::trace(Visitor* visitor) |
73 { | 72 { |
74 FormAssociatedElement::trace(visitor); | 73 FormAssociatedElement::trace(visitor); |
75 LabelableElement::trace(visitor); | 74 LabelableElement::trace(visitor); |
76 } | 75 } |
77 | 76 |
78 String HTMLFormControlElement::formEnctype() const | 77 String HTMLFormControlElement::formEnctype() const |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 { | 421 { |
423 if (m_validationMessage) | 422 if (m_validationMessage) |
424 m_validationMessage->requestToHideMessage(); | 423 m_validationMessage->requestToHideMessage(); |
425 } | 424 } |
426 | 425 |
427 bool HTMLFormControlElement::checkValidity(WillBeHeapVector<RefPtrWillBeMember<F
ormAssociatedElement> >* unhandledInvalidControls) | 426 bool HTMLFormControlElement::checkValidity(WillBeHeapVector<RefPtrWillBeMember<F
ormAssociatedElement> >* unhandledInvalidControls) |
428 { | 427 { |
429 if (!willValidate() || isValidFormControlElement()) | 428 if (!willValidate() || isValidFormControlElement()) |
430 return true; | 429 return true; |
431 // An event handler can deref this object. | 430 // An event handler can deref this object. |
432 RefPtr<HTMLFormControlElement> protector(this); | 431 RefPtrWillBeRawPtr<HTMLFormControlElement> protector(this); |
433 RefPtr<Document> originalDocument(document()); | 432 RefPtrWillBeRawPtr<Document> originalDocument(document()); |
434 bool needsDefaultAction = dispatchEvent(Event::createCancelable(EventTypeNam
es::invalid)); | 433 bool needsDefaultAction = dispatchEvent(Event::createCancelable(EventTypeNam
es::invalid)); |
435 if (needsDefaultAction && unhandledInvalidControls && inDocument() && origin
alDocument == document()) | 434 if (needsDefaultAction && unhandledInvalidControls && inDocument() && origin
alDocument == document()) |
436 unhandledInvalidControls->append(this); | 435 unhandledInvalidControls->append(this); |
437 return false; | 436 return false; |
438 } | 437 } |
439 | 438 |
440 bool HTMLFormControlElement::isValidFormControlElement() | 439 bool HTMLFormControlElement::isValidFormControlElement() |
441 { | 440 { |
442 // If the following assertion fails, setNeedsValidityCheck() is not called | 441 // If the following assertion fails, setNeedsValidityCheck() is not called |
443 // correctly when something which changes validity is updated. | 442 // correctly when something which changes validity is updated. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 503 |
505 void HTMLFormControlElement::setFocus(bool flag) | 504 void HTMLFormControlElement::setFocus(bool flag) |
506 { | 505 { |
507 LabelableElement::setFocus(flag); | 506 LabelableElement::setFocus(flag); |
508 | 507 |
509 if (!flag && wasChangedSinceLastFormControlChangeEvent()) | 508 if (!flag && wasChangedSinceLastFormControlChangeEvent()) |
510 dispatchFormControlChangeEvent(); | 509 dispatchFormControlChangeEvent(); |
511 } | 510 } |
512 | 511 |
513 } // namespace Webcore | 512 } // namespace Webcore |
OLD | NEW |