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

Side by Side 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, 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <style id="teststyles">
5 </style>
6 <script>
7 var ns_rule = "@namespace ns url(ns);";
8 var default_ns_rules = "@namespace url(default_ns); @namespace nsdefault url (default_ns);" + ns_rule;
9
10 function assert_selector_serializes_to(source, expected_result) {
11 var style_element = document.getElementById("teststyles");
12 style_element.firstChild.data = source + "{ font-size: 1em; }";
13 var sheet = style_element.sheet;
14 assert_equals(sheet.cssRules[sheet.cssRules.length - 1].selectorText, ex pected_result);
15 }
16 test(function() {
17 assert_selector_serializes_to(ns_rule + "e", "e");
18 assert_selector_serializes_to(default_ns_rules + "e", "e");
19 }, "Simple type selector");
20 test(function() {
21 assert_selector_serializes_to(ns_rule + "|e", "|e");
22 assert_selector_serializes_to(default_ns_rules + "|e", "|e");
23 }, "Type selector without a namespace");
24 test(function() {
25 assert_selector_serializes_to(ns_rule + "*|e", "e");
26 assert_selector_serializes_to(default_ns_rules + "*|e", "*|e");
27 }, "Type selector with any namespace");
28 test(function() {
29 assert_selector_serializes_to(ns_rule + "*", "*");
30 assert_selector_serializes_to(default_ns_rules + "*", "*");
31 }, "Universal selector");
32 test(function() {
33 assert_selector_serializes_to(ns_rule + "|*", "|*");
34 assert_selector_serializes_to(default_ns_rules + "|*", "|*");
35 }, "Universal selector without a namespace");
36 test(function() {
37 assert_selector_serializes_to(ns_rule + "*|*", "*");
38 assert_selector_serializes_to(default_ns_rules + "*|*", "*|*");
39 }, "Universal selector in any namespace");
40 test(function() {
41 assert_selector_serializes_to(ns_rule + "ns|e", "ns|e");
42 assert_selector_serializes_to(default_ns_rules + "ns|e", "ns|e");
43 }, "Type selector with namespace");
44 test(function() {
45 assert_selector_serializes_to(ns_rule + "ns|*", "ns|*");
46 assert_selector_serializes_to(default_ns_rules + "ns|*", "ns|*");
47 }, "Universal selector with namespace");
48 test(function() {
49 assert_selector_serializes_to(ns_rule + "e.c", "e.c");
50 assert_selector_serializes_to(default_ns_rules + "e.c", "e.c");
51 }, "Simple type selector followed by class");
52 test(function() {
53 assert_selector_serializes_to(ns_rule + "|e.c", "|e.c");
54 assert_selector_serializes_to(default_ns_rules + "|e.c", "|e.c");
55 }, "Type selector without a namespace followed by class");
56 test(function() {
57 assert_selector_serializes_to(ns_rule + "*|e.c", "e.c");
58 assert_selector_serializes_to(default_ns_rules + "*|e.c", "*|e.c");
59 }, "Type selector with any namespace followed by class");
60 test(function() {
61 assert_selector_serializes_to(ns_rule + "*.c", ".c");
62 assert_selector_serializes_to(default_ns_rules + "*.c", ".c");
63 }, "Universal selector followed by class");
64 test(function() {
65 assert_selector_serializes_to(ns_rule + "|*.c", "|*.c");
66 assert_selector_serializes_to(default_ns_rules + "|*.c", "|*.c");
67 }, "Universal selector without a namespace followed by class");
68 test(function() {
69 assert_selector_serializes_to(ns_rule + "*|*.c", ".c");
70 assert_selector_serializes_to(default_ns_rules + "*|*.c", "*|*.c");
71 }, "Universal selector in any namespace followed by class");
72 test(function() {
73 assert_selector_serializes_to(ns_rule + "ns|e.c", "ns|e.c");
74 assert_selector_serializes_to(default_ns_rules + "ns|e.c", "ns|e.c");
75 }, "Type selector with namespace followed by class");
76 test(function() {
77 assert_selector_serializes_to(ns_rule + "ns|*.c", "ns|*.c");
78 assert_selector_serializes_to(default_ns_rules + "ns|*.c", "ns|*.c");
79 }, "Universal selector with namespace followed by class");
80 test(function() {
81 assert_selector_serializes_to(default_ns_rules + "nsdefault|e", "e");
82 }, "Type selector with namespace equal to default namespace");
83 test(function() {
84 assert_selector_serializes_to(default_ns_rules + "nsdefault|*", "*");
85 }, "Universal selector with namespace equal to default namespace");
86 test(function() {
87 assert_selector_serializes_to(default_ns_rules + "nsdefault|e.c", "e.c") ;
88 }, "Type selector with namespace equal to default namespace followed by clas s");
89 test(function() {
90 assert_selector_serializes_to(default_ns_rules + "nsdefault|*.c", ".c");
91 }, "Universal selector with namespace equal to default namespace followed by class");
92 </script>
OLDNEW
« 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