mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
LibWeb: Protect ad-hoc scroll
against a potentially null paintable box
We perform such a check in other users of the paintable box in this file as the box may be null before layout completes. This prevents UB seen in some CI runs.
This commit is contained in:
parent
4db9996cc0
commit
4e0a926737
1 changed files with 2 additions and 1 deletions
|
@ -1924,7 +1924,8 @@ HashMap<DeprecatedFlyString, CSS::StyleProperty> const& Element::custom_properti
|
||||||
void Element::scroll(double x, double y)
|
void Element::scroll(double x, double y)
|
||||||
{
|
{
|
||||||
// AD-HOC:
|
// AD-HOC:
|
||||||
paintable_box()->scroll_by(x, y);
|
if (auto* paintable_box = this->paintable_box())
|
||||||
|
paintable_box->scroll_by(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://drafts.csswg.org/cssom-view/#dom-element-scroll
|
// https://drafts.csswg.org/cssom-view/#dom-element-scroll
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue