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

Unified Diff: third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.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/resolver/SharedStyleFinderTest.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.cpp b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.cpp
index 94a93d98d388c656c2e27f8092729c2dd46bf1c8..bc00bec9e17cb5b108490dda808261e3cee54e31 100644
--- a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/SharedStyleFinderTest.cpp
@@ -157,6 +157,25 @@ TEST_F(SharedStyleFinderTest, AttributeAffectedByFocus) {
EXPECT_FALSE(MatchesUncommonAttributeRuleSet(*b));
}
+TEST_F(SharedStyleFinderTest, AttributeAffectedByFocusWithin) {
+ SetBodyContent("<div id=a attr></div><div id=b></div>");
+
+ AddSelector("[attr]:focus-within");
+ FinishAddingSelectors();
+
+ Element* a = GetDocument().GetElementById("a");
+ Element* b = GetDocument().GetElementById("b");
+
+ ASSERT_TRUE(a);
+ ASSERT_TRUE(b);
+
+ EXPECT_FALSE(a->HasFocusWithin());
+ EXPECT_FALSE(b->HasFocusWithin());
+
+ EXPECT_TRUE(MatchesUncommonAttributeRuleSet(*a));
+ EXPECT_FALSE(MatchesUncommonAttributeRuleSet(*b));
+}
+
TEST_F(SharedStyleFinderTest, AttributeAffectedByActive) {
SetBodyContent("<div id=a attr></div><div id=b></div>");
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp ('k') | third_party/WebKit/Source/core/dom/ContainerNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698