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

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

Issue 1607873002: Serialize namespaced type/* selectors according to CSSOM spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@queryselector-no-pseudoelm-20160118
Patch Set: Rebased 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
« no previous file with comments | « third_party/WebKit/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: 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 f09f9a7af1277b367e32e5f900441ddd405e0601..7e4f1ffc6ef04542870c8a013ebfb1027ce8bcdb 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp
@@ -271,4 +271,37 @@ TEST(CSSSelectorParserTest, UnresolvedNamespacePrefix)
}
}
+TEST(CSSSelectorParserTest, SerializedUniversal)
+{
+ const char* testCases[][2] = {
+ { "*::-webkit-volume-slider", "::-webkit-volume-slider" },
+ { "*::cue(i)", "::cue(i)" },
+ { "*::shadow", "::shadow" },
+ { "*:host-context(.x)", "*:host-context(.x)" },
+ { "*:host", "*:host" },
+ { "|*::-webkit-volume-slider", "|*::-webkit-volume-slider" },
+ { "|*::cue(i)", "|*::cue(i)" },
+ { "|*::shadow", "|*::shadow" },
+ { "*|*::-webkit-volume-slider", "::-webkit-volume-slider" },
+ { "*|*::cue(i)", "::cue(i)" },
+ { "*|*::shadow", "::shadow" },
+ { "ns|*::-webkit-volume-slider", "ns|*::-webkit-volume-slider" },
+ { "ns|*::cue(i)", "ns|*::cue(i)" },
+ { "ns|*::shadow", "ns|*::shadow" }
+ };
+
+ CSSParserContext context(HTMLStandardMode, nullptr);
+ RefPtrWillBeRawPtr<StyleSheetContents> sheet = StyleSheetContents::create(context);
+ sheet->parserAddNamespace("ns", "http://ns.org");
+
+ for (auto testCase : testCases) {
+ SCOPED_TRACE(testCase[0]);
+ CSSTokenizer::Scope scope(testCase[0]);
+ CSSParserTokenRange range = scope.tokenRange();
+ CSSSelectorList list = CSSSelectorParser::parseSelector(range, context, sheet.get());
+ EXPECT_TRUE(list.isValid());
+ EXPECT_STREQ(testCase[1], list.selectorsText().ascii().data());
+ }
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698