mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
LibWeb: Make sure layout is up to date in Element::scroll_height()
This commit is contained in:
parent
639e9b5012
commit
89319cd0c9
Notes:
sideshowbarker
2024-07-17 02:59:43 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/89319cd0c9 Pull-request: https://github.com/SerenityOS/serenity/pull/23210
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…
Reference in a new issue