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

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

Issue 1756483005: Option, checkbox and radio should support ':default' selector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test is passed. So removing the expected file 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
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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 return element.active(); 824 return element.active();
825 case CSSSelector::PseudoEnabled: 825 case CSSSelector::PseudoEnabled:
826 if (element.isFormControlElement() || isHTMLOptionElement(element) || is HTMLOptGroupElement(element)) 826 if (element.isFormControlElement() || isHTMLOptionElement(element) || is HTMLOptGroupElement(element))
827 return !element.isDisabledFormControl(); 827 return !element.isDisabledFormControl();
828 if (isHTMLAnchorElement(element) || isHTMLAreaElement(element)) 828 if (isHTMLAnchorElement(element) || isHTMLAreaElement(element))
829 return element.isLink(); 829 return element.isLink();
830 break; 830 break;
831 case CSSSelector::PseudoFullPageMedia: 831 case CSSSelector::PseudoFullPageMedia:
832 return element.document().isMediaDocument(); 832 return element.document().isMediaDocument();
833 case CSSSelector::PseudoDefault: 833 case CSSSelector::PseudoDefault:
834 return element.isDefaultButtonForForm(); 834 if (element.isDefaultButtonForForm())
835 return true;
836 if (isHTMLInputElement(element)) {
tkent 2016/03/03 06:46:02 You shouldn't add code here. You should override
ramya.v 2016/03/03 10:29:19 Done.
837 HTMLInputElement& inputElement = toHTMLInputElement(element);
838 if (inputElement.shouldAppearChecked() && !inputElement.shouldAppear Indeterminate())
tkent 2016/03/03 06:46:02 The specification doesn't ask to check them. It s
ramya.v 2016/03/03 10:29:19 Done.
839 return true;
840 } else if (isHTMLOptionElement(element) && toHTMLOptionElement(element). selected()) {
tkent 2016/03/03 06:46:02 The specification doesn't ask to check |selected|
ramya.v 2016/03/03 10:29:19 Done.
841 return true;
842 }
843 break;
835 case CSSSelector::PseudoDisabled: 844 case CSSSelector::PseudoDisabled:
836 // TODO(esprehn): Why not just always return isDisabledFormControl()? 845 // TODO(esprehn): Why not just always return isDisabledFormControl()?
837 // Can it be true for elements not in the list below? 846 // Can it be true for elements not in the list below?
838 if (element.isFormControlElement() || isHTMLOptionElement(element) || is HTMLOptGroupElement(element)) 847 if (element.isFormControlElement() || isHTMLOptionElement(element) || is HTMLOptGroupElement(element))
839 return element.isDisabledFormControl(); 848 return element.isDisabledFormControl();
840 break; 849 break;
841 case CSSSelector::PseudoReadOnly: 850 case CSSSelector::PseudoReadOnly:
842 return element.matchesReadOnlyPseudoClass(); 851 return element.matchesReadOnlyPseudoClass();
843 case CSSSelector::PseudoReadWrite: 852 case CSSSelector::PseudoReadWrite:
844 return element.matchesReadWritePseudoClass(); 853 return element.matchesReadWritePseudoClass();
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 } 1152 }
1144 1153
1145 bool SelectorChecker::matchesFocusPseudoClass(const Element& element) 1154 bool SelectorChecker::matchesFocusPseudoClass(const Element& element)
1146 { 1155 {
1147 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus)) 1156 if (InspectorInstrumentation::forcePseudoState(const_cast<Element*>(&element ), CSSSelector::PseudoFocus))
1148 return true; 1157 return true;
1149 return element.focused() && isFrameFocused(element); 1158 return element.focused() && isFrameFocused(element);
1150 } 1159 }
1151 1160
1152 } // namespace blink 1161 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/selectors/pseudo-classes/default-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698