selection-attention-in-user-select-none.html (875B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Normal selection for the "Find in Page" result should be painted even if `user-select:none`</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <script> 8 "use strict"; 9 10 addEventListener("DOMContentLoaded", () => { 11 // Select "THIS". 12 getSelection().setBaseAndExtent( 13 document.body.firstChild, 14 "Look for ".length, 15 document.body.firstChild, 16 "Look for THIS".length 17 ); 18 const selCon = SpecialPowers.wrap(window).docShell 19 .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor) 20 .getInterface(SpecialPowers.Ci.nsISelectionDisplay) 21 .QueryInterface(SpecialPowers.Ci.nsISelectionController); 22 selCon.setDisplaySelection(SpecialPowers.Ci.nsISelectionController.SELECTION_ATTENTION); 23 }, {once: true}); 24 </script> 25 </head> 26 <body style="user-select:none">Look for THIS.</body> 27 </html>