Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/browser/elemHideEmulation.js

Issue 29676761: Issue 6296 - Handle relative prefix in :-abp-has() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rework the query selector all Created Jan. 25, 2018, 9:58 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« lib/content/elemHideEmulation.js ('K') | « lib/content/elemHideEmulation.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/browser/elemHideEmulation.js
===================================================================
--- a/test/browser/elemHideEmulation.js
+++ b/test/browser/elemHideEmulation.js
@@ -355,17 +355,17 @@
function runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, selector, expectations)
{
testDocument.body.innerHTML = `<div id="parent">
<div id="middle">
<div id="middle1"><div id="inside" class="inside"></div></div>
</div>
<div id="sibling">
- <div id="tohide">to hide</div>
+ <div id="tohide"><span>to hide</span></div>
</div>
<div id="sibling2">
<div id="sibling21"><div id="sibling211" class="inside"></div></div>
</div>
</div>`;
let elems = {
parent: testDocument.getElementById("parent"),
middle: testDocument.getElementById("middle"),
@@ -415,30 +415,58 @@
sibling: true,
sibling2: true,
toHide: false
};
runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(
test, "div:-abp-has(:-abp-has(> div.inside)) + div > div", expectations);
};
+exports.testPseudoClassHasSelectorWithHasAndWithSuffixSibling3 = function(test)
+{
+ let expectations = {
+ parent: true,
+ middile: true,
+ inside: true,
+ sibling: true,
+ sibling2: true,
+ toHide: false
+ };
+ runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(
+ test, "div:-abp-has(> div:-abp-has(div.inside)) + div > div", expectations);
+};
+
exports.testPseudoClassHasSelectorWithSuffixSiblingNoop = function(test)
{
let expectations = {
parent: true,
middile: true,
inside: true,
sibling: true,
sibling2: true,
toHide: true
};
runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(
test, "div:-abp-has(> body div.inside) + div > div", expectations);
};
+exports.testPseudoClassHasSelectorWithSuffixSiblingContains = function(test)
+{
+ let expectations = {
+ parent: true,
+ middile: true,
+ inside: true,
+ sibling: true,
+ sibling2: true,
+ toHide: true
+ };
+ runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(
+ test, "div:-abp-has(> span:-abp-contains(Advertisment))", expectations);
+};
+
exports.testPseudoClassContains = function(test)
{
testDocument.body.innerHTML = `<div id="parent">
<div id="middle">
<div id="middle1"><div id="inside" class="inside"></div></div>
</div>
<div id="sibling">
<div id="tohide">to hide</div>
« lib/content/elemHideEmulation.js ('K') | « lib/content/elemHideEmulation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld