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

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

Issue 1544893003: Don't add rule features across ::content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed :host-context regression Created 5 years 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/RuleFeatureSetTest.cpp
diff --git a/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp b/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
index 4bf74af49e110f4541d331c937bbcb9799187083..a60fbe5a511123ab52557e9e9c6aa74cca010912 100644
--- a/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
@@ -113,6 +113,13 @@ public:
EXPECT_TRUE(classes.contains(className));
}
+ void expectNoClassInvalidation(const AtomicString& className, InvalidationSetVector& invalidationSets)
Eric Willigers 2016/01/07 03:50:00 This isn't being used. Perhaps call it from a tes
rune 2016/01/07 09:55:18 The reason I didn't use it was because it will cra
+ {
+ EXPECT_EQ(1u, invalidationSets.size());
+ HashSet<AtomicString> classes = classSet(*invalidationSets[0]);
+ EXPECT_EQ(0u, classes.size());
+ }
+
void expectSiblingInvalidation(unsigned maxDirectAdjacentSelectors, const AtomicString& siblingName, InvalidationSetVector& invalidationSets)
{
EXPECT_EQ(1u, invalidationSets.size());
@@ -321,4 +328,20 @@ TEST_F(RuleFeatureSetTest, tagName)
expectTagNameInvalidation("e", invalidationLists.descendants);
}
+TEST_F(RuleFeatureSetTest, contentPseudo)
+{
+ updateInvalidationSets(".a ::content .b");
+ updateInvalidationSets(".a .c");
+
+ InvalidationLists invalidationLists;
+ collectInvalidationSetsForClass(invalidationLists, "a");
+ expectClassInvalidation("c", invalidationLists.descendants);
+
+ updateInvalidationSets(".a .b");
+
+ invalidationLists.descendants.clear();
+ collectInvalidationSetsForClass(invalidationLists, "a");
+ expectClassesInvalidation("b", "c", invalidationLists.descendants);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.cpp ('k') | third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698