mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
We were not applying the descendants' transformation when hit testing on fragments, which meant selection offsets on scrolled containers were off.
29 lines
777 B
HTML
29 lines
777 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
input {
|
|
font-size: 16px;
|
|
width: 100px;
|
|
padding: 2px;
|
|
border: 1px solid;
|
|
}
|
|
</style>
|
|
<input value="foobarbazloremipsum foobarbazloremipsum" />
|
|
<script src="include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const input = document.querySelector("input");
|
|
input.offsetWidth;
|
|
input.focus();
|
|
|
|
// Scroll the inner text element to the right.
|
|
const innerText = internals.getShadowRoot(input).querySelector("div > div");
|
|
innerText.scrollLeft = 100;
|
|
|
|
// Click near the left edge of the input.
|
|
const rect = input.getBoundingClientRect();
|
|
internals.click(rect.left + 5, rect.top + rect.height / 2);
|
|
|
|
println(input.selectionStart);
|
|
});
|
|
</script>
|