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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp

Issue 2795143004: [selectors4] Implement :focus-within pseudo-class (Closed)
Patch Set: Rebased patch Created 3 years, 8 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/parser/CSSSelectorParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
index bc452d94e3014ea1b8a639c0c146f435a4efc1c8..d728130d19768b8da84cfb46b3106ab3561f1209 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
@@ -173,6 +173,7 @@ bool IsUserActionPseudoClass(CSSSelector::PseudoType pseudo) {
switch (pseudo) {
case CSSSelector::kPseudoHover:
case CSSSelector::kPseudoFocus:
+ case CSSSelector::kPseudoFocusWithin:
case CSSSelector::kPseudoActive:
return true;
default:
@@ -443,6 +444,10 @@ std::unique_ptr<CSSParserSelector> CSSSelectorParser::ConsumePseudo(
bool has_arguments = token.GetType() == kFunctionToken;
selector->UpdatePseudoType(value, has_arguments);
+ if (!RuntimeEnabledFeatures::cssSelectorsFocusWithinEnabled() &&
+ selector->GetPseudoType() == CSSSelector::kPseudoFocusWithin)
+ return nullptr;
+
if (selector->Match() == CSSSelector::kPseudoElement &&
disallow_pseudo_elements_)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698