summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-07-05 17:16:50 +0100
committerLinus Groh <mail@linusgroh.de>2022-07-05 18:23:22 +0200
commita4e3fff3fb551b49709c1c76156e849512958379 (patch)
tree6d187d4b13a89d73ce09263cc0605c92bca2ded4
parent3294753d6c2f228edef4fb20700128f7843c477b (diff)
downloadserenity-a4e3fff3fb551b49709c1c76156e849512958379.zip
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.
-rw-r--r--Userland/Services/WebContent/PageHost.cpp2
1 files changed, 2 insertions, 0 deletions
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)