mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Rename Layout::Box::size() to content_size()
This property represents the CSS content size, so let's reduce ambiguity by using the spec terminology. We also bring a bunch of related functions along for the ride.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0608de8c129
@@ -61,7 +61,7 @@ void InProcessWebView::set_preferred_color_scheme(CSS::PreferredColorScheme colo
|
||||
void InProcessWebView::page_did_layout()
|
||||
{
|
||||
VERIFY(layout_root());
|
||||
set_content_size(layout_root()->size().to_type<int>());
|
||||
set_content_size(layout_root()->content_size().to_type<int>());
|
||||
}
|
||||
|
||||
void InProcessWebView::page_did_change_title(const String& title)
|
||||
@@ -177,13 +177,13 @@ void InProcessWebView::layout_and_sync_size()
|
||||
bool had_horizontal_scrollbar = horizontal_scrollbar().is_visible();
|
||||
|
||||
page().top_level_browsing_context().set_size(available_size());
|
||||
set_content_size(layout_root()->size().to_type<int>());
|
||||
set_content_size(layout_root()->content_size().to_type<int>());
|
||||
|
||||
// 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()) {
|
||||
page().top_level_browsing_context().set_size(available_size());
|
||||
set_content_size(layout_root()->size().to_type<int>());
|
||||
set_content_size(layout_root()->content_size().to_type<int>());
|
||||
}
|
||||
|
||||
page().top_level_browsing_context().set_viewport_scroll_offset({ horizontal_scrollbar().value(), vertical_scrollbar().value() });
|
||||
|
||||
Reference in New Issue
Block a user