LEFT | RIGHT |
1 "use strict"; | 1 "use strict"; |
2 | 2 |
3 { | 3 { |
4 let filterClasses = require("filterClasses"); | 4 const {Filter, ElemHideFilter} = require("filterClasses"); |
5 let Filter = filterClasses.Filter; | 5 const {escapeCSS, quoteCSS} = require("filterComposer"); |
6 let ElemHideFilter = filterClasses.ElemHideFilter; | |
7 | |
8 let filterComposer = require("filterComposer"); | |
9 let escapeCSS = filterComposer.escapeCSS; | |
10 let quoteCSS = filterComposer.quoteCSS; | |
11 | 6 |
12 module("CSS escaping"); | 7 module("CSS escaping"); |
13 | 8 |
14 test("CSS escaping", () => | 9 test("CSS escaping", () => |
15 { | 10 { |
16 function testSelector(opts) | 11 function testSelector(opts) |
17 { | 12 { |
18 let mustMatch = opts.mustMatch !== false; | 13 let mustMatch = opts.mustMatch !== false; |
19 let doc = document.implementation.createHTMLDocument(); | 14 let doc = document.implementation.createHTMLDocument(); |
20 | 15 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 testEscape("x" + chr); | 96 testEscape("x" + chr); |
102 | 97 |
103 // Leading dashes must be escaped, when followed by certain characters. | 98 // Leading dashes must be escaped, when followed by certain characters. |
104 testEscape("-" + chr); | 99 testEscape("-" + chr); |
105 } | 100 } |
106 | 101 |
107 // Test some non-ASCII characters. However, those shouldn't require escaping
. | 102 // Test some non-ASCII characters. However, those shouldn't require escaping
. |
108 testEscape("\uD83D\uDE3B\u2665\u00E4"); | 103 testEscape("\uD83D\uDE3B\u2665\u00E4"); |
109 }); | 104 }); |
110 } | 105 } |
LEFT | RIGHT |