Files
serenity/Tests/LibWeb/Text/input/Element-scrollby-negative-scroll-offset-crash.html
Tim Ledbetter 949ca71b31 LibWeb: Clamp paintable box maximum scroll offset to 0
Previously calling `PaintableBox::set_scroll_offset()` with a
PaintableBox whose content size was larger than its scrollble overflow
rect would cause a crash.

Found by Domato.

(cherry picked from commit 604f6040a180ac409cf338045c8709a171d920d5)
2024-07-22 18:27:26 -04:00

17 lines
339 B
HTML

<!DOCTYPE html>
<style>
#test {
height: 0;
}
</style>
<script src="include.js"></script>
<div id="test">test</div>
<script>
test(() => {
const divElement = document.getElementById("test");
divElement.scrollBy(1, 1);
divElement.remove();
println("PASS (didn't crash)");
});
</script>