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>"); |