summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Page
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-04-04 00:12:37 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-04 00:37:54 +0200
commite8739ddab76478b245b6c5c604988364a9191bd0 (patch)
tree5d9af0ab2b59df88fddd5b742e5475e0a78148f9 /Userland/Libraries/LibWeb/Page
parent96b26ec125340b7a0b29754215dc24f372b6d737 (diff)
downloadserenity-e8739ddab76478b245b6c5c604988364a9191bd0.zip
LibWeb+WebContent: Keep track of screen rect
It is now possible to get the up-to-date screen rect from a Web::Page.
Diffstat (limited to 'Userland/Libraries/LibWeb/Page')
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.cpp5
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp
index 1ec5d15666..96b726189f 100644
--- a/Userland/Libraries/LibWeb/Page/Page.cpp
+++ b/Userland/Libraries/LibWeb/Page/Page.cpp
@@ -72,6 +72,11 @@ Gfx::Palette Page::palette() const
return m_client.palette();
}
+Gfx::IntRect Page::screen_rect() const
+{
+ return m_client.screen_rect();
+}
+
bool Page::handle_mousewheel(const Gfx::IntPoint& position, unsigned button, unsigned modifiers, int wheel_delta)
{
return main_frame().event_handler().handle_mousewheel(position, button, modifiers, wheel_delta);
diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h
index a45072edab..6dfe853013 100644
--- a/Userland/Libraries/LibWeb/Page/Page.h
+++ b/Userland/Libraries/LibWeb/Page/Page.h
@@ -74,6 +74,7 @@ public:
bool handle_keydown(KeyCode, unsigned modifiers, u32 code_point);
Gfx::Palette palette() const;
+ Gfx::IntRect screen_rect() const;
private:
PageClient& m_client;
@@ -86,6 +87,7 @@ class PageClient {
public:
virtual bool is_multi_process() const = 0;
virtual Gfx::Palette palette() const = 0;
+ virtual Gfx::IntRect screen_rect() const = 0;
virtual void page_did_set_document_in_main_frame(DOM::Document*) { }
virtual void page_did_change_title(const String&) { }
virtual void page_did_start_loading(const URL&) { }