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

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

Issue 620333002: Use invalidation sets for :invalid/:valid/:required/:optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 2 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
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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 HTMLFormControlElement* control = toHTMLFormControlElement(elements[i]); 718 HTMLFormControlElement* control = toHTMLFormControlElement(elements[i]);
719 if (control->isSuccessfulSubmitButton()) 719 if (control->isSuccessfulSubmitButton())
720 return control; 720 return control;
721 } 721 }
722 722
723 return 0; 723 return 0;
724 } 724 }
725 725
726 void HTMLFormElement::setNeedsValidityCheck() 726 void HTMLFormElement::setNeedsValidityCheck()
727 { 727 {
728 // For now unconditionally order style recalculation, which triggers 728 // For now unconditionally order style recalculation, which triggers
dglazkov 2014/10/24 17:13:25 Is this comment still valid?
rune 2014/10/24 20:12:26 Yes. With this CL we still recalculate style witho
729 // validity recalculation. In the near future, implement validity cache and 729 // validity recalculation. In the near future, implement validity cache and
730 // recalculate style only if it changed. 730 // recalculate style only if it changed.
731 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createW ithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Invalid)); 731 pseudoStateChanged(CSSSelector::PseudoValid);
732 pseudoStateChanged(CSSSelector::PseudoInvalid);
732 } 733 }
733 734
734 bool HTMLFormElement::checkValidity() 735 bool HTMLFormElement::checkValidity()
735 { 736 {
736 return !checkInvalidControlsAndCollectUnhandled(0); 737 return !checkInvalidControlsAndCollectUnhandled(0);
737 } 738 }
738 739
739 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<R efPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls) 740 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<R efPtrWillBeMember<FormAssociatedElement> >* unhandledInvalidControls)
740 { 741 {
741 RefPtrWillBeRawPtr<HTMLFormElement> protector(this); 742 RefPtrWillBeRawPtr<HTMLFormElement> protector(this);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 } 860 }
860 861
861 void HTMLFormElement::setDemoted(bool demoted) 862 void HTMLFormElement::setDemoted(bool demoted)
862 { 863 {
863 if (demoted) 864 if (demoted)
864 UseCounter::count(document(), UseCounter::DemotedFormElement); 865 UseCounter::count(document(), UseCounter::DemotedFormElement);
865 m_wasDemoted = demoted; 866 m_wasDemoted = demoted;
866 } 867 }
867 868
868 } // namespace 869 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/forms/TextFieldInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698