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

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

Issue 1706793002: Don't add to uncommonAttributeRules for non-sharable cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleSet.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 39f4edcabffabdd765959137d8c46a083a9e22fc..4f9d55b37f323810e027f85537abb6bf35249093 100644
--- a/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
@@ -184,6 +184,11 @@ public:
EXPECT_EQ(count, m_ruleFeatureSet.siblingRules.size());
}
+ void expectUncommonAttributeRuleCount(unsigned count)
+ {
+ EXPECT_EQ(count, m_ruleFeatureSet.uncommonAttributeRules.size());
+ }
+
DEFINE_INLINE_TRACE()
{
#if ENABLE(OILPAN)
@@ -423,4 +428,52 @@ TEST_F(RuleFeatureSetTest, siblingRulesBeforeHostContext)
expectSiblingRuleCount(0);
}
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesAfterContentPseudo)
+{
+ collectFeatures("div ::content [attr]");
+ expectUncommonAttributeRuleCount(1);
+}
+
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesBeforeContentPseudo)
+{
+ collectFeatures("[attr] ::content div");
+ expectUncommonAttributeRuleCount(0);
+}
+
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesSlotted)
+{
+ collectFeatures("::slotted([attr])");
+ expectUncommonAttributeRuleCount(1);
+}
+
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesBeforeSlotted)
+{
+ collectFeatures("[attr]::slotted(*)");
+ expectUncommonAttributeRuleCount(0);
+}
+
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesHost)
+{
+ collectFeatures(":host([attr])");
+ expectUncommonAttributeRuleCount(1);
+}
+
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesBeforeHost)
+{
+ collectFeatures("[attr] :host");
+ expectUncommonAttributeRuleCount(0);
+}
+
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesHostContext)
+{
+ collectFeatures(":host-context([attr])");
+ expectUncommonAttributeRuleCount(1);
+}
+
+TEST_F(RuleFeatureSetTest, uncommonAttributeRulesBeforeHostContext)
+{
+ collectFeatures("[attr] :host-context(div)");
+ expectUncommonAttributeRuleCount(0);
+}
+
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/RuleSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698