Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Normal selection for the "Find in Page" result should be painted even if `user-select:none`</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script>
"use strict";
addEventListener("DOMContentLoaded", () => {
// Select "THIS".
getSelection().setBaseAndExtent(
document.body.firstChild,
"Look for ".length,
document.body.firstChild,
"Look for THIS".length
);
const selCon = SpecialPowers.wrap(window).docShell
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsISelectionDisplay)
.QueryInterface(SpecialPowers.Ci.nsISelectionController);
selCon.setDisplaySelection(SpecialPowers.Ci.nsISelectionController.SELECTION_ATTENTION);
}, {once: true});
</script>
</head>
<body style="user-select:none">Look for THIS.</body>
</html>