1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:07:36 +00:00

LibWeb: Return a scroll offset of 0 for colgroup elements

Ideally we would not create a layout node at all for these elements so
that every layout node would always have a paintable associated with it.
But for now, to fix the crash, just leave a FIXME and special case this
element.

Also leave a VERIFY to make it easier to debug this type of crash in the
future.

Fixes a crash seen on codecov.io for my 'patch' project.
This commit is contained in:
Shannon Booth 2023-10-08 10:55:51 +13:00 committed by Alexander Kalenik
parent eb1c99bd72
commit decc071060
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,2 @@
scroll left = 0
scroll top = 0

View file

@ -0,0 +1,13 @@
<table>
<colgroup id="my-group">
<col width="40">
<col></colgroup>
<tbody>
<script src="include.js"></script>
<script>
test(() => {
const element = document.getElementById('my-group');
println(`scroll left = ${element.scrollLeft}`);
println(`scroll top = ${element.scrollTop}`);
});
</script>