LibHTML: Add some convenient geometry getters on LayoutNode

Add x(), y(), size() and position() and use them around the codebase.
This commit is contained in:
Andreas Kling 2019-10-13 17:31:58 +02:00
parent aefc7f9b22
commit 3309bdf722
Notes: sideshowbarker 2024-07-19 11:42:04 +09:00
7 changed files with 26 additions and 22 deletions

View file

@ -76,14 +76,14 @@ void HtmlView::layout_and_sync_size()
main_frame().set_size(available_size());
document()->layout();
set_content_size(layout_root()->rect().size());
set_content_size(layout_root()->size());
// NOTE: If layout caused us to gain or lose scrollbars, we have to lay out again
// since the scrollbars now take up some of the available space.
if (had_vertical_scrollbar != vertical_scrollbar().is_visible() || had_horizontal_scrollbar != horizontal_scrollbar().is_visible()) {
main_frame().set_size(available_size());
document()->layout();
set_content_size(layout_root()->rect().size());
set_content_size(layout_root()->size());
}
#ifdef HTML_DEBUG