| 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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 PropsSelector.prototype = { | 273 PropsSelector.prototype = { |
| 274 preferHideWithSelector: true, | 274 preferHideWithSelector: true, |
| 275 dependsOnStyles: true, | 275 dependsOnStyles: true, |
| 276 | 276 |
| 277 *findPropsSelectors(styles, prefix, regexp) | 277 *findPropsSelectors(styles, prefix, regexp) |
| 278 { | 278 { |
| 279 for (let style of styles) | 279 for (let style of styles) |
| 280 if (regexp.test(style.style)) | 280 if (regexp.test(style.style)) |
| 281 for (let subSelector of style.subSelectors) | 281 for (let subSelector of style.subSelectors) |
| 282 { | 282 { |
| 283 if (subSelector.startsWith("*") && |
| 284 !incompletePrefixRegexp.test(prefix)) |
| 285 { |
| 286 subSelector = subSelector.substr(1); |
| 287 } |
| 283 let idx = subSelector.lastIndexOf("::"); | 288 let idx = subSelector.lastIndexOf("::"); |
| 284 if (idx != -1) | 289 if (idx != -1) |
| 285 subSelector = subSelector.substr(0, idx); | 290 subSelector = subSelector.substr(0, idx); |
| 286 yield prefix + subSelector; | 291 yield prefix + subSelector; |
| 287 } | 292 } |
| 288 }, | 293 }, |
| 289 | 294 |
| 290 *getSelectors(prefix, subtree, styles) | 295 *getSelectors(prefix, subtree, styles) |
| 291 { | 296 { |
| 292 for (let selector of this.findPropsSelectors(styles, prefix, this._regexp)) | 297 for (let selector of this.findPropsSelectors(styles, prefix, this._regexp)) |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 510 |
| 506 if (this.patterns.length > 0) | 511 if (this.patterns.length > 0) |
| 507 { | 512 { |
| 508 let {document} = this.window; | 513 let {document} = this.window; |
| 509 this.addSelectors(); | 514 this.addSelectors(); |
| 510 document.addEventListener("load", this.onLoad.bind(this), true); | 515 document.addEventListener("load", this.onLoad.bind(this), true); |
| 511 } | 516 } |
| 512 }); | 517 }); |
| 513 } | 518 } |
| 514 }; | 519 }; |
| OLD | NEW |