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

Unified Diff: third_party/WebKit/Source/core/css/SelectorChecker.cpp

Issue 2795143004: [selectors4] Implement :focus-within pseudo-class (Closed)
Patch Set: Now passing all the tests from WPT 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 bd025d51f8dedf3da6c07a797ab5a300b94e7dad..229a71e81340ebe9e641110aa07932d153a98d9c 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;

Powered by Google App Engine
This is Rietveld 408576698