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

Unified Diff: third_party/WebKit/LayoutTests/cssom/serialize-namespaced-type-selectors.html

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 | « no previous file | third_party/WebKit/LayoutTests/fast/css/css-selector-text.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/cssom/serialize-namespaced-type-selectors.html
diff --git a/third_party/WebKit/LayoutTests/cssom/serialize-namespaced-type-selectors.html b/third_party/WebKit/LayoutTests/cssom/serialize-namespaced-type-selectors.html
new file mode 100644
index 0000000000000000000000000000000000000000..84e828285bf60f7e878ef128d4ee363c1941444a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/cssom/serialize-namespaced-type-selectors.html
@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style id="teststyles">
+</style>
+<script>
+ var ns_rule = "@namespace ns url(ns);";
+ var default_ns_rules = "@namespace url(default_ns); @namespace nsdefault url(default_ns);" + ns_rule;
+
+ function assert_selector_serializes_to(source, expected_result) {
+ var style_element = document.getElementById("teststyles");
+ style_element.firstChild.data = source + "{ font-size: 1em; }";
+ var sheet = style_element.sheet;
+ assert_equals(sheet.cssRules[sheet.cssRules.length - 1].selectorText, expected_result);
+ }
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "e", "e");
+ assert_selector_serializes_to(default_ns_rules + "e", "e");
+ }, "Simple type selector");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "|e", "|e");
+ assert_selector_serializes_to(default_ns_rules + "|e", "|e");
+ }, "Type selector without a namespace");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "*|e", "e");
+ assert_selector_serializes_to(default_ns_rules + "*|e", "*|e");
+ }, "Type selector with any namespace");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "*", "*");
+ assert_selector_serializes_to(default_ns_rules + "*", "*");
+ }, "Universal selector");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "|*", "|*");
+ assert_selector_serializes_to(default_ns_rules + "|*", "|*");
+ }, "Universal selector without a namespace");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "*|*", "*");
+ assert_selector_serializes_to(default_ns_rules + "*|*", "*|*");
+ }, "Universal selector in any namespace");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "ns|e", "ns|e");
+ assert_selector_serializes_to(default_ns_rules + "ns|e", "ns|e");
+ }, "Type selector with namespace");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "ns|*", "ns|*");
+ assert_selector_serializes_to(default_ns_rules + "ns|*", "ns|*");
+ }, "Universal selector with namespace");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "e.c", "e.c");
+ assert_selector_serializes_to(default_ns_rules + "e.c", "e.c");
+ }, "Simple type selector followed by class");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "|e.c", "|e.c");
+ assert_selector_serializes_to(default_ns_rules + "|e.c", "|e.c");
+ }, "Type selector without a namespace followed by class");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "*|e.c", "e.c");
+ assert_selector_serializes_to(default_ns_rules + "*|e.c", "*|e.c");
+ }, "Type selector with any namespace followed by class");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "*.c", ".c");
+ assert_selector_serializes_to(default_ns_rules + "*.c", ".c");
+ }, "Universal selector followed by class");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "|*.c", "|*.c");
+ assert_selector_serializes_to(default_ns_rules + "|*.c", "|*.c");
+ }, "Universal selector without a namespace followed by class");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "*|*.c", ".c");
+ assert_selector_serializes_to(default_ns_rules + "*|*.c", "*|*.c");
+ }, "Universal selector in any namespace followed by class");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "ns|e.c", "ns|e.c");
+ assert_selector_serializes_to(default_ns_rules + "ns|e.c", "ns|e.c");
+ }, "Type selector with namespace followed by class");
+ test(function() {
+ assert_selector_serializes_to(ns_rule + "ns|*.c", "ns|*.c");
+ assert_selector_serializes_to(default_ns_rules + "ns|*.c", "ns|*.c");
+ }, "Universal selector with namespace followed by class");
+ test(function() {
+ assert_selector_serializes_to(default_ns_rules + "nsdefault|e", "e");
+ }, "Type selector with namespace equal to default namespace");
+ test(function() {
+ assert_selector_serializes_to(default_ns_rules + "nsdefault|*", "*");
+ }, "Universal selector with namespace equal to default namespace");
+ test(function() {
+ assert_selector_serializes_to(default_ns_rules + "nsdefault|e.c", "e.c");
+ }, "Type selector with namespace equal to default namespace followed by class");
+ test(function() {
+ assert_selector_serializes_to(default_ns_rules + "nsdefault|*.c", ".c");
+ }, "Universal selector with namespace equal to default namespace followed by class");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/css-selector-text.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698