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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 expectVisible(test, sibling2); | 382 expectVisible(test, sibling2); |
383 expectHidden(test, toHide); | 383 expectHidden(test, toHide); |
384 }).catch(unexpectedError.bind(test)).then(() => test.done()); | 384 }).catch(unexpectedError.bind(test)).then(() => test.done()); |
385 } | 385 } |
386 | 386 |
387 exports.testPseudoClassHasSelectorWithHasAndWithSuffixSibling = function(test) | 387 exports.testPseudoClassHasSelectorWithHasAndWithSuffixSibling = function(test) |
388 { | 388 { |
389 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, "div:-abp-has(:
-abp-has(div.inside)) + div > div"); | 389 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, "div:-abp-has(:
-abp-has(div.inside)) + div > div"); |
390 }; | 390 }; |
391 | 391 |
| 392 exports.testPseudoClassHasSelectorWithHasAndWithSuffixSibling2 = function(test) |
| 393 { |
| 394 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, "div:-abp-has(:
-abp-has(> div.inside)) + div > div"); |
| 395 }; |
| 396 |
392 exports.testPseudoClassHasSelectorWithPropSelector = function(test) | 397 exports.testPseudoClassHasSelectorWithPropSelector = function(test) |
393 { | 398 { |
394 let parent = createElementWithStyle("{}"); | 399 let parent = createElementWithStyle("{}"); |
395 let child = createElementWithStyle("{background-color: #000}", parent); | 400 let child = createElementWithStyle("{background-color: #000}", parent); |
396 applyElemHideEmulation( | 401 applyElemHideEmulation( |
397 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] | 402 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] |
398 ).then(() => | 403 ).then(() => |
399 { | 404 { |
400 expectVisible(test, child); | 405 expectVisible(test, child); |
401 expectHidden(test, parent); | 406 expectHidden(test, parent); |
402 }).catch(unexpectedError.bind(test)).then(() => test.done()); | 407 }).catch(unexpectedError.bind(test)).then(() => test.done()); |
403 }; | 408 }; |
404 | 409 |
405 exports.testPseudoClassHasSelectorWithPropSelector2 = function(test) | 410 exports.testPseudoClassHasSelectorWithPropSelector2 = function(test) |
406 { | 411 { |
407 let parent = createElementWithStyle("{}"); | 412 let parent = createElementWithStyle("{}"); |
408 let child = createElementWithStyle("{}", parent); | 413 let child = createElementWithStyle("{}", parent); |
409 insertStyleRule("body #" + parent.id + " > div { background-color: #000}"); | 414 insertStyleRule("body #" + parent.id + " > div { background-color: #000}"); |
410 applyElemHideEmulation( | 415 applyElemHideEmulation( |
411 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] | 416 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] |
412 ).then(() => | 417 ).then(() => |
413 { | 418 { |
414 expectVisible(test, child); | 419 expectVisible(test, child); |
415 expectHidden(test, parent); | 420 expectHidden(test, parent); |
416 }).catch(unexpectedError.bind(test)).then(() => test.done()); | 421 }).catch(unexpectedError.bind(test)).then(() => test.done()); |
417 }; | 422 }; |
OLD | NEW |