diff --git a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
index dcb5ff2736f..923be22bca1 100644
--- a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
+++ b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp
@@ -15,6 +15,7 @@
#include
#include
#include
+#include
#include
#include
@@ -213,7 +214,12 @@ void EventLoop::process()
// FIXME: 15. Invoke the mark paint timing algorithm for each Document object in docs.
- // FIXME: 16. For each fully active Document in docs, update the rendering or user interface of that Document and its browsing context to reflect the current state.
+ // 16. For each fully active Document in docs, update the rendering or user interface of that Document and its browsing context to reflect the current state.
+ for_each_fully_active_document_in_docs([&](DOM::Document& document) {
+ auto* browsing_context = document.browsing_context();
+ auto& page = browsing_context->page();
+ page.client().schedule_repaint();
+ });
// 13. If all of the following are true
// - this is a window event loop
diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h
index c2f402df5e7..9e05a7d7ef4 100644
--- a/Userland/Libraries/LibWeb/Page/Page.h
+++ b/Userland/Libraries/LibWeb/Page/Page.h
@@ -302,6 +302,8 @@ public:
virtual void inspector_did_request_dom_tree_context_menu([[maybe_unused]] i32 node_id, [[maybe_unused]] CSSPixelPoint position, [[maybe_unused]] String const& type, [[maybe_unused]] Optional const& tag, [[maybe_unused]] Optional const& attribute_name, [[maybe_unused]] Optional const& attribute_value) { }
virtual void inspector_did_execute_console_script([[maybe_unused]] String const& script) { }
+ virtual void schedule_repaint() = 0;
+
protected:
virtual ~PageClient() = default;
};
diff --git a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp
index 9c32a874a52..ada4cb11839 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp
+++ b/Userland/Libraries/LibWeb/SVG/SVGDecodedImageData.cpp
@@ -48,6 +48,7 @@ public:
virtual CSS::PreferredColorScheme preferred_color_scheme() const override { return m_host_page.client().preferred_color_scheme(); }
virtual void request_file(FileRequest) override { }
virtual void paint(DevicePixelRect const&, Gfx::Bitmap&, Web::PaintOptions = {}) override { }
+ virtual void schedule_repaint() override { }
private:
explicit SVGPageClient(Page& host_page)
diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp
index 56d2ed76deb..52f0f882b6e 100644
--- a/Userland/Services/WebContent/PageClient.cpp
+++ b/Userland/Services/WebContent/PageClient.cpp
@@ -222,12 +222,12 @@ void PageClient::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& ta
void PageClient::set_viewport_rect(Web::DevicePixelRect const& rect)
{
page().top_level_traversable()->set_viewport_rect(page().device_to_css_rect(rect));
- schedule_repaint();
+ Web::HTML::main_thread_event_loop().schedule();
}
void PageClient::page_did_invalidate(Web::CSSPixelRect const&)
{
- schedule_repaint();
+ Web::HTML::main_thread_event_loop().schedule();
}
void PageClient::page_did_request_cursor_change(Gfx::StandardCursor cursor)
diff --git a/Userland/Services/WebContent/PageClient.h b/Userland/Services/WebContent/PageClient.h
index 318647f4cde..11af94568f6 100644
--- a/Userland/Services/WebContent/PageClient.h
+++ b/Userland/Services/WebContent/PageClient.h
@@ -28,7 +28,7 @@ public:
static void set_use_gpu_painter();
- void schedule_repaint();
+ virtual void schedule_repaint() override;
virtual Web::Page& page() override { return *m_page; }
virtual Web::Page const& page() const override { return *m_page; }
diff --git a/Userland/Services/WebWorker/PageHost.h b/Userland/Services/WebWorker/PageHost.h
index 55e41a8e1da..61a2b8ef837 100644
--- a/Userland/Services/WebWorker/PageHost.h
+++ b/Userland/Services/WebWorker/PageHost.h
@@ -30,6 +30,7 @@ public:
virtual Web::CSS::PreferredColorScheme preferred_color_scheme() const override;
virtual void paint(Web::DevicePixelRect const&, Gfx::Bitmap&, Web::PaintOptions = {}) override;
virtual void request_file(Web::FileRequest) override;
+ virtual void schedule_repaint() override {};
private:
explicit PageHost(ConnectionFromClient&);