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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 | 532 |
533 bool HTMLFormControlElement::checkValidity(WillBeHeapVector<RefPtrWillBeMember<H
TMLFormControlElement>>* unhandledInvalidControls, CheckValidityEventBehavior ev
entBehavior) | 533 bool HTMLFormControlElement::checkValidity(WillBeHeapVector<RefPtrWillBeMember<H
TMLFormControlElement>>* unhandledInvalidControls, CheckValidityEventBehavior ev
entBehavior) |
534 { | 534 { |
535 if (isValidElement()) | 535 if (isValidElement()) |
536 return true; | 536 return true; |
537 if (eventBehavior != CheckValidityDispatchInvalidEvent) | 537 if (eventBehavior != CheckValidityDispatchInvalidEvent) |
538 return false; | 538 return false; |
539 // An event handler can deref this object. | 539 // An event handler can deref this object. |
540 RefPtrWillBeRawPtr<HTMLFormControlElement> protector(this); | 540 RefPtrWillBeRawPtr<HTMLFormControlElement> protector(this); |
541 RefPtrWillBeRawPtr<Document> originalDocument(document()); | 541 RefPtrWillBeRawPtr<Document> originalDocument(document()); |
542 bool needsDefaultAction = dispatchEvent(Event::createCancelable(EventTypeNam
es::invalid)); | 542 DispatchEventResult dispatchResult = dispatchEvent(Event::createCancelable(E
ventTypeNames::invalid)); |
543 if (needsDefaultAction && unhandledInvalidControls && inDocument() && origin
alDocument == document()) | 543 if (dispatchResult == DispatchEventResult::NotCanceled && unhandledInvalidCo
ntrols && inDocument() && originalDocument == document()) |
544 unhandledInvalidControls->append(this); | 544 unhandledInvalidControls->append(this); |
545 return false; | 545 return false; |
546 } | 546 } |
547 | 547 |
548 void HTMLFormControlElement::showValidationMessage() | 548 void HTMLFormControlElement::showValidationMessage() |
549 { | 549 { |
550 scrollIntoViewIfNeeded(false); | 550 scrollIntoViewIfNeeded(false); |
551 RefPtrWillBeRawPtr<HTMLFormControlElement> protector(this); | 551 RefPtrWillBeRawPtr<HTMLFormControlElement> protector(this); |
552 focus(); | 552 focus(); |
553 updateVisibleValidationMessage(); | 553 updateVisibleValidationMessage(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 dispatchFormControlChangeEvent(); | 662 dispatchFormControlChangeEvent(); |
663 } | 663 } |
664 | 664 |
665 void HTMLFormControlElement::copyNonAttributePropertiesFromElement(const Element
& source) | 665 void HTMLFormControlElement::copyNonAttributePropertiesFromElement(const Element
& source) |
666 { | 666 { |
667 HTMLElement::copyNonAttributePropertiesFromElement(source); | 667 HTMLElement::copyNonAttributePropertiesFromElement(source); |
668 setNeedsValidityCheck(); | 668 setNeedsValidityCheck(); |
669 } | 669 } |
670 | 670 |
671 } // namespace blink | 671 } // namespace blink |
OLD | NEW |