mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 07:02:54 +00:00
With a8077f79cc
Selection object is no
longer aware of selection state inside text controls (<textarea> and
<input>), so this change makes them responsible for dispatching
`selectionchange` if their selection state was changed.
16 lines
606 B
HTML
16 lines
606 B
HTML
<!DOCTYPE html>
|
|
<script src="include.js"></script>
|
|
<textarea id="textarea">hello hmmm</textarea>
|
|
<script>
|
|
asyncTest(done => {
|
|
const textarea = document.getElementById("textarea");
|
|
textarea.addEventListener("selectionchange", event => {
|
|
const start = textarea.selectionStart;
|
|
const end = textarea.selectionEnd;
|
|
println(`selectionchange event dispatched on textarea should bubble: ${event.bubbles}`);
|
|
println(`Selected range: ${start} - ${end}`);
|
|
done();
|
|
});
|
|
textarea.setSelectionRange(6, 10);
|
|
});
|
|
</script>
|