mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:17:35 +00:00
LibWeb: Update layout in Element.getBoundingClientRect()
This commit is contained in:
parent
60ec006265
commit
25f6d2e2ab
1 changed files with 3 additions and 0 deletions
|
@ -539,6 +539,9 @@ bool Element::serializes_as_void() const
|
||||||
// https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect
|
// https://drafts.csswg.org/cssom-view/#dom-element-getboundingclientrect
|
||||||
NonnullRefPtr<Geometry::DOMRect> Element::get_bounding_client_rect() const
|
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.
|
// FIXME: Support inline layout nodes as well.
|
||||||
auto* paint_box = this->paint_box();
|
auto* paint_box = this->paint_box();
|
||||||
if (!paint_box)
|
if (!paint_box)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue