diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 555b3e1772..d4e7abff7a 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -2033,7 +2033,7 @@ void Navigable::set_needs_display() set_needs_display(viewport_rect()); } -void Navigable::set_needs_display(CSSPixelRect const& rect) +void Navigable::set_needs_display(CSSPixelRect const&) { // FIXME: Ignore updates outside the visible viewport rect. // This requires accounting for fixed-position elements in the input rect, which we don't do yet. @@ -2041,7 +2041,8 @@ void Navigable::set_needs_display(CSSPixelRect const& rect) m_needs_repaint = true; if (is(*this)) { - static_cast(this)->page().client().page_did_invalidate(to_top_level_rect(rect)); + // Schedule the main thread event loop, which will, in turn, schedule a repaint. + Web::HTML::main_thread_event_loop().schedule(); return; } diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index 9d3c9a98ca..7f261db6f2 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -253,7 +253,6 @@ public: virtual void page_did_leave_tooltip_area() { } virtual void page_did_hover_link(const AK::URL&) { } virtual void page_did_unhover_link() { } - virtual void page_did_invalidate(CSSPixelRect const&) { } virtual void page_did_change_favicon(Gfx::Bitmap const&) { } virtual void page_did_layout() { } virtual void page_did_request_scroll(i32, i32) { } diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index 9fc012c270..73dc906753 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -224,11 +224,6 @@ void PageClient::set_viewport_rect(Web::DevicePixelRect const& rect) page().top_level_traversable()->set_viewport_rect(page().device_to_css_rect(rect)); } -void PageClient::page_did_invalidate(Web::CSSPixelRect const&) -{ - Web::HTML::main_thread_event_loop().schedule(); -} - void PageClient::page_did_request_cursor_change(Gfx::StandardCursor cursor) { client().async_did_request_cursor_change(m_id, (u32)cursor); diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h index a627faefac..fb40371dd3 100644 --- a/Userland/Services/WebContent/PageClient.h +++ b/Userland/Services/WebContent/PageClient.h @@ -88,7 +88,6 @@ private: virtual Gfx::Palette palette() const override; virtual Web::DevicePixelRect screen_rect() const override { return m_screen_rect; } virtual Web::CSS::PreferredColorScheme preferred_color_scheme() const override { return m_preferred_color_scheme; } - virtual void page_did_invalidate(Web::CSSPixelRect const&) override; virtual void page_did_request_cursor_change(Gfx::StandardCursor) override; virtual void page_did_layout() override; virtual void page_did_change_title(ByteString const&) override;