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

Side by Side Diff: Source/core/css/SelectorChecker.cpp

Issue 616443002: Implement :valid and :invalid pseudoclass for <form> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix the problem with shared element style 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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 case CSSSelector::PseudoReadOnly: 802 case CSSSelector::PseudoReadOnly:
803 return element.matchesReadOnlyPseudoClass(); 803 return element.matchesReadOnlyPseudoClass();
804 case CSSSelector::PseudoReadWrite: 804 case CSSSelector::PseudoReadWrite:
805 return element.matchesReadWritePseudoClass(); 805 return element.matchesReadWritePseudoClass();
806 case CSSSelector::PseudoOptional: 806 case CSSSelector::PseudoOptional:
807 return element.isOptionalFormControl(); 807 return element.isOptionalFormControl();
808 case CSSSelector::PseudoRequired: 808 case CSSSelector::PseudoRequired:
809 return element.isRequiredFormControl(); 809 return element.isRequiredFormControl();
810 case CSSSelector::PseudoValid: 810 case CSSSelector::PseudoValid:
811 element.document().setContainsValidityStyleRules(); 811 element.document().setContainsValidityStyleRules();
812 return element.willValidate() && element.isValidFormControlElement() ; 812 return element.willValidate() && element.isValidElement();
813 case CSSSelector::PseudoInvalid: 813 case CSSSelector::PseudoInvalid:
814 element.document().setContainsValidityStyleRules(); 814 element.document().setContainsValidityStyleRules();
815 return element.willValidate() && !element.isValidFormControlElement( ); 815 return element.willValidate() && !element.isValidElement();
816 case CSSSelector::PseudoChecked: 816 case CSSSelector::PseudoChecked:
817 { 817 {
818 if (isHTMLInputElement(element)) { 818 if (isHTMLInputElement(element)) {
819 HTMLInputElement& inputElement = toHTMLInputElement(element) ; 819 HTMLInputElement& inputElement = toHTMLInputElement(element) ;
820 // Even though WinIE allows checked and indeterminate to 820 // Even though WinIE allows checked and indeterminate to
821 // co-exist, the CSS selector spec says that you can't be 821 // co-exist, the CSS selector spec says that you can't be
822 // both checked and indeterminate. We will behave like WinIE 822 // both checked and indeterminate. We will behave like WinIE
823 // behind the scenes and just obey the CSS spec here in the 823 // behind the scenes and just obey the CSS spec here in the
824 // test for matching the pseudo. 824 // test for matching the pseudo.
825 if (inputElement.shouldAppearChecked() && !inputElement.shou ldAppearIndeterminate()) 825 if (inputElement.shouldAppearChecked() && !inputElement.shou ldAppearIndeterminate())
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 return isHTMLSelectElement(element) && !toHTMLSelectElement(element).usesMen uList(); 1132 return isHTMLSelectElement(element) && !toHTMLSelectElement(element).usesMen uList();
1133 } 1133 }
1134 1134
1135 template 1135 template
1136 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const; 1136 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst DOMSiblingTraversalStrategy&, MatchResult*) const;
1137 1137
1138 template 1138 template
1139 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const; 1139 SelectorChecker::Match SelectorChecker::match(const SelectorCheckingContext&, co nst ShadowDOMSiblingTraversalStrategy&, MatchResult*) const;
1140 1140
1141 } 1141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698