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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/SelectorChecker.cpp
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
index 2396d13e18564ae2a3f21645e43d69d9d792e84f..2a4dc1c5e378d0fdcec1fd9dddf087ada2bd062d 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -831,7 +831,16 @@ bool SelectorChecker::checkPseudoClass(const SelectorCheckingContext& context, M
case CSSSelector::PseudoFullPageMedia:
return element.document().isMediaDocument();
case CSSSelector::PseudoDefault:
- return element.isDefaultButtonForForm();
+ if (element.isDefaultButtonForForm())
+ return true;
+ 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.
+ HTMLInputElement& inputElement = toHTMLInputElement(element);
+ if (inputElement.shouldAppearChecked() && !inputElement.shouldAppearIndeterminate())
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.
+ return true;
+ } 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.
+ return true;
+ }
+ break;
case CSSSelector::PseudoDisabled:
// TODO(esprehn): Why not just always return isDisabledFormControl()?
// Can it be true for elements not in the list below?
« 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