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 async function runTestCombinatorQualifier(test, selector) | |
534 { | |
535 testDocument.body.innerHTML = ` | |
536 <style> | |
537 span::before { | |
538 content: "any"; | |
539 } | |
540 </style> | |
541 <div id="toHide"> | |
542 <a> | |
543 <p> | |
544 <span></span> | |
545 </p> | |
546 </a> | |
547 </div> | |
548 `; | |
549 if (await applyElemHideEmulation(test, [selector])) | |
550 { | |
551 expectHidden(test, testDocument.getElementById("toHide")); | |
552 } | |
553 | |
554 test.done(); | |
555 } | |
556 | |
557 exports.testPropertySelectorCombinatorQualifier = function(test) | |
558 { | |
559 runTestCombinatorQualifier( | |
560 test, | |
561 "div:-abp-has(> a p > :-abp-properties(content: \"any\"))" | |
562 ); | |
563 }; | |
564 | |
565 exports.testPropertySelectorCombinatorQualifier2 = function(test) | |
566 { | |
567 runTestCombinatorQualifier( | |
Manish Jethani
2019/04/02 06:29:10
Can this (and possibly more tests in the future) b
hub
2019/04/02 14:29:11
Done
| |
568 test, | |
569 "div:-abp-has(> a p:-abp-has(> span:-abp-properties(content: \"any\")))" | |
570 ); | |
571 }; | |
572 | |
532 async function runTestPseudoClassContains(test, selector, expectations) | 573 async function runTestPseudoClassContains(test, selector, expectations) |
533 { | 574 { |
534 testDocument.body.innerHTML = ` <style type="text/css"> | 575 testDocument.body.innerHTML = ` <style type="text/css"> |
535 body { | 576 body { |
536 margin: 0; | 577 margin: 0; |
537 padding: 0; | 578 padding: 0; |
538 } | 579 } |
539 .transparent { | 580 .transparent { |
540 opacity: 0; | 581 opacity: 0; |
541 position: absolute; | 582 position: absolute; |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1146 { | 1187 { |
1147 if (element.id == "n2" || element.id == "n2_3") | 1188 if (element.id == "n2" || element.id == "n2_3") |
1148 expectProcessed(test, element, element.id); | 1189 expectProcessed(test, element, element.id); |
1149 else | 1190 else |
1150 expectNotProcessed(test, element, element.id); | 1191 expectNotProcessed(test, element, element.id); |
1151 } | 1192 } |
1152 } | 1193 } |
1153 | 1194 |
1154 test.done(); | 1195 test.done(); |
1155 }; | 1196 }; |
OLD | NEW |