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

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

Issue 1094213002: Refactored compound selector parsing methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addresses review issues Created 5 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
« no previous file with comments | « Source/core/css/parser/CSSSelectorParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSSelectorParserTest.cpp
diff --git a/Source/core/css/parser/CSSSelectorParserTest.cpp b/Source/core/css/parser/CSSSelectorParserTest.cpp
index b3a52cd2b4daeb0bca50aea7f07edd5b26cd8ea2..fe9dbbd7b4dbcdfe489fce692d7e5fcc52058d09 100644
--- a/Source/core/css/parser/CSSSelectorParserTest.cpp
+++ b/Source/core/css/parser/CSSSelectorParserTest.cpp
@@ -5,6 +5,7 @@
#include "config.h"
#include "core/css/parser/CSSSelectorParser.h"
+#include "core/css/CSSSelectorList.h"
#include "core/css/parser/CSSTokenizer.h"
#include <gtest/gtest.h>
@@ -112,4 +113,24 @@ TEST(CSSSelectorParserTest, InvalidANPlusB)
}
}
+TEST(CSSSelectorParserTest, ContentPseudoInCompound)
+{
+ const char* testCases[][2] = {
+ { "::content", "*::content" }, // crbug.com/478969
+ { ".a::content", ".a::content" },
+ { "::content.a", ".a::content" },
+ { "::content.a.b", ".b.a::content" },
+ { ".a::content.b", ".b.a::content" },
+ };
+
+ for (unsigned i = 0; i < WTF_ARRAY_LENGTH(testCases); ++i) {
+ SCOPED_TRACE(testCases[i][0]);
+ CSSTokenizer::Scope scope(testCases[i][0]);
+ CSSParserTokenRange range = scope.tokenRange();
+ CSSSelectorList list;
+ CSSSelectorParser::parseSelector(range, CSSParserContext(HTMLStandardMode, nullptr), nullAtom, nullptr, list);
+ EXPECT_STREQ(testCases[i][1], list.selectorsText().ascii().data());
+ }
+}
+
} // namespace
« no previous file with comments | « Source/core/css/parser/CSSSelectorParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698