Left: | ||
Right: |
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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 middile: true, | 522 middile: true, |
523 inside: true, | 523 inside: true, |
524 sibling: true, | 524 sibling: true, |
525 sibling2: true, | 525 sibling2: true, |
526 toHide: true | 526 toHide: true |
527 }; | 527 }; |
528 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling( | 528 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling( |
529 test, "div:-abp-has(> span:-abp-contains(Advertisment))", expectations); | 529 test, "div:-abp-has(> span:-abp-contains(Advertisment))", expectations); |
530 }; | 530 }; |
531 | 531 |
532 // See issue https://issues.adblockplus.org/ticket/7359 | |
533 // and issue https://issues.adblockplus.org/ticket/7428 | |
534 async function runTestQualifier(test, selector) | |
535 { | |
536 testDocument.body.innerHTML = ` | |
537 <style> | |
538 span::before { | |
539 content: "any"; | |
540 } | |
541 </style> | |
542 <div id="toHide"> | |
543 <a> | |
544 <p> | |
545 <span></span> | |
546 </p> | |
547 </a> | |
548 </div>`; | |
549 | |
550 if (await applyElemHideEmulation(test, [selector])) | |
551 expectHidden(test, testDocument.getElementById("toHide")); | |
552 | |
553 test.done(); | |
554 } | |
555 | |
556 exports.testPropertySelectorCombinatorQualifier = function(test) | |
557 { | |
558 runTestQualifier( | |
559 test, | |
560 "div:-abp-has(> a p > :-abp-properties(content: \"any\"))" | |
561 ); | |
562 }; | |
563 | |
564 exports.testPropertySelectorCombinatorQualifierNested = function(test) | |
565 { | |
566 runTestQualifier( | |
567 test, | |
568 "div:-abp-has(> a p:-abp-has(> span:-abp-properties(content: \"any\")))" | |
Manish Jethani
2019/04/03 18:37:40
Thanks for rebasing, it is looking good now, but s
hub
2019/04/03 18:53:20
Done.
| |
569 ); | |
570 }; | |
571 | |
532 async function runTestPseudoClassContains(test, selector, expectations) | 572 async function runTestPseudoClassContains(test, selector, expectations) |
533 { | 573 { |
534 testDocument.body.innerHTML = `<div id="parent"> | 574 testDocument.body.innerHTML = `<div id="parent"> |
535 <div id="middle"> | 575 <div id="middle"> |
536 <div id="middle1"><div id="inside" class="inside"></div></div> | 576 <div id="middle1"><div id="inside" class="inside"></div></div> |
537 </div> | 577 </div> |
538 <div id="sibling"> | 578 <div id="sibling"> |
539 <div id="tohide">to hide \ud83d\ude42!</div> | 579 <div id="tohide">to hide \ud83d\ude42!</div> |
540 </div> | 580 </div> |
541 <div id="sibling2"> | 581 <div id="sibling2"> |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1065 { | 1105 { |
1066 if (element.id == "n2" || element.id == "n2_3") | 1106 if (element.id == "n2" || element.id == "n2_3") |
1067 expectProcessed(test, element, element.id); | 1107 expectProcessed(test, element, element.id); |
1068 else | 1108 else |
1069 expectNotProcessed(test, element, element.id); | 1109 expectNotProcessed(test, element, element.id); |
1070 } | 1110 } |
1071 } | 1111 } |
1072 | 1112 |
1073 test.done(); | 1113 test.done(); |
1074 }; | 1114 }; |
OLD | NEW |