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

LibWeb: Update layout in Element.getBoundingClientRect()

This commit is contained in:
Andreas Kling 2022-04-10 20:44:29 +02:00
parent 60ec006265
commit 25f6d2e2ab

View file

@ -539,6 +539,9 @@ bool Element::serializes_as_void() const
// https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect
NonnullRefPtr<Geometry::DOMRect> Element::get_bounding_client_rect() const
{
// // NOTE: Ensure that layout is up-to-date before looking at metrics.
const_cast<Document&>(document()).update_layout();
// FIXME: Support inline layout nodes as well.
auto* paint_box = this->paint_box();
if (!paint_box)