From a4e3fff3fb551b49709c1c76156e849512958379 Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Tue, 5 Jul 2022 17:16:50 +0100 Subject: [PATCH] WebContent: Invalidate document style when changing the page's palette This makes the page automatically update to reflect the system theme when in "Color Scheme > Follow System Theme" mode without having to manually cause a style update. --- Userland/Services/WebContent/PageHost.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index 5e377d4117..883c5fa43a 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -53,6 +53,8 @@ Gfx::Palette PageHost::palette() const void PageHost::set_palette_impl(Gfx::PaletteImpl const& impl) { m_palette_impl = impl; + if (auto* document = page().top_level_browsing_context().active_document()) + document->invalidate_style(); } void PageHost::set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme)