Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFormElement.cpp

Issue 1764063002: Rename two functions related to 'default button' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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, 2008, 2009 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 void HTMLFormElement::setMethod(const AtomicString& value) 666 void HTMLFormElement::setMethod(const AtomicString& value)
667 { 667 {
668 setAttribute(methodAttr, value); 668 setAttribute(methodAttr, value);
669 } 669 }
670 670
671 bool HTMLFormElement::wasUserSubmitted() const 671 bool HTMLFormElement::wasUserSubmitted() const
672 { 672 {
673 return m_wasUserSubmitted; 673 return m_wasUserSubmitted;
674 } 674 }
675 675
676 HTMLFormControlElement* HTMLFormElement::defaultButton() const 676 HTMLFormControlElement* HTMLFormElement::findDefaultButton() const
677 { 677 {
678 const FormAssociatedElement::List& elements = associatedElements(); 678 for (const auto& element : associatedElements()) {
679 for (unsigned i = 0; i < elements.size(); ++i) { 679 if (!element->isFormControlElement())
680 if (!elements[i]->isFormControlElement())
681 continue; 680 continue;
682 HTMLFormControlElement* control = toHTMLFormControlElement(elements[i]); 681 HTMLFormControlElement* control = toHTMLFormControlElement(element);
683 if (control->canBeSuccessfulSubmitButton()) 682 if (control->canBeSuccessfulSubmitButton())
684 return control; 683 return control;
685 } 684 }
686 685 return nullptr;
687 return 0;
688 } 686 }
689 687
690 bool HTMLFormElement::checkValidity() 688 bool HTMLFormElement::checkValidity()
691 { 689 {
692 return !checkInvalidControlsAndCollectUnhandled(0, CheckValidityDispatchInva lidEvent); 690 return !checkInvalidControlsAndCollectUnhandled(0, CheckValidityDispatchInva lidEvent);
693 } 691 }
694 692
695 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<R efPtrWillBeMember<HTMLFormControlElement>>* unhandledInvalidControls, CheckValid ityEventBehavior eventBehavior) 693 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<R efPtrWillBeMember<HTMLFormControlElement>>* unhandledInvalidControls, CheckValid ityEventBehavior eventBehavior)
696 { 694 {
697 RefPtrWillBeRawPtr<HTMLFormElement> protector(this); 695 RefPtrWillBeRawPtr<HTMLFormElement> protector(this);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 { 841 {
844 for (const auto& control : associatedElements()) { 842 for (const auto& control : associatedElements()) {
845 if (!control->isFormControlElement()) 843 if (!control->isFormControlElement())
846 continue; 844 continue;
847 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton()) 845 if (toHTMLFormControlElement(control)->canBeSuccessfulSubmitButton())
848 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault); 846 toHTMLFormControlElement(control)->pseudoStateChanged(CSSSelector::P seudoDefault);
849 } 847 }
850 } 848 }
851 849
852 } // namespace blink 850 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLFormElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698