mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
code review re. #1912
This commit is contained in:
parent
95ec573141
commit
21f3dc83ec
1 changed files with 8 additions and 6 deletions
|
@ -296,6 +296,7 @@ var domFilterer = {
|
|||
enabled: true,
|
||||
hiddenId: vAPI.randomToken(),
|
||||
hiddenNodeCount: 0,
|
||||
hiddenNodeEnforcer: false,
|
||||
loggerEnabled: undefined,
|
||||
styleTags: [],
|
||||
|
||||
|
@ -434,10 +435,6 @@ var domFilterer = {
|
|||
this.job1._0.length = 0;
|
||||
}
|
||||
|
||||
if ( styleText !== '' ) {
|
||||
this.addStyleTag(styleText);
|
||||
}
|
||||
|
||||
// Simple selectors: incremental.
|
||||
|
||||
// Stock job 2 = simple css selectors/hide
|
||||
|
@ -472,14 +469,19 @@ var domFilterer = {
|
|||
// user styles, this allows uBO to win.
|
||||
var commitHit = this.hiddenNodeCount !== beforeHiddenNodeCount;
|
||||
if ( commitHit ) {
|
||||
if ( beforeHiddenNodeCount === 0 ) {
|
||||
this.addStyleTag(':root *[' + this.hiddenId + '][hidden] { display: none !important; }');
|
||||
if ( this.hiddenNodeEnforcer === false ) {
|
||||
styleText += '\n:root *[' + this.hiddenId + '][hidden] { display: none !important; }';
|
||||
this.hiddenNodeEnforcer = true;
|
||||
}
|
||||
this.addedNodesHandlerMissCount = 0;
|
||||
} else {
|
||||
this.addedNodesHandlerMissCount += 1;
|
||||
}
|
||||
|
||||
if ( styleText !== '' ) {
|
||||
this.addStyleTag(styleText);
|
||||
}
|
||||
|
||||
// Un-hide nodes previously hidden.
|
||||
i = complexSelectorsOldResultSet.size;
|
||||
if ( i !== 0 ) {
|
||||
|
|
Loading…
Reference in a new issue