Previously, if the find in page query was updated and no matches were found we would keep the old selection instead of clearing it. `window.find` behaves differently from the find in page UI and preserves the old behavior.
14 lines
484 B
HTML
14 lines
484 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<div>findable text</div>
|
|
<script>
|
|
test(() => {
|
|
const selection = window.getSelection();
|
|
|
|
const foundResult = window.find("findable");
|
|
println(`window.find("findable"): ${foundResult}, rangeCount: ${selection.rangeCount}`);
|
|
|
|
const missingResult = window.find("nonexistent");
|
|
println(`window.find("nonexistent"): ${missingResult}, rangeCount: ${selection.rangeCount}`);
|
|
});
|
|
</script>
|