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

Unified Diff: third_party/WebKit/Source/core/css/SelectorChecker.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/SelectorChecker.cpp
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
index de3cc38e0a99f0391d090692b2529de9cd044b6b..f632006a84b01a39886b70d67e65e8300485dd05 100644
--- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -914,6 +914,22 @@ bool SelectorChecker::CheckPseudoClass(const SelectorCheckingContext& context,
}
}
return MatchesFocusPseudoClass(element);
+ case CSSSelector::kPseudoFocusWithin:
+ if (mode_ == kSharingRules)
+ return true;
+ if (mode_ == kResolvingStyle) {
+ if (context.in_rightmost_compound) {
+ element_style_->SetAffectedByFocusWithin();
+ } else {
+ element_style_->SetUnique();
+ element.SetChildrenOrSiblingsAffectedByFocusWithin();
+ }
+ }
+ probe::forcePseudoState(&element, CSSSelector::kPseudoFocusWithin,
+ &force_pseudo_state);
+ if (force_pseudo_state)
+ return true;
+ return element.HasFocusWithin();
case CSSSelector::kPseudoHover:
if (mode_ == kSharingRules)
return true;
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.cpp ('k') | third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698