mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibWeb: Make sure layout is up to date in Element::scroll_height()
This commit is contained in:
parent
639e9b5012
commit
89319cd0c9
1 changed files with 3 additions and 0 deletions
|
@ -1407,6 +1407,9 @@ int Element::scroll_height() const
|
|||
if (!document.is_active())
|
||||
return 0;
|
||||
|
||||
// NOTE: Ensure that layout is up-to-date before looking at metrics.
|
||||
const_cast<Document&>(document).update_layout();
|
||||
|
||||
// 3. Let viewport height be the height of the viewport excluding the height of the scroll bar, if any,
|
||||
// or zero if there is no viewport.
|
||||
auto viewport_height = document.viewport_rect().height().to_int();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue