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

Delta Between Two Patch Sets: test/browser/elemHideEmulation.js

Issue 29836555: Issue 6680 - PropsSelector also depend on DOM modifications (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created July 23, 2018, 1:01 p.m.
Right Patch Set: Nits Created July 23, 2018, 9:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « lib/content/elemHideEmulation.js ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 applyElemHideEmulation( 234 applyElemHideEmulation(
235 ["div > :-abp-properties(background-color: rgb(0, 0, 0)) > div"] 235 ["div > :-abp-properties(background-color: rgb(0, 0, 0)) > div"]
236 ).then(() => 236 ).then(() =>
237 { 237 {
238 expectVisible(test, parent); 238 expectVisible(test, parent);
239 expectVisible(test, middle); 239 expectVisible(test, middle);
240 expectHidden(test, toHide); 240 expectHidden(test, toHide);
241 }).catch(unexpectedError.bind(test)).then(() => test.done()); 241 }).catch(unexpectedError.bind(test)).then(() => test.done());
242 }; 242 };
243 243
244 // 244 // Add the style. Then add the element for that style.
Manish Jethani 2018/07/23 20:44:01 Nit: We don't need these extra blank lines in the
hub 2018/07/23 21:01:57 Done.
245 // Add the style. Then added the element for that style. 245 // This should retrigger the filtering and hide it.
Manish Jethani 2018/07/23 20:44:01 s/added/add/
hub 2018/07/23 21:01:57 Done.
246 // This should retrigger the filter and hide it. 246 exports.testPropertyPseudoSelectorAddStyleAndElement = function(test)
Manish Jethani 2018/07/23 20:44:01 s/filter/filtering/
hub 2018/07/23 21:01:58 Done.
247 //
248 exports.testPropertyPseudoSelectorAddedStyleAndElement = function(test)
Manish Jethani 2018/07/23 20:44:01 s/Added/Add/
hub 2018/07/23 21:01:58 Done.
249 { 247 {
250 let styleElement; 248 let styleElement;
251 let toHide; 249 let toHide;
252 applyElemHideEmulation( 250 applyElemHideEmulation(
253 [":-abp-properties(background-color: rgb(0, 0, 0))"] 251 [":-abp-properties(background-color: rgb(0, 0, 0))"]
254 ).then(() => 252 ).then(() =>
255 { 253 {
256 styleElement = testDocument.createElement("style"); 254 styleElement = testDocument.createElement("style");
257 testDocument.head.appendChild(styleElement); 255 testDocument.head.appendChild(styleElement);
258 styleElement.sheet.insertRule("#toHide {background-color: #000}"); 256 styleElement.sheet.insertRule("#toHide {background-color: #000}");
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 for (let element of [...testDocument.getElementsByTagName("div"), 1041 for (let element of [...testDocument.getElementsByTagName("div"),
1044 ...testDocument.getElementsByTagName("p")]) 1042 ...testDocument.getElementsByTagName("p")])
1045 { 1043 {
1046 if (element.id == "n2" || element.id == "n2_3") 1044 if (element.id == "n2" || element.id == "n2_3")
1047 expectProcessed(test, element, element.id); 1045 expectProcessed(test, element, element.id);
1048 else 1046 else
1049 expectNotProcessed(test, element, element.id); 1047 expectNotProcessed(test, element, element.id);
1050 } 1048 }
1051 }).catch(unexpectedError.bind(test)).then(() => test.done()); 1049 }).catch(unexpectedError.bind(test)).then(() => test.done());
1052 }; 1050 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld