1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:57:35 +00:00

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

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)