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: 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 } 714 }
715 715
716 return 0; 716 return 0;
717 } 717 }
718 718
719 void HTMLFormElement::setNeedsValidityCheck() 719 void HTMLFormElement::setNeedsValidityCheck()
720 { 720 {
721 // For now unconditionally order style recalculation, which triggers 721 // For now unconditionally order style recalculation, which triggers
722 // validity recalculation. In the near future, implement validity cache and 722 // validity recalculation. In the near future, implement validity cache and
723 // recalculate style only if it changed. 723 // recalculate style only if it changed.
724 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::createW ithExtraData(StyleChangeReason::PseudoClass, StyleChangeExtraData::Invalid)); 724 pseudoStateChanged(CSSSelector::PseudoValid);
725 pseudoStateChanged(CSSSelector::PseudoInvalid);
725 } 726 }
726 727
727 bool HTMLFormElement::checkValidity() 728 bool HTMLFormElement::checkValidity()
728 { 729 {
729 return !checkInvalidControlsAndCollectUnhandled(0, CheckValidityDispatchInva lidEvent); 730 return !checkInvalidControlsAndCollectUnhandled(0, CheckValidityDispatchInva lidEvent);
730 } 731 }
731 732
732 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<R efPtrWillBeMember<HTMLFormControlElement> >* unhandledInvalidControls, CheckVali dityEventBehavior eventBehavior) 733 bool HTMLFormElement::checkInvalidControlsAndCollectUnhandled(WillBeHeapVector<R efPtrWillBeMember<HTMLFormControlElement> >* unhandledInvalidControls, CheckVali dityEventBehavior eventBehavior)
733 { 734 {
734 RefPtrWillBeRawPtr<HTMLFormElement> protector(this); 735 RefPtrWillBeRawPtr<HTMLFormElement> protector(this);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 } 858 }
858 859
859 void HTMLFormElement::setDemoted(bool demoted) 860 void HTMLFormElement::setDemoted(bool demoted)
860 { 861 {
861 if (demoted) 862 if (demoted)
862 UseCounter::count(document(), UseCounter::DemotedFormElement); 863 UseCounter::count(document(), UseCounter::DemotedFormElement);
863 m_wasDemoted = demoted; 864 m_wasDemoted = demoted;
864 } 865 }
865 866
866 } // namespace 867 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698