diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-08 20:31:49 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-08 21:12:20 +0200 |
commit | 92392398a22d5dfde6099fd21d14b5cadcbfd969 (patch) | |
tree | 005719faee765a87f63227d410890a02e949fedb /Libraries/LibWeb/Layout | |
parent | 5072d4e02d914a6d7d09b3ebb79ead2230997a21 (diff) | |
download | serenity-92392398a22d5dfde6099fd21d14b5cadcbfd969.zip |
LibWeb: Add Page abstraction between PageView and main Frame
* A PageView is a view onto a Page object.
* A Page always has a main Frame (root of Frame tree.)
* Page has a PageClient. PageView is a PageClient.
The goal here is to allow building another kind of view onto
a Page while keeping the rest of LibWeb intact.
Diffstat (limited to 'Libraries/LibWeb/Layout')
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutWidget.cpp b/Libraries/LibWeb/Layout/LayoutWidget.cpp index e8f68bf4b2..852a36d218 100644 --- a/Libraries/LibWeb/Layout/LayoutWidget.cpp +++ b/Libraries/LibWeb/Layout/LayoutWidget.cpp @@ -60,8 +60,8 @@ void LayoutWidget::did_set_rect() void LayoutWidget::update_widget() { auto adjusted_widget_position = rect().location().to_int_point(); - if (auto* page_view = document().frame()->page_view()) - adjusted_widget_position.move_by(-page_view->horizontal_scrollbar().value(), -page_view->vertical_scrollbar().value()); + auto& page_view = static_cast<const PageView&>(document().frame()->page().client()); + adjusted_widget_position.move_by(-page_view.horizontal_scrollbar().value(), -page_view.vertical_scrollbar().value()); widget().move_to(adjusted_widget_position); } |