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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp

Issue 1576553002: Pseudo element selectors in compound selector lists are invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/parser/CSSSelectorParserTest.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp
index 6596b8441ca4d28dc81146aca2720487281ee0b5..5ce37464007bad56110425a1de2c5ad52a57e711 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp
@@ -133,4 +133,29 @@ TEST(CSSSelectorParserTest, ShadowDomPseudoInCompound)
}
}
+TEST(CSSSelectorParserTest, PseudoElementsInCompoundLists)
+{
+ const char* testCases[] = {
+ ":not(::before)",
+ ":not(::content)",
+ ":not(::shadow)",
+ ":host(::before)",
+ ":host(::content)",
+ ":host(::shadow)",
+ ":host-context(::before)",
+ ":host-context(::content)",
+ ":host-context(::shadow)",
+ ":-webkit-any(::after, ::before)",
+ ":-webkit-any(::content, span)",
+ ":-webkit-any(div, ::shadow)"
+ };
+
+ for (unsigned i = 0; i < WTF_ARRAY_LENGTH(testCases); ++i) {
Timothy Loh 2016/01/11 05:20:54 range-based for loop? :)
rune 2016/01/11 09:30:22 Done.
+ CSSTokenizer::Scope scope(testCases[i]);
+ CSSParserTokenRange range = scope.tokenRange();
+ CSSSelectorList list = CSSSelectorParser::parseSelector(range, CSSParserContext(HTMLStandardMode, nullptr), nullptr);
+ EXPECT_FALSE(list.isValid());
+ }
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698