1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

LibWeb: Make factory methods of Geometry::DOMRect fallible

This commit is contained in:
Kenneth Myhra 2023-02-19 18:21:27 +01:00 committed by Andreas Kling
parent 9b190b9509
commit ec0049441c
4 changed files with 9 additions and 8 deletions

View file

@ -657,12 +657,12 @@ JS::NonnullGCPtr<Geometry::DOMRect> Element::get_bounding_client_rect() const
// FIXME: Support inline layout nodes as well.
auto* paint_box = this->paint_box();
if (!paint_box)
return Geometry::DOMRect::construct_impl(realm(), 0, 0, 0, 0);
return Geometry::DOMRect::construct_impl(realm(), 0, 0, 0, 0).release_value_but_fixme_should_propagate_errors();
VERIFY(document().browsing_context());
auto viewport_offset = document().browsing_context()->viewport_scroll_offset();
return Geometry::DOMRect::create(realm(), paint_box->absolute_rect().translated(-viewport_offset.x(), -viewport_offset.y()).to_type<float>());
return Geometry::DOMRect::create(realm(), paint_box->absolute_rect().translated(-viewport_offset.x(), -viewport_offset.y()).to_type<float>()).release_value_but_fixme_should_propagate_errors();
}
// https://drafts.csswg.org/cssom-view/#dom-element-getclientrects