OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 test.equal(qualifySelector("body div#bar", ".foo"), "body div.foo#bar"); | 49 test.equal(qualifySelector("body div#bar", ".foo"), "body div.foo#bar"); |
50 test.equal(qualifySelector("body div.bar", "#foo"), "body div#foo.bar"); | 50 test.equal(qualifySelector("body div.bar", "#foo"), "body div#foo.bar"); |
51 | 51 |
52 // Compound selectors with universal selector. | 52 // Compound selectors with universal selector. |
53 test.equal(qualifySelector("#foo *", "div"), "#foo div"); | 53 test.equal(qualifySelector("#foo *", "div"), "#foo div"); |
54 test.equal(qualifySelector(".foo *", "div"), ".foo div"); | 54 test.equal(qualifySelector(".foo *", "div"), ".foo div"); |
55 test.equal(qualifySelector("div *", "#foo"), "div #foo"); | 55 test.equal(qualifySelector("div *", "#foo"), "div #foo"); |
56 test.equal(qualifySelector("div *", ".foo"), "div .foo"); | 56 test.equal(qualifySelector("div *", ".foo"), "div .foo"); |
57 test.equal(qualifySelector("div#bar *", ".foo"), "div#bar .foo"); | 57 test.equal(qualifySelector("div#bar *", ".foo"), "div#bar .foo"); |
58 test.equal(qualifySelector("div.bar *", "#foo"), "div.bar #foo"); | 58 test.equal(qualifySelector("div.bar *", "#foo"), "div.bar #foo"); |
| 59 test.equal(qualifySelector("body *#foo", "div"), "body div#foo"); |
| 60 test.equal(qualifySelector("body *.foo", "div"), "body div.foo"); |
59 | 61 |
60 // Compound selectors with pseudo-class with parentheses. | 62 // Compound selectors with pseudo-class with parentheses. |
61 test.equal(qualifySelector("body #foo:nth-child(1)", "div"), | 63 test.equal(qualifySelector("body #foo:nth-child(1)", "div"), |
62 "body div#foo:nth-child(1)"); | 64 "body div#foo:nth-child(1)"); |
63 test.equal(qualifySelector("body .foo:nth-child(1)", "div"), | 65 test.equal(qualifySelector("body .foo:nth-child(1)", "div"), |
64 "body div.foo:nth-child(1)"); | 66 "body div.foo:nth-child(1)"); |
65 test.equal(qualifySelector("body div:nth-child(1)", "#foo"), | 67 test.equal(qualifySelector("body div:nth-child(1)", "#foo"), |
66 "body div#foo:nth-child(1)"); | 68 "body div#foo:nth-child(1)"); |
67 test.equal(qualifySelector("body div:nth-child(1)", ".foo"), | 69 test.equal(qualifySelector("body div:nth-child(1)", ".foo"), |
68 "body div.foo:nth-child(1)"); | 70 "body div.foo:nth-child(1)"); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 test.equal(qualifySelector("div, .bar", "#foo"), "div#foo, #foo.bar"); | 190 test.equal(qualifySelector("div, .bar", "#foo"), "div#foo, #foo.bar"); |
189 test.equal(qualifySelector("div, #bar", ".foo"), "div.foo, .foo#bar"); | 191 test.equal(qualifySelector("div, #bar", ".foo"), "div.foo, .foo#bar"); |
190 | 192 |
191 // Compound selector with class selector containing Unicode composite | 193 // Compound selector with class selector containing Unicode composite |
192 // character. | 194 // character. |
193 test.equal(qualifySelector("body .\ud83d\ude42", "img"), | 195 test.equal(qualifySelector("body .\ud83d\ude42", "img"), |
194 "body img.\ud83d\ude42"); | 196 "body img.\ud83d\ude42"); |
195 | 197 |
196 test.done(); | 198 test.done(); |
197 }; | 199 }; |
OLD | NEW |