Changes between Version 2 and Version 5 of Ticket #6847


Ignore:
Timestamp:
08/28/2018 08:56:53 AM (2 years ago)
Author:
mjethani
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6847

    • Property Status changed from new to reviewing
  • Ticket #6847 – Description

    v2 v5  
    66=== What to change === 
    77Let `hide-if-contains` and `hide-if-shadow-contains` treat the search string as a regular expression if the string is surrounded by `/`. 
     8 
     9=== Hints for testers === 
     10Test that both `hide-if-contains` and `hide-if-shadow-contains` work as described in #6809 and #6798 respectively (i.e. no regressions). 
     11 
     12For this change, try the following test: 
     13 
     14{{{ 
     15<!-- test.html --> 
     16<div> 
     17  Lorem ipsum dolor sit amet, consectetur 
     18  adipiscing elit, sed do eiusmod tempor 
     19  incididunt ut labore et dolore magna aliqua. 
     20</div> 
     21<script src="script.js"></script> 
     22}}} 
     23 
     24{{{ 
     25/* script.js */ 
     26setTimeout(() => 
     27{        
     28  let ad = document.createElement("div"); 
     29  ad.id = Math.random().toString(36).substring(2); 
     30  ad.innerHTML = "<div><span>Check this!</span> <span class='label'>Ad</span></div>"; 
     31  document.body.appendChild(ad); 
     32   
     33  let result = document.createElement("div"); 
     34  result.id = Math.random().toString(36).substring(2); 
     35  result.innerHTML = "<div><span>The Adventures of Tom Sawyer</span></div>"; 
     36  document.body.appendChild(result); 
     37}, 
     38500); 
     39}}} 
     40 
     41The filter `#$#hide-if-contains /\\bAd\\b/ div[id]` should hide the "Check this!" ad and not the "The Adventures of Tom Sawyer" content.