mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 02:28:12 +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:
parent
eb1c99bd72
commit
decc071060
3 changed files with 31 additions and 0 deletions
|
@ -1085,8 +1085,16 @@ double Element::scroll_top() const
|
|||
if (!layout_node() || !is<Layout::Box>(layout_node()))
|
||||
return 0.0;
|
||||
|
||||
// FIXME: Ideally we would stop creating a layout node for column group so that a layout node would always have
|
||||
// a paintable, but in the meantime, special case this node.
|
||||
if (layout_node()->display().is_table_column_group()) {
|
||||
VERIFY(!paintable_box());
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
// 9. Return the y-coordinate of the scrolling area at the alignment point with the top of the padding edge of the element.
|
||||
// FIXME: Is this correct?
|
||||
VERIFY(paintable_box());
|
||||
return paintable_box()->scroll_offset().y().to_double();
|
||||
}
|
||||
|
||||
|
@ -1125,8 +1133,16 @@ double Element::scroll_left() const
|
|||
if (!layout_node() || !is<Layout::Box>(layout_node()))
|
||||
return 0.0;
|
||||
|
||||
// FIXME: Ideally we would stop creating a layout node for column group so that a layout node would always have
|
||||
// a paintable, but in the meantime, special case this node.
|
||||
if (layout_node()->display().is_table_column_group()) {
|
||||
VERIFY(!paintable_box());
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
// 9. Return the x-coordinate of the scrolling area at the alignment point with the left of the padding edge of the element.
|
||||
// FIXME: Is this correct?
|
||||
VERIFY(paintable_box());
|
||||
return paintable_box()->scroll_offset().x().to_double();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue