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.
This commit is contained in:
Luke Wilde 2022-07-05 17:16:50 +01:00 committed by Linus Groh
parent 3294753d6c
commit a4e3fff3fb
Notes: sideshowbarker 2024-07-17 10:31:19 +09:00

View file

@ -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)