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