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

Unified Diff: lib/content/elemHideEmulation.js

Issue 29760699: Issue 6619 - Qualify CSS selectors in document style sheet correctly (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created April 24, 2018, 7:14 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
Index: lib/content/elemHideEmulation.js
===================================================================
--- a/lib/content/elemHideEmulation.js
+++ b/lib/content/elemHideEmulation.js
@@ -12,17 +12,18 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
"use strict";
-const {textToRegExp, filterToRegExp, splitSelector} = require("../common");
+const {textToRegExp, filterToRegExp, splitSelector,
+ qualifySelector} = require("../common");
const {indexOf} = require("../coreUtils");
let MIN_INVOCATION_INTERVAL = 3000;
const MAX_SYNCHRONOUS_PROCESSING_TIME = 50;
const abpSelectorRegexp = /:-abp-([\w-]+)\(/i;
function getCachedPropertyValue(object, name, defaultValueFunc = () => {})
{
@@ -381,17 +382,17 @@
if (subSelector.startsWith("*") &&
!incompletePrefixRegexp.test(prefix))
{
subSelector = subSelector.substr(1);
}
let idx = subSelector.lastIndexOf("::");
if (idx != -1)
subSelector = subSelector.substr(0, idx);
- yield prefix + subSelector;
+ yield qualifySelector(subSelector, prefix);
}
},
*getSelectors(prefix, subtree, styles)
{
for (let selector of this.findPropsSelectors(styles, prefix, this._regexp))
yield [selector, subtree];
}

Powered by Google App Engine
This is Rietveld