mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
Now that the implementation is in FormAssociatedElement, the implementation in HTMLInputElement is effectively just a passthrough, with some minor differences to handle small behavioural quirks between the two (such as the difference in nullability of types).
24 lines
940 B
HTML
24 lines
940 B
HTML
<input type="text" id="ladybird-text-input"></input>
|
|
<input type="date" id="ladybird-date-input"></input>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
let textInput = document.getElementById("ladybird-text-input");
|
|
let dateInput = document.getElementById("ladybird-date-input");
|
|
|
|
println(`text selectionStart: ${textInput.selectionStart}`);
|
|
println(`text selectionEnd: ${textInput.selectionEnd}`);
|
|
println(`date selectionStart: ${dateInput.selectionStart}`);
|
|
println(`date selectionEnd: ${dateInput.selectionEnd}`);
|
|
|
|
textInput.value = "Well hello friends";
|
|
println(`text selectionStart: ${textInput.selectionStart}`);
|
|
println(`text selectionEnd: ${textInput.selectionEnd}`);
|
|
|
|
try {
|
|
dateInput.selectionStart = 0;
|
|
} catch (e) {
|
|
println(`date input setting selectionStart error: ${e}`);
|
|
}
|
|
});
|
|
</script>
|